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 32.53.
JavaNCSS web site.

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 25 207 1890 12 82 241 190
org.apache.commons.imaging.formats.tiff.write 16 125 1193 3 31 94 144
org.apache.commons.imaging.common 18 160 1184 16 87 35 280
org.apache.commons.imaging.formats.tiff.constants 24 6 1119 17 91 37 421
org.apache.commons.imaging.formats.png 20 88 1111 1 3 119 401
org.apache.commons.imaging 13 199 997 135 1666 55 317
org.apache.commons.imaging.formats.bmp 13 54 911 1 10 126 195
org.apache.commons.imaging.palette 20 65 892 11 66 19 259
org.apache.commons.imaging.color 10 77 822 0 0 76 595
org.apache.commons.imaging.formats.jpeg 12 67 816 4 32 299 99
org.apache.commons.imaging.formats.pnm 16 90 749 1 10 51 227
org.apache.commons.imaging.common.itu_t4 8 39 713 8 67 18 115
org.apache.commons.imaging.formats.gif 7 38 669 1 10 88 131
org.apache.commons.imaging.formats.pcx 4 29 599 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 17 66 518 11 50 61 209
org.apache.commons.imaging.formats.xpm 4 28 482 1 10 4 33
org.apache.commons.imaging.formats.ico 8 36 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 12 43 429 9 98 74 191
org.apache.commons.imaging.formats.tiff.datareaders 4 21 428 3 20 87 69
org.apache.commons.imaging.formats.icns 7 45 419 1 10 34 84
org.apache.commons.imaging.formats.tiff.taginfos 26 78 415 5 22 28 402
org.apache.commons.imaging.icc 9 49 404 0 0 202 163
org.apache.commons.imaging.common.mylzw 8 56 380 0 0 15 99
org.apache.commons.imaging.formats.tiff.fieldtypes 8 28 300 1 3 9 128
org.apache.commons.imaging.formats.png.chunks 11 31 273 6 18 13 185
org.apache.commons.imaging.common.bytesource 6 35 249 0 0 14 87
org.apache.commons.imaging.formats.jpeg.xmp 13 45 247 11 97 20 48
org.apache.commons.imaging.formats.xbm 3 19 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 8 28 190 15 205 21 16
org.apache.commons.imaging.formats.rgbe 3 23 190 1 5 8 67
org.apache.commons.imaging.formats.wbmp 2 19 156 1 10 5 33
org.apache.commons.imaging.formats.dcx 2 17 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 96 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
399 2066 21400 287 2795 2648 6152

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.commons.imaging.formats.gif.GifImageParser 529 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 365 21 0 1
org.apache.commons.imaging.formats.tiff.TiffField 344 32 1 9
org.apache.commons.imaging.formats.psd.PsdImageParser 328 23 0 1
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 315 19 0 1
org.apache.commons.imaging.formats.png.PngWriter 310 18 2 0
org.apache.commons.imaging.formats.tiff.TiffImageMetadata 299 24 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 236 0 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 210 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 170 0 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.tiff.TiffField 344 32 1 9
org.apache.commons.imaging.formats.gif.GifImageParser 529 30 0 1
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.tiff.TiffImageMetadata 299 24 3 0
org.apache.commons.imaging.formats.psd.PsdImageParser 328 23 0 1
org.apache.commons.imaging.ImageInfo 117 22 2 19
org.apache.commons.imaging.formats.png.PngImageParser 365 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.tiff.TiffImageParser 315 19 0 1
org.apache.commons.imaging.formats.png.PngWriter 310 18 2 0
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression 520 17 0 5
org.apache.commons.imaging.formats.icns.IcnsImageParser 168 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
51.18 21,400.00 0.25 5.18 0.73

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) 146 45 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) 125 38 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.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.ico.IcoImageParser.readBitmapIconData(IconData[],IconInfo) 96 24 0
org.apache.commons.imaging.Imaging.guessFormat(ByteSource) 96 47 1
org.apache.commons.imaging.formats.tiff.TiffImageParser.getImageInfo(ByteSource,Object) 95 26 0
org.apache.commons.imaging.formats.pnm.PnmImageParser.readHeader(InputStream) 93 44 0
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.compressT4_2D(ioException[][],int,int,boolean,int) 87 22 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.png.PngImageParser.getImageInfo(ByteSource,Object) 76 22 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,400.00 8.14 3.26 0.11

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).