Apache Commons logo Commons Imaging™ logo

JavaNCSS Metric Results

[ package ] [ object ] [ method ] [ explanation ]

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 33.54.
JavaNCSS web site.

Packages

Packages

[ package ] [ object ] [ method ] [ explanation ]

Packages sorted by NCSS.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.apache.commons.imaging.formats.tiff 11 152 1941 12 82 163 206
org.apache.commons.imaging.formats.tiff.write 9 112 1196 3 31 94 144
org.apache.commons.imaging.common 15 150 1184 16 87 35 282
org.apache.commons.imaging.formats.png 16 90 1168 3 12 121 428
org.apache.commons.imaging.formats.tiff.constants 22 26 1118 17 91 38 389
org.apache.commons.imaging 13 200 998 135 1666 55 317
org.apache.commons.imaging.formats.bmp 11 54 911 1 10 126 195
org.apache.commons.imaging.palette 15 59 891 11 66 19 259
org.apache.commons.imaging.color 10 77 822 0 0 76 595
org.apache.commons.imaging.formats.jpeg 5 46 816 4 32 299 99
org.apache.commons.imaging.formats.pnm 13 84 766 1 10 51 227
org.apache.commons.imaging.common.itu_t4 6 37 713 8 67 18 115
org.apache.commons.imaging.formats.gif 7 38 664 1 10 88 131
org.apache.commons.imaging.formats.pcx 3 28 600 1 10 140 63
org.apache.commons.imaging.formats.jpeg.decoder 6 29 593 2 11 58 145
org.apache.commons.imaging.formats.jpeg.segments 13 54 518 11 50 61 209
org.apache.commons.imaging.formats.xpm 1 25 482 1 10 4 33
org.apache.commons.imaging.formats.ico 1 19 466 1 10 147 35
org.apache.commons.imaging.formats.psd 5 35 460 2 15 126 99
org.apache.commons.imaging.formats.jpeg.iptc 9 42 437 14 156 74 188
org.apache.commons.imaging.formats.tiff.datareaders 4 21 428 3 20 87 69
org.apache.commons.imaging.formats.icns 4 40 417 1 10 34 84
org.apache.commons.imaging.formats.tiff.taginfos 25 77 415 5 22 28 402
org.apache.commons.imaging.icc 9 49 403 0 0 202 163
org.apache.commons.imaging.common.mylzw 5 47 380 0 0 15 99
org.apache.commons.imaging.formats.png.chunks 12 33 301 6 18 13 201
org.apache.commons.imaging.formats.tiff.fieldtypes 8 28 300 1 3 9 128
org.apache.commons.imaging.common.bytesource 4 30 249 1 4 9 83
org.apache.commons.imaging.formats.jpeg.xmp 3 23 247 11 97 20 48
org.apache.commons.imaging.formats.xbm 1 17 240 1 10 4 33
org.apache.commons.imaging.util 2 28 211 1 3 4 51
org.apache.commons.imaging.formats.tiff.photometricinterpreters 8 20 200 1 17 27 132
org.apache.commons.imaging.formats.jpeg.exif 1 17 190 15 205 21 16
org.apache.commons.imaging.formats.rgbe 3 23 190 1 5 8 67
org.apache.commons.imaging.formats.wbmp 1 17 156 1 10 5 33
org.apache.commons.imaging.formats.dcx 1 15 136 1 10 9 35
org.apache.commons.imaging.formats.psd.dataparsers 8 18 104 0 0 2 128
org.apache.commons.imaging.formats.psd.datareaders 3 5 95 0 0 6 48
org.apache.commons.imaging.formats.png.scanlinefilters 6 10 86 0 0 23 96
org.apache.commons.imaging.formats.png.transparencyfilters 4 10 60 2 6 2 64
org.apache.commons.imaging.formats.tga 0 0 2 0 0 247 16
org.apache.commons.imaging.formats 0 0 1 0 0 0 19
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
303 1885 21555 295 2866 2568 6174

Objects

Objects

