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
be.objectify.led 9 29 234 27 139 0 185
be.objectify.led.factory.object 14 39 210 36 129 0 210
be.objectify.led.factory.type 4 15 119 4 15 0 60
be.objectify.led.util 2 6 24 6 37 0 30
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
29 89 587 73 320 0 485

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
be.objectify.led.PropertySetter 49 8 0 8
be.objectify.led.ObjectFactoryRegistry 49 4 0 5
be.objectify.led.factory.object.MapFactory 30 5 0 1
be.objectify.led.factory.object.SetFactory 27 5 0 1
be.objectify.led.factory.object.ListFactory 27 5 0 1
be.objectify.led.factory.type.MapTypeFactory 27 4 1 1
be.objectify.led.TypeFactoryRegistry 26 3 0 4
be.objectify.led.factory.object.EnumFactory 23 4 0 3
be.objectify.led.factory.type.ListTypeFactory 21 4 1 1
be.objectify.led.factory.type.SetTypeFactory 20 4 1 1
be.objectify.led.DefaultFactoryResolver 20 5 0 1
be.objectify.led.DefaultPropertyContext 17 2 0 2
be.objectify.led.util.ContractUtils 17 4 0 4
be.objectify.led.factory.object.AbstractNumberFactory 10 2 0 3
be.objectify.led.factory.object.CharacterFactory 8 2 0 3
be.objectify.led.factory.object.BooleanFactory 8 2 0 3
be.objectify.led.factory.type.EnumTypeFactory 7 3 0 1
be.objectify.led.factory.object.DoubleFactory 5 2 0 3
be.objectify.led.factory.object.IntegerFactory 5 2 0 3
be.objectify.led.factory.object.LongFactory 5 2 0 3
be.objectify.led.factory.object.ShortFactory 5 2 0 3
be.objectify.led.factory.object.FloatFactory 5 2 0 3
be.objectify.led.factory.object.ByteFactory 5 2 0 3
be.objectify.led.factory.object.StringFactory 5 2 0 3
be.objectify.led.util.StringUtils 4 2 0 2
be.objectify.led.TypeFactory 4 3 0 1
be.objectify.led.ObjectFactory 3 2 0 3
be.objectify.led.FactoryResolver 2 1 0 1
be.objectify.led.PropertyContext 2 1 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
be.objectify.led.PropertySetter 49 8 0 8
be.objectify.led.factory.object.MapFactory 30 5 0 1
be.objectify.led.factory.object.SetFactory 27 5 0 1
be.objectify.led.factory.object.ListFactory 27 5 0 1
be.objectify.led.DefaultFactoryResolver 20 5 0 1
be.objectify.led.factory.object.EnumFactory 23 4 0 3
be.objectify.led.factory.type.ListTypeFactory 21 4 1 1
be.objectify.led.factory.type.SetTypeFactory 20 4 1 1
be.objectify.led.factory.type.MapTypeFactory 27 4 1 1
be.objectify.led.util.ContractUtils 17 4 0 4
be.objectify.led.ObjectFactoryRegistry 49 4 0 5
be.objectify.led.TypeFactoryRegistry 26 3 0 4
be.objectify.led.factory.type.EnumTypeFactory 7 3 0 1
be.objectify.led.TypeFactory 4 3 0 1
be.objectify.led.DefaultPropertyContext 17 2 0 2
be.objectify.led.ObjectFactory 3 2 0 3
be.objectify.led.factory.object.DoubleFactory 5 2 0 3
be.objectify.led.factory.object.IntegerFactory 5 2 0 3
be.objectify.led.factory.object.LongFactory 5 2 0 3
be.objectify.led.factory.object.ShortFactory 5 2 0 3
be.objectify.led.factory.object.FloatFactory 5 2 0 3
be.objectify.led.factory.object.ByteFactory 5 2 0 3
be.objectify.led.factory.object.StringFactory 5 2 0 3
be.objectify.led.factory.object.CharacterFactory 8 2 0 3
be.objectify.led.factory.object.AbstractNumberFactory 10 2 0 3
be.objectify.led.factory.object.BooleanFactory 8 2 0 3
be.objectify.led.util.StringUtils 4 2 0 2
be.objectify.led.FactoryResolver 2 1 0 1
be.objectify.led.PropertyContext 2 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
15.03 587.00 0.10 3.07 2.52

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
be.objectify.led.ObjectFactoryRegistry.ObjectFactoryRegistry() 19 1 1
be.objectify.led.TypeFactoryRegistry.getFactory(Class) 16 9 1
be.objectify.led.factory.object.MapFactory.createObject(String) 15 6 0
be.objectify.led.factory.type.MapTypeFactory.createObjectFactory(Class[],Field) 15 1 0
be.objectify.led.factory.object.SetFactory.createObject(String) 14 5 0
be.objectify.led.factory.object.ListFactory.createObject(String) 14 5 0
be.objectify.led.factory.type.MapTypeFactory.MapFactory$1.parse(String,ObjectFactory,ObjectFactory) 11 4 0
be.objectify.led.DefaultPropertyContext.getValue(String) 10 5 1
be.objectify.led.factory.type.ListTypeFactory.createObjectFactory(Class[],Field) 10 1 0
be.objectify.led.factory.type.SetTypeFactory.createObjectFactory(Class[],Field) 10 1 0
be.objectify.led.PropertySetter.setProperty(Object,Field) 10 5 1
be.objectify.led.ObjectFactoryRegistry.getFactory(Class) 10 4 1
be.objectify.led.PropertySetter.setValue(Object,Field,Object) 9 4 1
be.objectify.led.factory.object.EnumFactory.createObject(String) 8 3 1
be.objectify.led.factory.object.EnumFactory.getValue(Class,String) 8 3 0
be.objectify.led.DefaultFactoryResolver.resolveFactory(Class,Field) 8 3 0
be.objectify.led.factory.object.AbstractNumberFactory.createObject(String) 7 3 1
be.objectify.led.PropertySetter.getProperty(AccessibleObject) 7 3 0
be.objectify.led.factory.type.ListTypeFactory.ListFactory$1.parse(String,ObjectFactory) 6 3 0
be.objectify.led.factory.type.SetTypeFactory.SetFactory$1.parse(String,ObjectFactory) 6 3 0
be.objectify.led.factory.object.MapFactory.MapFactory(Class,Class,Field,FactoryResolver) 5 1 0
be.objectify.led.factory.object.CharacterFactory.createObject(String) 5 2 1
be.objectify.led.factory.object.BooleanFactory.createObject(String) 5 2 1
be.objectify.led.factory.type.MapTypeFactory.determineClassType(Class,GenericTypes) 5 4 0
be.objectify.led.util.ContractUtils.notNull(Object,String) 5 5 1
be.objectify.led.util.ContractUtils.nonNull(Object[],String) 5 4 1
be.objectify.led.util.ContractUtils.nonNull(Collection,String) 5 4 1
be.objectify.led.PropertySetter.PropertySetter(FactoryResolver,PropertyContext) 5 1 1
be.objectify.led.PropertySetter.process(Class) 5 4 1
be.objectify.led.PropertySetter.process(Object) 5 3 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
587.00 4.15 1.87 0.46

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