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.classpath 8 34 292 30 214 80 141
de.smartics.util.lang 10 51 275 55 445 120 217
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
de.smartics.util.annotations.marker 0 0 8 0 0 0 37
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
32 133 854 136 943 313 724

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.ProjectClassLoader 60 9 1 7
de.smartics.util.source.SourceCodeLocation.Position 57 9 1 8
de.smartics.util.lang.classpath.ClassPathDirectoryListing 57 8 0 5
de.smartics.util.lang.ClassPathDirectoryListing 57 8 0 5
de.smartics.util.lang.classpath.AbstractProjectClassLoader 52 5 0 6
de.smartics.util.lang.ClassPathContext 40 7 0 7
de.smartics.util.lang.classpath.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.io.MemoryStreamHandler 27 3 1 5
de.smartics.util.adapt.AdaptableException 27 5 0 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.classpath.ProjectClassLoader.Enumeration 9 2 0 0
de.smartics.util.lang.NullArgumentException 8 3 0 4
de.smartics.util.lang.BlankArgumentException 8 3 0 4
de.smartics.util.lang.BlankExceptNullArgumentException 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.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

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.classpath.ProjectClassLoader 60 9 1 7
de.smartics.util.lang.classpath.ClassPathDirectoryListing 57 8 0 5
de.smartics.util.lang.ClassPathDirectoryListing 57 8 0 5
de.smartics.util.lang.Arg 33 8 0 8
de.smartics.util.lang.Arguments 17 7 0 8
de.smartics.util.lang.ClassPathContext 40 7 0 7
de.smartics.util.lang.classpath.ClassPathContext 40 7 0 7
de.smartics.util.source.SourceCodeLocation 86 6 2 15
de.smartics.util.lang.ArgumentChecker 29 6 0 7
de.smartics.util.util.GenericServiceFactory 36 5 0 5
de.smartics.util.lang.StringFunction 35 5 0 6
de.smartics.util.lang.classpath.AbstractProjectClassLoader 52 5 0 6
de.smartics.util.adapt.AdaptableException 27 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.source.DefaultMethodInfo 13 3 0 4
de.smartics.util.lang.NullArgumentException 8 3 0 4
de.smartics.util.lang.BlankArgumentException 8 3 0 4
de.smartics.util.lang.BlankExceptNullArgumentException 8 3 0 4
de.smartics.util.io.StreamHandler 3 2 0 3
de.smartics.util.io.MemoryStreamHandler.CloseListenerOutputStream 11 2 0 0
de.smartics.util.source.MethodInfo 3 2 0 3
de.smartics.util.lang.classpath.ProjectClassLoader.Enumeration 9 2 0 0
de.smartics.util.adapt.Adaptable 3 2 0 2
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.StaticAnalysis 5 1 0 2
de.smartics.util.lang.classpath.ClassPathListingFactory 19 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
24.63 854.00 0.16 4.16 4.50

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.util.lang.classpath.AbstractProjectClassLoader.loadClassFromLibrary(String,String,File) 19 6 1
de.smartics.util.util.GenericServiceFactory.create(boolean) 17 7 1
de.smartics.util.lang.classpath.ClassPathListingFactory.create() 17 7 1
de.smartics.util.source.SourceCodeLocation.Position.compareTo(Position) 16 9 1
de.smartics.util.lang.classpath.ProjectClassLoader.findResource(String) 15 8 0
de.smartics.util.lang.StringFunction.toHyphenVersion(String) 14 7 1
de.smartics.util.lang.classpath.AbstractProjectClassLoader.loadClassFile(String,File) 13 4 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.ProjectClassLoader.findResources(String) 11 1 0
de.smartics.util.lang.classpath.ProjectClassLoader.findClass(String) 11 7 0
de.smartics.util.lang.ClassPathContext.getResource(String) 10 7 1
de.smartics.util.lang.classpath.ClassPathContext.getResource(String) 10 7 1
de.smartics.util.lang.classpath.ProjectClassLoader.initDirectories(Logger,String) 10 6 1
de.smartics.util.lang.classpath.ClassPathDirectoryListing.traverseJarEntries(String,String,JarFile) 10 5 0
de.smartics.util.lang.ClassPathDirectoryListing.traverseJarEntries(String,String,JarFile) 10 5 0
de.smartics.util.lang.classpath.AbstractProjectClassLoader.loadResourceFromLibrary(String,String,File) 9 4 1
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.source.SourceCodeLocation.Position.equals(Object) 8 7 1
de.smartics.util.lang.ClassPathContext.equals(Object) 8 6 1
de.smartics.util.lang.classpath.ClassPathContext.equals(Object) 8 6 1
de.smartics.util.lang.Arg.isBlank(T) 8 7 0
de.smartics.util.lang.ArgumentChecker.check() 8 4 1
de.smartics.util.source.SourceCodeLocation.checkArguments(Position,Position) 7 7 0
de.smartics.util.lang.classpath.AbstractProjectClassLoader.ensurePackageProvided(String) 7 3 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
854.00 4.83 2.62 0.80

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