[ package ] [ object ] [ method ] [ explanation ]

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.commons.imaging.formats.gif.GifImageParser 524 30 0 1
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression 520 17 0 5
org.apache.commons.imaging.formats.jpeg.JpegImageParser 478 26 5 1
org.apache.commons.imaging.color.ColorConversions 457 41 0 0
org.apache.commons.imaging.formats.xpm.XpmImageParser 444 25 3 1
org.apache.commons.imaging.formats.bmp.BmpImageParser 440 20 0 1
org.apache.commons.imaging.formats.ico.IcoImageParser 434 19 7 1
org.apache.commons.imaging.formats.tiff.TiffDirectory 381 47 1 0
org.apache.commons.imaging.formats.png.PngImageParser 379 21 0 1
org.apache.commons.imaging.formats.psd.PsdImageParser 328 23 0 1
org.apache.commons.imaging.formats.png.PngWriter 322 19 2 0
org.apache.commons.imaging.formats.tiff.write.TiffImageWriterBase 322 10 0 0
org.apache.commons.imaging.Imaging 322 70 0 59
org.apache.commons.imaging.formats.tiff.TiffImageParser 319 19 0 1
org.apache.commons.imaging.formats.tiff.TiffField 307 29 1 9
org.apache.commons.imaging.formats.tiff.TiffImageMetadata 289 23 3 0
org.apache.commons.imaging.common.BasicCParser 284 5 0 1
org.apache.commons.imaging.formats.pcx.PcxImageParser 281 19 1 1
org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory 276 44 2 2
org.apache.commons.imaging.palette.PaletteFactory 274 15 1 5
org.apache.commons.imaging.formats.pcx.PcxWriter 263 8 0 0
org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder 245 11 0 0
org.apache.commons.imaging.common.ByteConversions 242 45 0 1
org.apache.commons.imaging.formats.tiff.constants.ExifTagConstants 237 1 0 1
org.apache.commons.imaging.formats.tiff.TiffReader 236 13 3 0
org.apache.commons.imaging.formats.jpeg.decoder.Dct 233 9 0 2
org.apache.commons.imaging.formats.pnm.PnmImageParser 226 15 0 1
org.apache.commons.imaging.formats.xbm.XbmImageParser 207 17 2 1
org.apache.commons.imaging.util.Debug 184 26 0 0
org.apache.commons.imaging.formats.tiff.constants.TiffTagConstants 171 1 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.commons.imaging.Imaging 322 70 0 59
org.apache.commons.imaging.formats.tiff.TiffDirectory 381 47 1 0
org.apache.commons.imaging.common.ByteConversions 242 45 0 1
org.apache.commons.imaging.ImageParser 133 45 0 46
org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory 276 44 2 2
org.apache.commons.imaging.color.ColorConversions 457 41 0 0
org.apache.commons.imaging.formats.gif.GifImageParser 524 30 0 1
org.apache.commons.imaging.formats.tiff.TiffField 307 29 1 9
org.apache.commons.imaging.common.BinaryFunctions 153 27 0 1
org.apache.commons.imaging.formats.jpeg.JpegImageParser 478 26 5 1
org.apache.commons.imaging.util.Debug 184 26 0 0
org.apache.commons.imaging.formats.tiff.write.TiffOutputSet 139 25 0 1
org.apache.commons.imaging.formats.xpm.XpmImageParser 444 25 3 1
org.apache.commons.imaging.formats.psd.PsdImageParser 328 23 0 1
org.apache.commons.imaging.formats.tiff.TiffImageMetadata 289 23 3 0
org.apache.commons.imaging.ImageInfo 117 22 2 19
org.apache.commons.imaging.formats.png.PngImageParser 379 21 0 1
org.apache.commons.imaging.formats.bmp.BmpImageParser 440 20 0 1
org.apache.commons.imaging.formats.ico.IcoImageParser 434 19 7 1
org.apache.commons.imaging.formats.pcx.PcxImageParser 281 19 1 1
org.apache.commons.imaging.formats.png.PngWriter 322 19 2 0
org.apache.commons.imaging.formats.tiff.TiffImageParser 319 19 0 1
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression 520 17 0 5
org.apache.commons.imaging.formats.icns.IcnsImageParser 166 17 3 1
org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter 165 17 7 15
org.apache.commons.imaging.formats.wbmp.WbmpImageParser 128 17 1 1
org.apache.commons.imaging.formats.xbm.XbmImageParser 207 17 2 1
org.apache.commons.imaging.PixelDensity 62 17 0 1
org.apache.commons.imaging.common.mylzw.MyLzwCompressor 137 16 2 0
org.apache.commons.imaging.ColorTools 80 15 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
63.79 21,555.00 0.33 6.22 0.97

Methods

Methods

