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.exceptions 5 43 183 40 342 66 153
de.smartics.exceptions.context 5 24 127 18 123 63 176
de.smartics.exceptions.code 7 24 111 24 141 74 192
de.smartics.exceptions.runtime 3 14 93 14 88 39 87
de.smartics.exceptions.id 5 18 92 19 104 55 124
de.smartics.exceptions.core 7 16 48 20 136 47 162
de.smartics.exceptions.app 1 1 6 2 6 11 45
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
33 140 660 137 940 355 939

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.exceptions.runtime.AbstractExceptionContextManager 50 7 0 8
de.smartics.exceptions.Helper 48 6 0 7
de.smartics.exceptions.context.AbstractExceptionContext 42 10 0 9
de.smartics.exceptions.code.NumberCodeInfo 35 9 0 6
de.smartics.exceptions.AbstractCoreException 32 11 0 7
de.smartics.exceptions.AbstractCoreRuntimeException 32 11 0 9
de.smartics.exceptions.ExceptionInfo 27 6 0 7
de.smartics.exceptions.id.IncrementFactory 24 3 0 3
de.smartics.exceptions.id.UuidExceptionId 21 6 0 7
de.smartics.exceptions.code.TwoNumberCodeInfo 20 5 0 4
de.smartics.exceptions.id.LongExceptionId 19 5 0 5
de.smartics.exceptions.runtime.ExceptionContextManager 18 5 0 4
de.smartics.exceptions.context.ExceptionContextProperty 17 8 0 0
de.smartics.exceptions.core.DefaultCodeMessageFormatter 17 4 0 3
de.smartics.exceptions.context.PropertiesConfiguredExceptionContext 14 2 0 3
de.smartics.exceptions.context.SystemDefaultExceptionContext 11 3 0 4
de.smartics.exceptions.CoreException 10 9 0 10
de.smartics.exceptions.runtime.FallbackClassLoader 10 2 0 2
de.smartics.exceptions.code.NumberCodeComparator 9 2 0 3
de.smartics.exceptions.code.RunningZerosNumberCodeInfo 9 2 0 2
de.smartics.exceptions.id.SignedIncrementFactory 9 3 0 3
de.smartics.exceptions.code.DefaultCodeComparator 8 2 0 3
de.smartics.exceptions.code.NumberCodeOnlyComparator 8 2 0 3
de.smartics.exceptions.core.Code 5 4 0 5
de.smartics.exceptions.app.Constant 4 1 0 2
de.smartics.exceptions.context.ConfiguredExceptionContext 4 1 0 2
de.smartics.exceptions.core.ExceptionContext 4 3 0 4
de.smartics.exceptions.code.NumberCode 3 2 0 3
de.smartics.exceptions.core.CodeMessageFormatter 3 2 0 3
de.smartics.exceptions.core.ExceptionId 3 2 0 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.exceptions.AbstractCoreException 32 11 0 7
de.smartics.exceptions.AbstractCoreRuntimeException 32 11 0 9
de.smartics.exceptions.context.AbstractExceptionContext 42 10 0 9
de.smartics.exceptions.code.NumberCodeInfo 35 9 0 6
de.smartics.exceptions.CoreException 10 9 0 10
de.smartics.exceptions.context.ExceptionContextProperty 17 8 0 0
de.smartics.exceptions.runtime.AbstractExceptionContextManager 50 7 0 8
de.smartics.exceptions.ExceptionInfo 27 6 0 7
de.smartics.exceptions.Helper 48 6 0 7
de.smartics.exceptions.id.UuidExceptionId 21 6 0 7
de.smartics.exceptions.code.TwoNumberCodeInfo 20 5 0 4
de.smartics.exceptions.id.LongExceptionId 19 5 0 5
de.smartics.exceptions.runtime.ExceptionContextManager 18 5 0 4
de.smartics.exceptions.core.Code 5 4 0 5
de.smartics.exceptions.core.DefaultCodeMessageFormatter 17 4 0 3
de.smartics.exceptions.context.SystemDefaultExceptionContext 11 3 0 4
de.smartics.exceptions.core.ExceptionContext 4 3 0 4
de.smartics.exceptions.id.IncrementFactory 24 3 0 3
de.smartics.exceptions.id.SignedIncrementFactory 9 3 0 3
de.smartics.exceptions.code.DefaultCodeComparator 8 2 0 3
de.smartics.exceptions.code.NumberCode 3 2 0 3
de.smartics.exceptions.code.NumberCodeComparator 9 2 0 3
de.smartics.exceptions.code.NumberCodeOnlyComparator 8 2 0 3
de.smartics.exceptions.code.RunningZerosNumberCodeInfo 9 2 0 2
de.smartics.exceptions.context.PropertiesConfiguredExceptionContext 14 2 0 3
de.smartics.exceptions.core.CodeMessageFormatter 3 2 0 3
de.smartics.exceptions.core.ExceptionId 3 2 0 3
de.smartics.exceptions.runtime.FallbackClassLoader 10 2 0 2
de.smartics.exceptions.app.Constant 4 1 0 2
de.smartics.exceptions.context.ConfiguredExceptionContext 4 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
15.82 660.00 0.00 4.24 4.15

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.exceptions.Helper.truncateCause(Throwable,ExceptionInfo) 16 8 1
de.smartics.exceptions.runtime.AbstractExceptionContextManager.fetchContext(ClassLoader) 16 7 1
de.smartics.exceptions.id.IncrementFactory.createId() 15 5 0
de.smartics.exceptions.runtime.AbstractExceptionContextManager.provideContext(ClassLoader,ClassLoader) 13 6 1
de.smartics.exceptions.Helper.truncateExternalExceptions(Throwable) 12 5 1
de.smartics.exceptions.context.PropertiesConfiguredExceptionContext.createConfiguration() 10 4 1
de.smartics.exceptions.core.DefaultCodeMessageFormatter.format(CoreException,Object) 10 2 0
de.smartics.exceptions.Helper.determineParentId(Throwable) 8 4 1
de.smartics.exceptions.id.LongExceptionId.equals(Object) 8 6 1
de.smartics.exceptions.id.UuidExceptionId.equals(Object) 8 6 1
de.smartics.exceptions.code.NumberCodeInfo.getDisplayId() 7 2 0
de.smartics.exceptions.context.AbstractExceptionContext.createConfiguration(InputStream) 7 4 1
de.smartics.exceptions.context.AbstractExceptionContext.createConfiguration(Reader) 7 4 1
de.smartics.exceptions.context.AbstractExceptionContext.createConfiguration(URL) 7 4 1
de.smartics.exceptions.ExceptionInfo.ExceptionInfo(Throwable,Code) 7 4 1
de.smartics.exceptions.runtime.AbstractExceptionContextManager.getContext(ClassLoader) 7 3 1
de.smartics.exceptions.runtime.AbstractExceptionContextManager.setContextIfProvided(ClassLoader,T) 7 4 1
de.smartics.exceptions.code.NumberCodeComparator.compare(T,T) 6 1 1
de.smartics.exceptions.code.NumberCodeInfo.NumberCodeInfo(String,Integer,Integer) 6 3 1
de.smartics.exceptions.code.TwoNumberCodeInfo.getCode() 6 2 0
de.smartics.exceptions.code.TwoNumberCodeInfo.getDisplayId() 6 2 0
de.smartics.exceptions.ExceptionInfo.provideId(Throwable) 6 2 1
de.smartics.exceptions.AbstractCoreException.getCause() 5 3 0
de.smartics.exceptions.AbstractCoreRuntimeException.getCause() 5 3 0
de.smartics.exceptions.code.DefaultCodeComparator.compare(T,T) 5 1 1
de.smartics.exceptions.code.NumberCodeInfo.getCode() 5 2 0
de.smartics.exceptions.code.NumberCodeOnlyComparator.compare(T,T) 5 1 1
de.smartics.exceptions.code.RunningZerosNumberCodeInfo.getCode() 5 2 0
de.smartics.exceptions.Helper.provideException(Throwable) 5 2 1
de.smartics.exceptions.Helper.getThrowableHandleMode() 5 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
660.00 3.21 1.56 0.76

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