JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis.
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
net.sf.jpkgmk.prototype 27 201 1553 104 679 137 19
net.sf.jpkgmk.util 13 95 871 53 321 181 38
net.sf.jpkgmk.pkgmap 15 101 847 53 334 35 13
net.sf.jpkgmk 16 100 767 57 328 72 27
net.sf.jpkgmk.ant 1 5 31 1 13 0 6
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
72 502 4069 268 1675 425 103

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
net.sf.jpkgmk.util.FileUtil 279 25 0 17
net.sf.jpkgmk.prototype.AbstractPrototypeEntry 194 30 0 10
net.sf.jpkgmk.util.StringUtil 194 18 3 12
net.sf.jpkgmk.pkgmap.AbstractPkgMapEntry 185 27 0 8
net.sf.jpkgmk.prototype.PrototypeBuilder 174 26 1 10
net.sf.jpkgmk.RequestCreator 173 5 6 2
net.sf.jpkgmk.pkgmap.PkgMap 171 20 2 11
net.sf.jpkgmk.PkgInfo 141 30 0 4
net.sf.jpkgmk.PkgMk 140 19 0 10
net.sf.jpkgmk.prototype.Prototype 106 16 1 7
net.sf.jpkgmk.prototype.CommandType 98 10 5 5
net.sf.jpkgmk.pkgmap.PkgMapEntryHeader 91 9 1 2
net.sf.jpkgmk.util.VariableMap 90 14 0 6
net.sf.jpkgmk.prototype.PrototypeEntryType 74 10 2 3
net.sf.jpkgmk.prototype.PrototypeEntryCommand 73 8 1 8
net.sf.jpkgmk.prototype.PrototypeEntryFile 67 9 1 6
net.sf.jpkgmk.prototype.PrototypeEntryCommandVariable 66 12 0 3
net.sf.jpkgmk.pkgmap.PkgMapEntryComment 60 9 1 6
net.sf.jpkgmk.prototype.PrototypeEntryCommandSearch 54 7 0 2
net.sf.jpkgmk.prototype.AbstractPrototypeEntryDevice 48 4 1 2
net.sf.jpkgmk.pkgmap.PkgMapEntryType 45 7 1 2
net.sf.jpkgmk.prototype.PrototypeEntryCommandDefault 45 8 0 1
net.sf.jpkgmk.DefaultFileHandler 43 8 0 4
net.sf.jpkgmk.util.UnixChecksum 42 7 0 1
net.sf.jpkgmk.prototype.PrototypeEntryComment 41 8 1 4
net.sf.jpkgmk.pkgmap.PkgMapEntryFile 40 2 2 2
net.sf.jpkgmk.AbstractParser 37 7 0 5
net.sf.jpkgmk.prototype.AbstractPrototypeEntryParser 36 7 0 5
net.sf.jpkgmk.PkgInfoParser 35 3 0 1
net.sf.jpkgmk.util.ChecksumUtil 35 7 0 5

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
net.sf.jpkgmk.PkgInfo 141 30 0 4
net.sf.jpkgmk.prototype.AbstractPrototypeEntry 194 30 0 10
net.sf.jpkgmk.pkgmap.AbstractPkgMapEntry 185 27 0 8
net.sf.jpkgmk.prototype.PrototypeBuilder 174 26 1 10
net.sf.jpkgmk.util.FileUtil 279 25 0 17
net.sf.jpkgmk.pkgmap.PkgMap 171 20 2 11
net.sf.jpkgmk.PkgMk 140 19 0 10
net.sf.jpkgmk.util.StringUtil 194 18 3 12
net.sf.jpkgmk.prototype.Prototype 106 16 1 7
net.sf.jpkgmk.util.VariableMap 90 14 0 6
net.sf.jpkgmk.prototype.PrototypeEntryCommandVariable 66 12 0 3
net.sf.jpkgmk.prototype.CommandType 98 10 5 5
net.sf.jpkgmk.prototype.PrototypeEntryType 74 10 2 3
net.sf.jpkgmk.pkgmap.PkgMapEntryComment 60 9 1 6
net.sf.jpkgmk.pkgmap.PkgMapEntryHeader 91 9 1 2
net.sf.jpkgmk.prototype.PrototypeEntryFile 67 9 1 6
net.sf.jpkgmk.DefaultFileHandler 43 8 0 4
net.sf.jpkgmk.prototype.PrototypeEntryCommand 73 8 1 8
net.sf.jpkgmk.prototype.PrototypeEntryCommandDefault 45 8 0 1
net.sf.jpkgmk.prototype.PrototypeEntryComment 41 8 1 4
net.sf.jpkgmk.AbstractParser 37 7 0 5
net.sf.jpkgmk.pkgmap.PkgMapEntryType 45 7 1 2
net.sf.jpkgmk.prototype.AbstractPrototypeEntryParser 36 7 0 5
net.sf.jpkgmk.prototype.PrototypeEntryCommandSearch 54 7 0 2
net.sf.jpkgmk.util.ChecksumUtil 35 7 0 5
net.sf.jpkgmk.util.FsTestCase 34 7 0 2
net.sf.jpkgmk.util.UnixChecksum 42 7 0 1
net.sf.jpkgmk.pkgmap.AbstractPkgMapEntryParser 34 6 0 5
net.sf.jpkgmk.prototype.PrototypeEntryCommandInclude 32 6 0 2
net.sf.jpkgmk.prototype.PrototypeEntryDirectory 31 6 1 3

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
49.29 4,069.00 0.61 6.97 3.72

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
net.sf.jpkgmk.util.FileUtil.createTar(File,File) 43 17 1
net.sf.jpkgmk.pkgmap.AbstractPkgMapEntry.equals(Object,boolean) 38 36 0
net.sf.jpkgmk.prototype.PrototypeBuilder.addDirectoryInternal(File,String,String,String,PermissionProvider,FileFilter,boolean) 31 10 0
net.sf.jpkgmk.PkgInfoParser.parseAndAddLine(String,PkgInfo) 30 9 0
net.sf.jpkgmk.pkgmap.AbstractPkgMapEntry.AbstractPkgMapEntry(Integer,PkgMapEntryType,String,String,String,Integer,Integer,String,String,String) 29 17 1
net.sf.jpkgmk.prototype.AbstractPrototypeEntry.createPkgMapEntry(File,VariableResolver) 28 7 1
net.sf.jpkgmk.PkgMk.PkgMk(File,File,String,PkgInfo,Prototype) 27 9 1
net.sf.jpkgmk.RequestCreator.RequestEntryParser.parseLine(String) 27 13 0
net.sf.jpkgmk.pkgmap.AbstractPkgMapEntry.createLine() 25 10 1
net.sf.jpkgmk.prototype.AbstractPrototypeEntry.AbstractPrototypeEntry(Integer,PrototypeEntryType,String,String,String,Integer,Integer,String,String,String,PrototypeEntryCommandDefault) 24 12 1
net.sf.jpkgmk.prototype.PrototypeEntryCommand.PrototypeEntryCommandParser.parse(String,PrototypeEntryCommandDefault) 24 8 0
net.sf.jpkgmk.util.FileUtil.createGzip(File) 24 5 1
net.sf.jpkgmk.util.FileUtil.copyFiles(File,File,FileFilter) 24 12 1
net.sf.jpkgmk.prototype.AbstractPrototypeEntry.createLine() 23 10 1
net.sf.jpkgmk.pkgmap.PkgMapEntryHeader.PkgMapEntryHeaderParser.parse(String) 22 9 0
net.sf.jpkgmk.prototype.PrototypeEntryCommandVariable.equals(Object) 21 17 0
net.sf.jpkgmk.util.StringUtil.truncateUtf8String(String,int,TruncationMode) 21 16 1
net.sf.jpkgmk.prototype.PrototypeBuilder.addFileInternal(File,String,String,String,PermissionProvider,PrototypeEntryType) 20 6 0
net.sf.jpkgmk.PkgInfo.createPkgInfo() 19 7 0
net.sf.jpkgmk.pkgmap.PkgMapEntryDevice.validate() 19 19 0
net.sf.jpkgmk.prototype.AbstractPrototypeEntryDevice.AbstractPrototypeEntryDeviceParser.parseItems(String[],Integer,PrototypeEntryType,int,PrototypeEntryCommandDefault) 19 7 0
net.sf.jpkgmk.pkgmap.AbstractPkgMapEntry.hashCode() 17 14 0
net.sf.jpkgmk.pkgmap.PkgMap.equals(Object,boolean) 17 14 1
net.sf.jpkgmk.pkgmap.PkgMapEntryComment.equals(Object) 17 14 0
net.sf.jpkgmk.pkgmap.PkgMapEntryHeader.equals(Object) 17 15 0
net.sf.jpkgmk.RequestCreator.create() 17 2 0
net.sf.jpkgmk.util.FileUtil.deleteRecursively(File) 17 7 0
net.sf.jpkgmk.util.FileUtil.copyFile(File,File) 17 6 1
net.sf.jpkgmk.AbstractParser.parse(Reader) 16 7 1
net.sf.jpkgmk.util.FileUtil.createDir(File,boolean) 16 7 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
4,069.00 5.43 2.58 0.33

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