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
net.ep.db4o.javassist 11 92 553 11 64 31 165
net.ep.db4o.factories 6 18 95 0 0 1 96
net.ep.db4o.activator 2 8 42 1 6 5 30
net.ep.db4o.annotations 0 0 12 0 0 0 30
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
19 118 702 12 70 37 321

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
net.ep.db4o.javassist.JVSTClass 183 30 0 0
net.ep.db4o.javassist.JVSTReflector 163 32 1 11
net.ep.db4o.javassist.Enhancer 46 5 0 0
net.ep.db4o.javassist.JVSTField 31 11 0 0
net.ep.db4o.activator.ProxyActivationSupport 30 8 0 0
net.ep.db4o.factories.FactoryInvocationHandler 28 3 0 0
net.ep.db4o.factories.BasicFactories 26 4 0 0
net.ep.db4o.javassist.JVSTArray 13 5 0 0
net.ep.db4o.javassist.ClassWithFinalMethod 12 4 0 0
net.ep.db4o.factories.PersistentFactories 10 3 0 0
net.ep.db4o.factories.InvalidFactoryException 9 4 0 0
net.ep.db4o.javassist.Tools 9 1 0 0
net.ep.db4o.factories.Factories 4 3 0 0
net.ep.db4o.javassist.AnnotationPersistencePolicy 3 1 0 0
net.ep.db4o.javassist.ActivateOnAllMethods 3 1 0 0
net.ep.db4o.factories.ObjectContainerProvider 2 1 0 0
net.ep.db4o.javassist.PersistOnMethodPolicy 2 1 0 0
net.ep.db4o.javassist.ActivateOnMethodPolicy 2 1 0 0
net.ep.db4o.activator.TransparentActivation 1 0 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
net.ep.db4o.javassist.JVSTReflector 163 32 1 11
net.ep.db4o.javassist.JVSTClass 183 30 0 0
net.ep.db4o.javassist.JVSTField 31 11 0 0
net.ep.db4o.activator.ProxyActivationSupport 30 8 0 0
net.ep.db4o.javassist.JVSTArray 13 5 0 0
net.ep.db4o.javassist.Enhancer 46 5 0 0
net.ep.db4o.factories.BasicFactories 26 4 0 0
net.ep.db4o.factories.InvalidFactoryException 9 4 0 0
net.ep.db4o.javassist.ClassWithFinalMethod 12 4 0 0
net.ep.db4o.factories.PersistentFactories 10 3 0 0
net.ep.db4o.factories.Factories 4 3 0 0
net.ep.db4o.factories.FactoryInvocationHandler 28 3 0 0
net.ep.db4o.factories.ObjectContainerProvider 2 1 0 0
net.ep.db4o.javassist.PersistOnMethodPolicy 2 1 0 0
net.ep.db4o.javassist.ActivateOnMethodPolicy 2 1 0 0
net.ep.db4o.javassist.AnnotationPersistencePolicy 3 1 0 0
net.ep.db4o.javassist.ActivateOnAllMethods 3 1 0 0
net.ep.db4o.javassist.Tools 9 1 0 0
net.ep.db4o.activator.TransparentActivation 1 0 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
30.37 702.00 0.05 6.21 0.63

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
net.ep.db4o.javassist.JVSTClass.JVSTClass(Reflector,JVSTReflector,ClassPool,Class,boolean,boolean,PersistOnMethodPolicy,ActivateOnMethodPolicy) 60 19 0
net.ep.db4o.javassist.JVSTClass.enhanceMethods(CtClass,CtClass,List) 27 12 0
net.ep.db4o.javassist.JVSTReflector.explainWhyNotEnhanced(Class) 24 10 0
net.ep.db4o.factories.FactoryInvocationHandler.findConstructor(Method,Class) 14 11 0
net.ep.db4o.factories.BasicFactories.createFactory(Class) 13 7 0
net.ep.db4o.javassist.Enhancer.enhancedClass(Class,ObjectContainerProvider) 13 7 0
net.ep.db4o.javassist.Enhancer.newInstance(Class,ObjectContainer) 12 5 0
net.ep.db4o.javassist.JVSTReflector.createClass(Class) 12 5 0
net.ep.db4o.javassist.Enhancer.enhance(T,ObjectContainer) 10 5 0
net.ep.db4o.javassist.JVSTReflector.findInCache(Class) 10 8 0
net.ep.db4o.factories.BasicFactories.createInstance(Class) 9 5 0
net.ep.db4o.activator.ProxyActivationSupport.prepare(Configuration) 8 1 0
net.ep.db4o.javassist.Enhancer.cloneFrom(Class,T,T) 8 3 0
net.ep.db4o.javassist.JVSTReflector.addToCache(Class,ReflectClass) 8 1 0
net.ep.db4o.javassist.JVSTClass.getDeclaredConstructors() 8 4 0
net.ep.db4o.javassist.JVSTClass.getDeclaredFields() 8 4 0
net.ep.db4o.javassist.Tools.hasAnnotation(CtMethod,Class) 8 6 0
net.ep.db4o.factories.FactoryInvocationHandler.FactoryInvocationHandler(Class,Class,Class,Factories) 7 4 0
net.ep.db4o.javassist.JVSTReflector.hasPublicConstructor(Class) 7 4 0
net.ep.db4o.javassist.JVSTReflector.toNative(ReflectClass[]) 7 3 1
net.ep.db4o.javassist.JVSTReflector.enhanceClass(Class) 7 4 0
net.ep.db4o.javassist.JVSTClass.getMethod(String,ReflectClass[]) 7 5 0
net.ep.db4o.javassist.JVSTClass.getDeclaredField(String) 6 5 0
net.ep.db4o.javassist.JVSTArray.newInstance(ReflectClass,ArrayInfo) 5 3 0
net.ep.db4o.javassist.JVSTReflector.JVSTReflector(JdkLoader) 5 1 1
net.ep.db4o.javassist.JVSTReflector.forName(String) 5 3 1
net.ep.db4o.javassist.JVSTClass.getSerializableConstructor() 5 3 0
net.ep.db4o.factories.PersistentFactories.PersistentFactories(ObjectContainerProvider) 4 3 0
net.ep.db4o.factories.FactoryInvocationHandler.invoke(Object,Method,Object[]) 4 1 0
net.ep.db4o.javassist.JVSTField.JVSTField(Reflector,Field) 4 1 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
702.00 4.35 2.26 0.09

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