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 41 177 46 369 64 153
de.smartics.exceptions.context 5 23 119 19 140 62 188
de.smartics.exceptions.runtime 3 15 104 18 127 43 84
de.smartics.exceptions.id 5 18 92 23 138 55 124
de.smartics.exceptions.code 5 20 89 25 151 55 140
de.smartics.exceptions.core 5 9 22 13 99 28 132
de.smartics.exceptions.app 1 1 5 2 9 11 25
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
29 127 608 146 1033 318 846

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 38 9 0 10
de.smartics.exceptions.code.NumberCodeInfo 35 9 0 10
de.smartics.exceptions.AbstractCoreException 32 10 0 11
de.smartics.exceptions.AbstractCoreRuntimeException 32 10 0 11
de.smartics.exceptions.ExceptionInfo 27 6 0 7
de.smartics.exceptions.runtime.Helper 26 4 0 5
de.smartics.exceptions.id.IncrementFactory 24 3 0 4
de.smartics.exceptions.id.UuidExceptionId 21 6 0 7
de.smartics.exceptions.code.TwoNumberCodeInfo 20 5 0 6
de.smartics.exceptions.id.LongExceptionId 19 5 0 6
de.smartics.exceptions.context.ExceptionContextProperty 17 8 0 0
de.smartics.exceptions.context.PropertiesConfiguredExceptionContext 14 2 0 3
de.smartics.exceptions.runtime.ExceptionContextManager 12 4 0 5
de.smartics.exceptions.context.SystemDefaultExceptionContext 10 3 0 4
de.smartics.exceptions.CoreException 10 9 0 10
de.smartics.exceptions.code.NumberCodeComparator 9 2 0 3
de.smartics.exceptions.id.SignedIncrementFactory 9 3 0 4
de.smartics.exceptions.code.DefaultCodeComparator 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.code.NumberCode 3 2 0 3
de.smartics.exceptions.core.ExceptionContext 3 2 0 3
de.smartics.exceptions.core.ExceptionId 3 2 0 3
de.smartics.exceptions.id.UuidFactory 3 1 0 2
de.smartics.exceptions.core.IdFactory 2 1 0 2
de.smartics.exceptions.core.ThrowableHandleMode 1 0 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.exceptions.AbstractCoreException 32 10 0 11
de.smartics.exceptions.AbstractCoreRuntimeException 32 10 0 11
de.smartics.exceptions.code.NumberCodeInfo 35 9 0 10
de.smartics.exceptions.context.AbstractExceptionContext 38 9 0 10
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 6
de.smartics.exceptions.id.LongExceptionId 19 5 0 6
de.smartics.exceptions.core.Code 5 4 0 5
de.smartics.exceptions.runtime.ExceptionContextManager 12 4 0 5
de.smartics.exceptions.runtime.Helper 26 4 0 5
de.smartics.exceptions.context.SystemDefaultExceptionContext 10 3 0 4
de.smartics.exceptions.id.IncrementFactory 24 3 0 4
de.smartics.exceptions.id.SignedIncrementFactory 9 3 0 4
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.context.PropertiesConfiguredExceptionContext 14 2 0 3
de.smartics.exceptions.core.ExceptionContext 3 2 0 3
de.smartics.exceptions.core.ExceptionId 3 2 0 3
de.smartics.exceptions.app.Constant 4 1 0 2
de.smartics.exceptions.context.ConfiguredExceptionContext 4 1 0 2
de.smartics.exceptions.core.IdFactory 2 1 0 2
de.smartics.exceptions.id.UuidFactory 3 1 0 2
de.smartics.exceptions.core.ThrowableHandleMode 1 0 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
16.86 608.00 0.00 4.38 5.03

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.exceptions.runtime.Helper.loadService(T,ClassLoader) 18 7 1
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 1
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.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.AbstractCoreException.toString() 7 2 1
de.smartics.exceptions.AbstractCoreRuntimeException.toString() 7 2 1
de.smartics.exceptions.code.NumberCodeInfo.getDisplayId() 7 2 1
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 1
de.smartics.exceptions.code.TwoNumberCodeInfo.getDisplayId() 6 2 1
de.smartics.exceptions.ExceptionInfo.provideId(Throwable) 6 2 1
de.smartics.exceptions.AbstractCoreException.getCause() 5 3 1
de.smartics.exceptions.AbstractCoreRuntimeException.getCause() 5 3 1
de.smartics.exceptions.code.DefaultCodeComparator.compare(T,T) 5 1 1
de.smartics.exceptions.code.NumberCodeInfo.getCode() 5 2 1
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
608.00 3.35 1.65 0.94

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