[ package ] [ object ] [ method ] [ explanation ]

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.commons.imaging.formats.jpeg.JpegImageParser.getImageInfo(ByteSource,Object) 216 100 0
org.apache.commons.imaging.formats.png.PngWriter.writeImage(BufferedImage,OutputStream,Object) 151 47 0
org.apache.commons.imaging.formats.tiff.write.TiffImageWriterBase.writeImage(BufferedImage,OutputStream,Object) 143 47 0
org.apache.commons.imaging.common.BasicCParser.preprocess(InputStream,StringBuilder,String) 142 61 0
org.apache.commons.imaging.formats.ico.IcoImageParser.writeImage(BufferedImage,OutputStream,Object) 133 35 0
org.apache.commons.imaging.formats.gif.GifImageParser.writeImage(BufferedImage,OutputStream,Object) 120 36 0
org.apache.commons.imaging.formats.tiff.TiffField.getValueDescription(Object) 117 49 0
org.apache.commons.imaging.formats.bmp.BmpImageParser.readBmpHeaderInfo(InputStream,FormatCompliance,boolean) 116 15 0
org.apache.commons.imaging.formats.pnm.PnmImageParser.readHeader(InputStream) 109 58 0
org.apache.commons.imaging.formats.tiff.write.TiffImageWriterBase.validateDirectories(TiffOutputSet) 99 51 0
org.apache.commons.imaging.formats.bmp.BmpImageParser.readImageContents(InputStream,FormatCompliance,boolean) 98 33 0
org.apache.commons.imaging.formats.png.PngImageParser.getBufferedImage(ByteSource,Object) 98 39 0
org.apache.commons.imaging.formats.tiff.TiffImageParser.getImageInfo(ByteSource,Object) 97 27 0
org.apache.commons.imaging.formats.ico.IcoImageParser.readBitmapIconData(IconData[],IconInfo) 96 24 0
org.apache.commons.imaging.Imaging.guessFormat(ByteSource) 96 47 1
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.compressT4_2D(ioException[][],int,int,boolean,int) 87 22 0
org.apache.commons.imaging.formats.png.PngImageParser.getImageInfo(ByteSource,Object) 87 26 0
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.decompressT4_2D(outputStream.toByteArray[][],int,int,boolean) 86 26 1
org.apache.commons.imaging.formats.pcx.PcxImageParser.readImage(PcxHeader,InputStream,ByteSource) 85 40 0
org.apache.commons.imaging.formats.tiff.TiffReader.readDirectory(ByteSource,long,int,FormatCompliance,Listener,boolean,Number) 84 34 0
org.apache.commons.imaging.formats.jpeg.segments.Segment.getSegmentType() 78 78 0
org.apache.commons.imaging.palette.MostPopulatedBoxesMedianCut.performNextMedianCut(ColorGroup,boolean) 77 24 0
org.apache.commons.imaging.common.BasicCParser.unescapeString(StringBuilder,String) 76 44 0
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.compressT6(outputStream.toByteArray[][],int,int) 76 19 0
org.apache.commons.imaging.formats.jpeg.decoder.Dct.inverseDCT8x8(a7[]) 71 3 0
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.decompressT6(ioException[][],int,int) 70 19 1
org.apache.commons.imaging.formats.jpeg.decoder.Dct.forwardDCT8x8(a43[]) 69 3 0
org.apache.commons.imaging.icc.IccProfileParser.readICCProfileInfo(InputStream) 66 20 0
org.apache.commons.imaging.formats.gif.GifImageParser.getBufferedImage(ByteSource,Object) 62 23 0
org.apache.commons.imaging.formats.icns.IcnsDecoder.decodeAllImages(IcnsImageParser.IcnsElement[]) 62 25 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
21,555.00 8.04 3.23 0.11

Explanations

Explanations

[ package ] [ object ] [ method ] [ explanation ]

Non Commenting Source Statements (NCSS)

Statements for JavaNCSS are not statements as specified in the Java Language Specification but include all kinds of declarations too. Roughly spoken, NCSS is approximately equivalent to counting ';' and '{' characters in Java source files.

Not counted are empty statements, empty blocks or semicolons after closing brackets. Of course, comments don't get counted too. Closing brackets also never get counted, the same applies to blocks in general.

Examples
Package declaration package java.lang;
Import declaration import java.awt.*;
Class declaration
  • public class Foo {
  • public class Foo extends Bla {
Interface declaration public interface Able ; {
Field declaration
  • int a;
  • int a, b, c = 5, d = 6;
Method declaration
  • public void cry();
  • public void gib() throws DeadException {
Constructor declaration public Foo() {
Constructor invocation
  • this();
  • super();
Statement declaration
  • i = 0;
  • if (ok)
  • if (exit) {
  • if (3 == 4);
  • if (4 == 4) { ;
  • } else {
Label declaration fine :

In some cases consecutive semicolons are illegal according to the JLS but JavaNCSS still tolerates them (thought JavaNCSS is still more strict as 'javac'). Nevertheless they are never counted as two statements.

Cyclomatic Complexity Number (CCN)

CCN is also know as McCabe Metric. There exists a much hyped theory behind it based on graph theory, but it all comes down to simply counting 'if', 'for', 'while' statements etc. in a method. Whenever the control flow of a method splits, the "CCN counter" gets incremented by one.

Each method has a minimum value of 1 per default. For each of the following Java keywords/statements this value gets incremented by one:

  • if
  • for
  • while
  • case
  • catch

Also if the control flow of a method returns abortively the CCNvalue will be incremented by one:

  • if
  • for

An ordinary return at the end of method will not be counted.

Note that 'else', 'default', and 'finally' don't increment the CCN value any further. On the other hand, a simple method with a 'switch' statement and a huge block of 'case' statements can have a surprisingly high CCN value (still it has the same value when converting a 'switch' block to an equivalent sequence of 'if' statements).