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
de.smartics.util.lang 10 51 275 55 445 120 217
de.smartics.util.lang.classpath 5 18 157 17 125 55 105
de.smartics.util.source 6 22 109 22 125 42 113
de.smartics.util.io 5 14 93 17 77 41 90
de.smartics.util.util 1 5 44 5 39 11 52
de.smartics.util.adapt 2 7 33 7 43 19 74
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
29 117 711 123 854 288 651

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.util.source.SourceCodeLocation 86 6 2 15
de.smartics.util.lang.classpath.ClassPathDirectoryListing 57 8 0 5
de.smartics.util.lang.ClassPathDirectoryListing 57 8 0 5
de.smartics.util.source.SourceCodeLocation.Position 57 9 1 8
de.smartics.util.lang.classpath.ClassPathContext 40 7 0 7
de.smartics.util.lang.ClassPathContext 40 7 0 7
de.smartics.util.util.GenericServiceFactory 36 5 0 5
de.smartics.util.lang.StringFunction 35 5 0 6
de.smartics.util.lang.Arg 33 8 0 8
de.smartics.util.lang.ArgumentChecker 29 6 0 7
de.smartics.util.adapt.AdaptableException 27 5 0 5
de.smartics.util.io.MemoryStreamHandler 27 3 1 5
de.smartics.util.lang.classpath.ClassPathListingFactory 19 1 0 2
de.smartics.util.lang.Arguments 17 7 0 8
de.smartics.util.io.FileFunction 16 4 0 5
de.smartics.util.io.DirectoryStreamHandler 15 3 0 4
de.smartics.util.source.DefaultMethodInfo 13 3 0 4
de.smartics.util.io.MemoryStreamHandler.CloseListenerOutputStream 11 2 0 0
de.smartics.util.lang.BlankArgumentException 8 3 0 4
de.smartics.util.lang.BlankExceptNullArgumentException 8 3 0 4
de.smartics.util.lang.NullArgumentException 8 3 0 4
de.smartics.util.lang.classpath.JarAndFileClassPathListing 6 1 0 1
de.smartics.util.lang.StaticAnalysis 5 1 0 2
de.smartics.util.adapt.Adaptable 3 2 0 2
de.smartics.util.io.StreamHandler 3 2 0 3
de.smartics.util.source.MethodInfo 3 2 0 3
de.smartics.util.source.SourceCodeLocation.Position.Position 3 1 0 0
de.smartics.util.source.SourceCodeLocation.SourceCodeLocation 3 1 0 0
de.smartics.util.lang.classpath.ClassPathListing 2 1 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.util.source.SourceCodeLocation.Position 57 9 1 8
de.smartics.util.lang.Arg 33 8 0 8
de.smartics.util.lang.classpath.ClassPathDirectoryListing 57 8 0 5
de.smartics.util.lang.ClassPathDirectoryListing 57 8 0 5
de.smartics.util.lang.Arguments 17 7 0 8
de.smartics.util.lang.classpath.ClassPathContext 40 7 0 7
de.smartics.util.lang.ClassPathContext 40 7 0 7
de.smartics.util.lang.ArgumentChecker 29 6 0 7
de.smartics.util.source.SourceCodeLocation 86 6 2 15
de.smartics.util.adapt.AdaptableException 27 5 0 5
de.smartics.util.lang.StringFunction 35 5 0 6
de.smartics.util.util.GenericServiceFactory 36 5 0 5
de.smartics.util.io.FileFunction 16 4 0 5
de.smartics.util.io.DirectoryStreamHandler 15 3 0 4
de.smartics.util.io.MemoryStreamHandler 27 3 1 5
de.smartics.util.lang.BlankArgumentException 8 3 0 4
de.smartics.util.lang.BlankExceptNullArgumentException 8 3 0 4
de.smartics.util.lang.NullArgumentException 8 3 0 4
de.smartics.util.source.DefaultMethodInfo 13 3 0 4
de.smartics.util.adapt.Adaptable 3 2 0 2
de.smartics.util.io.MemoryStreamHandler.CloseListenerOutputStream 11 2 0 0
de.smartics.util.io.StreamHandler 3 2 0 3
de.smartics.util.source.MethodInfo 3 2 0 3
de.smartics.util.lang.classpath.ClassPathListing 2 1 0 2
de.smartics.util.lang.classpath.ClassPathListingFactory 19 1 0 2
de.smartics.util.lang.classpath.JarAndFileClassPathListing 6 1 0 1
de.smartics.util.lang.StaticAnalysis 5 1 0 2
de.smartics.util.source.SourceCodeLocation.Position.Position 3 1 0 0
de.smartics.util.source.SourceCodeLocation.SourceCodeLocation 3 1 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
23.00 711.00 0.14 4.03 4.52

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.util.lang.classpath.ClassPathListingFactory.create() 17 7 1
de.smartics.util.util.GenericServiceFactory.create(boolean) 17 7 1
de.smartics.util.source.SourceCodeLocation.Position.compareTo(Position) 16 9 1
de.smartics.util.lang.StringFunction.toHyphenVersion(String) 14 7 1
de.smartics.util.adapt.AdaptableException.createMessage(Class,Class) 13 3 0
de.smartics.util.lang.classpath.ClassPathDirectoryListing.list(String) 12 8 1
de.smartics.util.lang.classpath.ClassPathDirectoryListing.normalize(String) 12 7 0
de.smartics.util.lang.ClassPathDirectoryListing.list(String) 12 8 1
de.smartics.util.lang.ClassPathDirectoryListing.normalize(String) 12 7 0
de.smartics.util.lang.StringFunction.chop(StringBuilder) 11 8 1
de.smartics.util.lang.classpath.ClassPathContext.getResource(String) 10 7 1
de.smartics.util.lang.classpath.ClassPathDirectoryListing.traverseJarEntries(String,String,JarFile) 10 5 0
de.smartics.util.lang.ClassPathContext.getResource(String) 10 7 1
de.smartics.util.lang.ClassPathDirectoryListing.traverseJarEntries(String,String,JarFile) 10 5 0
de.smartics.util.lang.classpath.ClassPathDirectoryListing.handleJar(String,URL) 9 4 0
de.smartics.util.lang.ClassPathDirectoryListing.handleJar(String,URL) 9 4 0
de.smartics.util.lang.Arg.isBlank(T) 8 7 0
de.smartics.util.lang.ArgumentChecker.check() 8 4 1
de.smartics.util.lang.classpath.ClassPathContext.equals(Object) 8 6 1
de.smartics.util.lang.ClassPathContext.equals(Object) 8 6 1
de.smartics.util.source.SourceCodeLocation.Position.equals(Object) 8 7 1
de.smartics.util.source.SourceCodeLocation.checkArguments(Position,Position) 7 7 0
de.smartics.util.io.MemoryStreamHandler.openToRead(String) 6 3 1
de.smartics.util.lang.Arg.checkNotBlank(String,T,String) 6 5 1
de.smartics.util.lang.classpath.ClassPathContext.getResourceAsStream(String) 6 4 1
de.smartics.util.lang.ClassPathContext.getResourceAsStream(String) 6 4 1
de.smartics.util.lang.StringFunction.isLastChar(String,char) 6 3 1
de.smartics.util.util.GenericServiceFactory.handleDuplicateInstances(boolean,StringBuilder) 6 3 0
de.smartics.util.io.DirectoryStreamHandler.openToRead(String) 5 1 1
de.smartics.util.io.DirectoryStreamHandler.openToWrite(String) 5 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
711.00 4.50 2.54 0.82

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