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
org.fest.reflect.method 9 45 205 30 365 0 138
org.fest.reflect.field 7 34 175 19 241 0 103
org.fest.reflect.beanproperty 4 21 106 11 142 0 65
org.fest.reflect.constructor 3 12 56 9 82 0 42
org.fest.reflect.type 2 12 54 8 95 0 30
org.fest.reflect.innerclass 2 8 38 5 50 0 30
org.fest.reflect.core 1 9 36 9 143 0 14
org.fest.reflect.util 2 6 30 6 37 0 30
org.fest.reflect.reference 1 2 14 3 18 0 14
org.fest.reflect.exception 1 2 7 3 14 0 14
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
32 151 721 103 1187 0 480

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.fest.reflect.field.Invoker 65 12 0 3
org.fest.reflect.method.Invoker 50 9 0 2
org.fest.reflect.beanproperty.Invoker 44 10 0 3
org.fest.reflect.type.TypeLoader 29 6 0 3
org.fest.reflect.constructor.Invoker 25 5 0 3
org.fest.reflect.method.MethodName 20 7 0 6
org.fest.reflect.method.StaticMethodName 20 7 0 6
org.fest.reflect.core.Reflection 18 9 0 9
org.fest.reflect.innerclass.Invoker 18 4 0 2
org.fest.reflect.type.Type 18 6 0 5
org.fest.reflect.util.Accessibles 18 4 1 4
org.fest.reflect.beanproperty.PropertyName 16 5 0 4
org.fest.reflect.field.FieldName 16 5 0 4
org.fest.reflect.field.StaticFieldName 16 5 0 4
org.fest.reflect.beanproperty.PropertyType 14 3 0 2
org.fest.reflect.innerclass.StaticInnerClassName 14 4 0 3
org.fest.reflect.beanproperty.PropertyTypeRef 12 3 0 2
org.fest.reflect.field.FieldType 12 3 0 2
org.fest.reflect.field.FieldTypeRef 12 3 0 2
org.fest.reflect.field.StaticFieldType 12 3 0 2
org.fest.reflect.field.StaticFieldTypeRef 12 3 0 2
org.fest.reflect.method.MethodParameterTypes 12 3 0 2
org.fest.reflect.method.MethodReturnType 12 4 0 3
org.fest.reflect.method.MethodReturnTypeRef 12 4 0 3
org.fest.reflect.method.StaticMethodParameterTypes 12 3 0 2
org.fest.reflect.method.StaticMethodReturnType 12 4 0 3
org.fest.reflect.method.StaticMethodReturnTypeRef 12 4 0 3
org.fest.reflect.constructor.ParameterTypes 10 3 0 2
org.fest.reflect.reference.TypeRef 10 2 0 3
org.fest.reflect.constructor.TargetType 8 4 0 4

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.fest.reflect.field.Invoker 65 12 0 3
org.fest.reflect.beanproperty.Invoker 44 10 0 3
org.fest.reflect.core.Reflection 18 9 0 9
org.fest.reflect.method.Invoker 50 9 0 2
org.fest.reflect.method.MethodName 20 7 0 6
org.fest.reflect.method.StaticMethodName 20 7 0 6
org.fest.reflect.type.Type 18 6 0 5
org.fest.reflect.type.TypeLoader 29 6 0 3
org.fest.reflect.beanproperty.PropertyName 16 5 0 4
org.fest.reflect.constructor.Invoker 25 5 0 3
org.fest.reflect.field.FieldName 16 5 0 4
org.fest.reflect.field.StaticFieldName 16 5 0 4
org.fest.reflect.constructor.TargetType 8 4 0 4
org.fest.reflect.innerclass.Invoker 18 4 0 2
org.fest.reflect.innerclass.StaticInnerClassName 14 4 0 3
org.fest.reflect.method.MethodReturnType 12 4 0 3
org.fest.reflect.method.MethodReturnTypeRef 12 4 0 3
org.fest.reflect.method.StaticMethodReturnType 12 4 0 3
org.fest.reflect.method.StaticMethodReturnTypeRef 12 4 0 3
org.fest.reflect.util.Accessibles 18 4 1 4
org.fest.reflect.beanproperty.PropertyType 14 3 0 2
org.fest.reflect.beanproperty.PropertyTypeRef 12 3 0 2
org.fest.reflect.constructor.ParameterTypes 10 3 0 2
org.fest.reflect.field.FieldType 12 3 0 2
org.fest.reflect.field.FieldTypeRef 12 3 0 2
org.fest.reflect.field.StaticFieldType 12 3 0 2
org.fest.reflect.field.StaticFieldTypeRef 12 3 0 2
org.fest.reflect.method.MethodParameterTypes 12 3 0 2
org.fest.reflect.method.StaticMethodParameterTypes 12 3 0 2
org.fest.reflect.exception.ReflectionError 6 2 0 3

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
17.91 721.00 0.03 4.72 3.22

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.fest.reflect.constructor.Invoker.newInstance(Object) 12 6 1
org.fest.reflect.field.Invoker.lookupInClassHierarchy(String,Class) 11 6 0
org.fest.reflect.method.Invoker.lookupInClassHierarchy(String,Class,Class[]) 11 5 0
org.fest.reflect.method.Invoker.invoke(Object) 11 6 0
org.fest.reflect.beanproperty.Invoker.descriptorForProperty(String,Object) 10 7 0
org.fest.reflect.field.Invoker.verifyCorrectType(Field,Class) 8 3 0
org.fest.reflect.field.Invoker.set(T) 7 3 1
org.fest.reflect.field.Invoker.get() 7 4 0
org.fest.reflect.type.TypeLoader.unableToLoadClassMessage(Class) 7 2 0
org.fest.reflect.field.Invoker.createInvoker(String,Class,Object) 6 3 0
org.fest.reflect.innerclass.Invoker.get() 6 5 1
org.fest.reflect.method.Invoker.method(String,Class,Class[]) 6 5 0
org.fest.reflect.reference.TypeRef.TypeRef() 6 4 1
org.fest.reflect.type.Type.newType(String) 6 5 1
org.fest.reflect.type.TypeLoader.loadAs(Class) 6 6 1
org.fest.reflect.beanproperty.PropertyName.validateIsNotNullOrEmpty(String) 5 5 0
org.fest.reflect.field.FieldName.validateIsNotNullOrEmpty(String) 5 5 0
org.fest.reflect.field.StaticFieldName.validateIsNotNullOrEmpty(String) 5 5 0
org.fest.reflect.innerclass.StaticInnerClassName.validateIsNotNullOrEmpty(String) 5 5 0
org.fest.reflect.method.Invoker.createInvoker(String,Object,Class) 5 3 0
org.fest.reflect.method.MethodName.validateIsNotNullOrEmpty(String) 5 5 0
org.fest.reflect.method.StaticMethodName.validateIsNotNullOrEmpty(String) 5 5 0
org.fest.reflect.beanproperty.Invoker.createInvoker(String,Class,Object) 4 1 0
org.fest.reflect.beanproperty.Invoker.verifyCorrectType(String,Object,Class,PropertyDescriptor) 4 3 0
org.fest.reflect.beanproperty.Invoker.incorrectPropertyType(String,Object,Class,Class) 4 2 0
org.fest.reflect.beanproperty.Invoker.Invoker(String,Object,PropertyDescriptor) 4 1 0
org.fest.reflect.beanproperty.Invoker.set(T) 4 3 1
org.fest.reflect.beanproperty.Invoker.get() 4 4 0
org.fest.reflect.beanproperty.PropertyType.newPropertyType(String,Class) 4 3 0
org.fest.reflect.beanproperty.PropertyType.in(Object) 4 3 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
721.00 3.24 1.90 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).