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 151 1987 12 82 163 206
org.apache.commons.imaging.formats.tiff.write 9 122 1282 3 31 88 163
org.apache.commons.imaging.common 15 146 1175 16 87 35 282
org.apache.commons.imaging.formats.tiff.constants 22 26 1145 17 91 38 408
org.apache.commons.imaging.formats.png 16 88 1136 3 12 120 428
org.apache.commons.imaging 13 200 977 135 1666 54 312
org.apache.commons.imaging.formats.bmp 11 54 892 1 10 125 195
org.apache.commons.imaging.palette 15 59 892 11 66 19 259
org.apache.commons.imaging.color 10 77 822 0 0 75 595
org.apache.commons.imaging.formats.jpeg 5 46 813 4 32 297 99
org.apache.commons.imaging.formats.pnm 13 84 758 1 10 52 227
org.apache.commons.imaging.common.itu_t4 6 38 662 8 67 18 115
org.apache.commons.imaging.formats.gif 7 38 655 1 10 88 131
org.apache.commons.imaging.formats.pcx 5 28 600 1 10 68 91
org.apache.commons.imaging.formats.jpeg.decoder 6 29 595 2 11 58 164
org.apache.commons.imaging.formats.tiff.taginfos 37 110 551 5 22 26 613
org.apache.commons.imaging.formats.jpeg.segments 13 54 516 11 50 59 228
org.apache.commons.imaging.formats.xpm 1 25 477 1 10 4 33
org.apache.commons.imaging.formats.ico 1 19 447 1 10 147 35
org.apache.commons.imaging.formats.psd 5 35 437 2 15 127 99
org.apache.commons.imaging.formats.tiff.datareaders 4 21 437 3 20 88 88
org.apache.commons.imaging.formats.jpeg.iptc 9 40 415 14 156 75 207
org.apache.commons.imaging.formats.icns 4 40 402 1 10 34 84
org.apache.commons.imaging.common.mylzw 5 47 380 0 0 12 99
org.apache.commons.imaging.icc 9 49 363 0 0 204 163
org.apache.commons.imaging.formats.png.chunks 12 33 318 6 18 17 220
org.apache.commons.imaging.formats.tiff.fieldtypes 8 28 290 1 3 7 147
org.apache.commons.imaging.formats.xbm 1 18 257 1 10 6 33
org.apache.commons.imaging.formats.jpeg.xmp 3 23 245 11 97 21 67
org.apache.commons.imaging.common.bytesource 4 30 232 1 4 9 83
org.apache.commons.imaging.formats.tiff.photometricinterpreters 8 20 201 1 17 27 152
org.apache.commons.imaging.internal 1 26 198 1 6 4 35
org.apache.commons.imaging.formats.jpeg.exif 1 17 189 15 205 20 35
org.apache.commons.imaging.formats.rgbe 3 23 170 1 5 8 67
org.apache.commons.imaging.formats.wbmp 1 17 143 1 10 5 33
org.apache.commons.imaging.formats.dcx 1 15 124 1 10 9 35
org.apache.commons.imaging.formats.psd.dataparsers 8 18 105 0 0 2 147
org.apache.commons.imaging.formats.png.scanlinefilters 6 10 87 0 0 23 115
org.apache.commons.imaging.formats.psd.datareaders 3 5 80 0 0 6 67
org.apache.commons.imaging.formats.png.transparencyfilters 4 10 61 2 6 3 83
org.apache.commons.imaging.formats.tga 0 0 3 0 0 247 35
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
316 1919 21520 295 2869 2488 6697

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 508 30 0 1
org.apache.commons.imaging.formats.jpeg.JpegImageParser 476 26 5 1
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression 470 18 0 5
org.apache.commons.imaging.color.ColorConversions 457 41 0 0
org.apache.commons.imaging.formats.xpm.XpmImageParser 438 25 3 1
org.apache.commons.imaging.formats.tiff.TiffDirectory 425 47 1 0
org.apache.commons.imaging.formats.ico.IcoImageParser 412 19 7 1
org.apache.commons.imaging.formats.bmp.BmpImageParser 407 20 0 1
org.apache.commons.imaging.formats.png.PngImageParser 364 21 0 1
org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory 336 54 2 2
org.apache.commons.imaging.formats.tiff.TiffImageParser 322 19 0 1
org.apache.commons.imaging.formats.tiff.write.TiffImageWriterBase 322 10 0 0
org.apache.commons.imaging.formats.tiff.TiffField 309 29 1 9
org.apache.commons.imaging.formats.png.PngWriter 302 17 2 0
org.apache.commons.imaging.formats.tiff.TiffImageMetadata 289 23 3 0
org.apache.commons.imaging.formats.psd.PsdImageParser 289 23 0 1
org.apache.commons.imaging.Imaging 288 70 0 59
org.apache.commons.imaging.common.BasicCParser 284 5 0 1
org.apache.commons.imaging.palette.PaletteFactory 274 15 1 5
org.apache.commons.imaging.formats.pcx.PcxImageParser 248 18 1 1
org.apache.commons.imaging.formats.jpeg.decoder.JpegDecoder 245 11 0 0
org.apache.commons.imaging.formats.tiff.constants.ExifTagConstants 243 1 0 1
org.apache.commons.imaging.common.ByteConversions 242 45 0 1
org.apache.commons.imaging.formats.jpeg.decoder.Dct 233 9 0 2
org.apache.commons.imaging.formats.pcx.PcxWriter 227 4 0 0
org.apache.commons.imaging.formats.xbm.XbmImageParser 224 18 2 1
org.apache.commons.imaging.formats.tiff.TiffReader 216 13 3 0
org.apache.commons.imaging.formats.pnm.PnmImageParser 215 15 0 1
org.apache.commons.imaging.internal.Debug 184 26 0 1
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 288 70 0 59
org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory 336 54 2 2
org.apache.commons.imaging.formats.tiff.TiffDirectory 425 47 1 0
org.apache.commons.imaging.ImageParser 134 45 0 46
org.apache.commons.imaging.common.ByteConversions 242 45 0 1
org.apache.commons.imaging.color.ColorConversions 457 41 0 0
org.apache.commons.imaging.formats.gif.GifImageParser 508 30 0 1
org.apache.commons.imaging.formats.tiff.TiffField 309 29 1 9
org.apache.commons.imaging.common.BinaryFunctions 154 27 0 1
org.apache.commons.imaging.formats.jpeg.JpegImageParser 476 26 5 1
org.apache.commons.imaging.internal.Debug 184 26 0 1
org.apache.commons.imaging.formats.tiff.write.TiffOutputSet 139 25 0 1
org.apache.commons.imaging.formats.xpm.XpmImageParser 438 25 3 1
org.apache.commons.imaging.formats.tiff.TiffImageMetadata 289 23 3 0
org.apache.commons.imaging.formats.psd.PsdImageParser 289 23 0 1
org.apache.commons.imaging.ImageInfo 118 22 2 19
org.apache.commons.imaging.formats.png.PngImageParser 364 21 0 1
org.apache.commons.imaging.formats.bmp.BmpImageParser 407 20 0 1
org.apache.commons.imaging.formats.tiff.TiffImageParser 322 19 0 1
org.apache.commons.imaging.formats.ico.IcoImageParser 412 19 7 1
org.apache.commons.imaging.formats.xbm.XbmImageParser 224 18 2 1
org.apache.commons.imaging.formats.pcx.PcxImageParser 248 18 1 1
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression 470 18 0 5
org.apache.commons.imaging.formats.png.PngWriter 302 17 2 0
org.apache.commons.imaging.formats.icns.IcnsImageParser 156 17 3 1
org.apache.commons.imaging.formats.wbmp.WbmpImageParser 115 17 1 1
org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter 162 17 7 15
org.apache.commons.imaging.PixelDensity 62 17 0 1
org.apache.commons.imaging.common.mylzw.MyLzwCompressor 137 16 2 0
org.apache.commons.imaging.formats.pnm.PnmImageParser 215 15 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
60.27 21,520.00 0.31 6.07 0.93

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) 215 99 0
org.apache.commons.imaging.formats.png.PngWriter.writeImage(BufferedImage,OutputStream,Object) 144 41 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) 123 35 0
org.apache.commons.imaging.formats.tiff.TiffField.getValueDescription(Object) 117 49 0
org.apache.commons.imaging.formats.gif.GifImageParser.writeImage(BufferedImage,OutputStream,Object) 117 35 0
org.apache.commons.imaging.formats.bmp.BmpImageParser.readBmpHeaderInfo(InputStream,FormatCompliance) 116 15 0
org.apache.commons.imaging.formats.pnm.PnmImageParser.readHeader(InputStream) 109 58 0
org.apache.commons.imaging.formats.tiff.TiffImageParser.getImageInfo(ByteSource,Object) 100 27 0
org.apache.commons.imaging.formats.pcx.PcxWriter.writeImage(BufferedImage,OutputStream) 99 32 0
org.apache.commons.imaging.formats.tiff.write.TiffImageWriterBase.validateDirectories(TiffOutputSet) 99 51 0
org.apache.commons.imaging.formats.bmp.BmpImageParser.readImageContents(InputStream,FormatCompliance) 98 33 0
org.apache.commons.imaging.formats.png.PngImageParser.getBufferedImage(ByteSource,Object) 96 38 0
org.apache.commons.imaging.formats.pcx.PcxImageParser.readImage(PcxHeader,InputStream,ByteSource) 95 46 0
org.apache.commons.imaging.formats.ico.IcoImageParser.readBitmapIconData(IconData[],IconInfo) 90 24 0
org.apache.commons.imaging.formats.png.PngImageParser.getImageInfo(ByteSource,Object) 88 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.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.formats.tiff.TiffReader.readDirectory(ByteSource,long,int,FormatCompliance,Listener,boolean,Number) 73 33 0
org.apache.commons.imaging.Imaging.guessFormat(ByteSource) 72 46 1
org.apache.commons.imaging.formats.jpeg.decoder.Dct.inverseDCT8x8(a7[]) 71 3 0
org.apache.commons.imaging.formats.xbm.XbmImageParser.readXbmImage(XbmHeader,BasicCParser) 70 41 0
org.apache.commons.imaging.formats.pcx.PcxWriter.writePixels(BufferedImage,int,int,int,SimplePalette,BinaryOutputStream) 70 29 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) 64 19 0
org.apache.commons.imaging.formats.icns.IcnsDecoder.decodeAllImages(IcnsImageParser.IcnsElement[]) 62 25 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
21,520.00 7.77 3.18 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).