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 1990 12 82 163 206
org.apache.commons.imaging.formats.tiff.write 9 122 1264 3 31 88 144
org.apache.commons.imaging.common 15 148 1172 16 87 35 282
org.apache.commons.imaging.formats.png 16 90 1151 3 12 123 428
org.apache.commons.imaging.formats.tiff.constants 22 26 1144 17 91 38 389
org.apache.commons.imaging 13 200 964 135 1666 55 317
org.apache.commons.imaging.formats.bmp 11 54 892 1 10 125 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 810 4 32 299 99
org.apache.commons.imaging.formats.pnm 13 84 752 1 10 51 227
org.apache.commons.imaging.common.itu_t4 6 37 689 8 67 18 115
org.apache.commons.imaging.formats.gif 7 38 658 1 10 88 131
org.apache.commons.imaging.formats.jpeg.decoder 6 29 593 2 11 58 145
org.apache.commons.imaging.formats.pcx 5 28 590 1 10 68 91
org.apache.commons.imaging.formats.tiff.taginfos 37 110 559 5 22 28 594
org.apache.commons.imaging.formats.jpeg.segments 13 54 508 11 50 60 209
org.apache.commons.imaging.formats.xpm 1 25 476 1 10 4 33
org.apache.commons.imaging.formats.ico 1 19 457 1 10 147 35
org.apache.commons.imaging.formats.tiff.datareaders 4 21 436 3 20 88 69
org.apache.commons.imaging.formats.psd 5 35 427 2 15 127 99
org.apache.commons.imaging.formats.jpeg.iptc 9 40 416 14 156 75 188
org.apache.commons.imaging.formats.icns 4 40 412 1 10 34 84
org.apache.commons.imaging.common.mylzw 5 47 380 0 0 15 99
org.apache.commons.imaging.icc 9 49 360 0 0 204 163
org.apache.commons.imaging.formats.png.chunks 12 33 301 6 18 17 201
org.apache.commons.imaging.formats.tiff.fieldtypes 8 28 300 1 3 9 128
org.apache.commons.imaging.formats.jpeg.xmp 3 23 245 11 97 22 48
org.apache.commons.imaging.formats.xbm 1 17 245 1 10 6 33
org.apache.commons.imaging.common.bytesource 4 30 232 1 4 9 83
org.apache.commons.imaging.formats.tiff.photometricinterpreters 8 20 200 1 17 27 132
org.apache.commons.imaging.util 1 26 196 0 0 4 35
org.apache.commons.imaging.formats.jpeg.exif 1 17 187 15 205 21 16
org.apache.commons.imaging.formats.rgbe 3 23 168 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 104 0 0 2 128
org.apache.commons.imaging.formats.png.scanlinefilters 6 10 86 0 0 23 96
org.apache.commons.imaging.formats.psd.datareaders 3 5 81 0 0 6 48
org.apache.commons.imaging.formats.png.transparencyfilters 4 10 60 2 6 3 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
316 1922 21488 294 2863 2504 6378

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 512 30 0 1
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression 497 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 438 25 3 1
org.apache.commons.imaging.formats.tiff.TiffDirectory 429 47 1 0
org.apache.commons.imaging.formats.ico.IcoImageParser 422 19 7 1
org.apache.commons.imaging.formats.bmp.BmpImageParser 416 20 0 1
org.apache.commons.imaging.formats.png.PngImageParser 366 21 0 1
org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory 336 54 2 2
org.apache.commons.imaging.formats.tiff.TiffImageParser 325 19 0 1
org.apache.commons.imaging.formats.tiff.write.TiffImageWriterBase 322 10 0 0
org.apache.commons.imaging.formats.png.PngWriter 316 19 2 0
org.apache.commons.imaging.formats.tiff.TiffField 307 29 1 9
org.apache.commons.imaging.formats.psd.PsdImageParser 291 23 0 1
org.apache.commons.imaging.formats.tiff.TiffImageMetadata 289 23 3 0
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.tiff.TiffReader 218 13 3 0
org.apache.commons.imaging.formats.pcx.PcxWriter 217 4 0 0
org.apache.commons.imaging.formats.pnm.PnmImageParser 213 15 0 1
org.apache.commons.imaging.formats.xbm.XbmImageParser 213 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 288 70 0 59
org.apache.commons.imaging.formats.tiff.write.TiffOutputDirectory 336 54 2 2
org.apache.commons.imaging.formats.tiff.TiffDirectory 429 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.color.ColorConversions 457 41 0 0
org.apache.commons.imaging.formats.gif.GifImageParser 512 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 438 25 3 1
org.apache.commons.imaging.formats.psd.PsdImageParser 291 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 366 21 0 1
org.apache.commons.imaging.formats.bmp.BmpImageParser 416 20 0 1
org.apache.commons.imaging.formats.ico.IcoImageParser 422 19 7 1
org.apache.commons.imaging.formats.png.PngWriter 316 19 2 0
org.apache.commons.imaging.formats.tiff.TiffImageParser 325 19 0 1
org.apache.commons.imaging.formats.pcx.PcxImageParser 248 18 1 1
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression 497 17 0 5
org.apache.commons.imaging.formats.icns.IcnsImageParser 160 17 3 1
org.apache.commons.imaging.formats.jpeg.exif.ExifRewriter 161 17 7 15
org.apache.commons.imaging.formats.wbmp.WbmpImageParser 115 17 1 1
org.apache.commons.imaging.formats.xbm.XbmImageParser 213 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
60.51 21,488.00 0.31 6.08 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) 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.TiffImageParser.getImageInfo(ByteSource,Object) 100 27 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.pcx.PcxImageParser.readImage(PcxHeader,InputStream,ByteSource) 95 46 0
org.apache.commons.imaging.formats.pcx.PcxWriter.writeImage(BufferedImage,OutputStream) 95 31 0
org.apache.commons.imaging.formats.ico.IcoImageParser.readBitmapIconData(IconData[],IconInfo) 90 24 0
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.compressT4_2D(ret[][],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.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.common.itu_t4.T4AndT6Compression.compressT6(outputStream.toByteArray[][],int,int) 70 19 0
org.apache.commons.imaging.common.itu_t4.T4AndT6Compression.decompressT6(ioException[][],int,int) 70 19 1
org.apache.commons.imaging.formats.xbm.XbmImageParser.readXbmImage(XbmHeader,BasicCParser) 70 41 0
org.apache.commons.imaging.formats.jpeg.decoder.Dct.forwardDCT8x8(a43[]) 69 3 0
org.apache.commons.imaging.icc.IccProfileParser.readICCProfileInfo(InputStream) 66 20 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
21,488.00 7.80 3.21 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).