JavaNCSS Metric Results

[ package ] [ object ] [ function ] [ explanation ]

The following document contains the results of a JavaNCSS metric analysis.
JavaNCSS web site.

Packages

[ package ] [ object ] [ function ] [ explanation ]

Packages sorted by NCSS.

Package Classes Functions NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
net.sf.ezmorph.object 13 109 795 44 208 8 195
net.sf.ezmorph.array 12 84 709 34 132 11 180
net.sf.ezmorph.test 1 57 612 55 359 1 15
net.sf.ezmorph.primitive 11 65 477 41 177 1 165
net.sf.ezmorph.bean 3 45 443 5 27 2 45
net.sf.ezmorph 5 22 173 25 208 6 77
Classes total Functions total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
45 382 3209 204 1111 29 677

Objects

[ package ] [ object ] [ function ] [ explanation ]

TOP 30 classes containing the most NCSS.

Object NCSS Functions Classes Javadocs
net.sf.ezmorph.test.ArrayAssertions 609 57 0 55
net.sf.ezmorph.bean.MorphDynaBean 175 24 0 1
net.sf.ezmorph.object.NumberMorpher 156 17 0 5
net.sf.ezmorph.bean.MorphDynaClass 116 14 1 1
net.sf.ezmorph.bean.BeanMorpher 105 7 0 3
net.sf.ezmorph.object.DateMorpher 90 13 0 9
net.sf.ezmorph.object.BigIntegerMorpher 77 8 0 4
net.sf.ezmorph.object.BigDecimalMorpher 66 7 0 3
net.sf.ezmorph.object.MapToDateMorpher 65 10 0 3
net.sf.ezmorph.MorpherRegistry 63 9 0 9
net.sf.ezmorph.array.ObjectArrayMorpher 63 7 0 2
net.sf.ezmorph.array.BooleanObjectArrayMorpher 63 7 0 2
net.sf.ezmorph.array.CharacterObjectArrayMorpher 63 7 0 2
net.sf.ezmorph.primitive.BooleanMorpher 60 7 0 4
net.sf.ezmorph.object.ObjectListMorpher 54 8 0 2
net.sf.ezmorph.MorphUtils 54 6 0 6
net.sf.ezmorph.array.CharArrayMorpher 54 7 0 3
net.sf.ezmorph.array.ByteArrayMorpher 54 7 0 2
net.sf.ezmorph.array.BooleanArrayMorpher 54 7 0 2
net.sf.ezmorph.array.FloatArrayMorpher 54 7 0 3
net.sf.ezmorph.array.ShortArrayMorpher 54 7 0 3
net.sf.ezmorph.array.DoubleArrayMorpher 54 7 0 3
net.sf.ezmorph.array.IntArrayMorpher 54 7 0 3
net.sf.ezmorph.array.LongArrayMorpher 54 7 0 3
net.sf.ezmorph.object.BooleanObjectMorpher 52 7 0 3
net.sf.ezmorph.object.CharacterObjectMorpher 50 7 0 3
net.sf.ezmorph.primitive.LongMorpher 50 7 0 4
net.sf.ezmorph.primitive.ByteMorpher 50 7 0 4
net.sf.ezmorph.primitive.FloatMorpher 50 7 0 4
net.sf.ezmorph.primitive.IntMorpher 50 7 0 4

TOP 30 classes containing the most functions.

Object NCSS Functions Classes Javadocs
net.sf.ezmorph.test.ArrayAssertions 609 57 0 55
net.sf.ezmorph.bean.MorphDynaBean 175 24 0 1
net.sf.ezmorph.object.NumberMorpher 156 17 0 5
net.sf.ezmorph.bean.MorphDynaClass 116 14 1 1
net.sf.ezmorph.object.DateMorpher 90 13 0 9
net.sf.ezmorph.object.MapToDateMorpher 65 10 0 3
net.sf.ezmorph.MorpherRegistry 63 9 0 9
net.sf.ezmorph.object.BigIntegerMorpher 77 8 0 4
net.sf.ezmorph.object.ObjectListMorpher 54 8 0 2
net.sf.ezmorph.object.CharacterObjectMorpher 50 7 0 3
net.sf.ezmorph.object.BooleanObjectMorpher 52 7 0 3
net.sf.ezmorph.object.ClassMorpher 23 7 0 2
net.sf.ezmorph.object.IdentityObjectMorpher 15 7 0 2
net.sf.ezmorph.object.StringMorpher 21 7 0 2
net.sf.ezmorph.object.BigDecimalMorpher 66 7 0 3
net.sf.ezmorph.bean.BeanMorpher 105 7 0 3
net.sf.ezmorph.array.CharArrayMorpher 54 7 0 3
net.sf.ezmorph.array.ByteArrayMorpher 54 7 0 2
net.sf.ezmorph.array.BooleanArrayMorpher 54 7 0 2
net.sf.ezmorph.array.ObjectArrayMorpher 63 7 0 2
net.sf.ezmorph.array.FloatArrayMorpher 54 7 0 3
net.sf.ezmorph.array.AbstractArrayMorpher 19 7 0 6
net.sf.ezmorph.array.ShortArrayMorpher 54 7 0 3
net.sf.ezmorph.array.DoubleArrayMorpher 54 7 0 3
net.sf.ezmorph.array.IntArrayMorpher 54 7 0 3
net.sf.ezmorph.array.LongArrayMorpher 54 7 0 3
net.sf.ezmorph.array.BooleanObjectArrayMorpher 63 7 0 2
net.sf.ezmorph.array.CharacterObjectArrayMorpher 63 7 0 2
net.sf.ezmorph.primitive.LongMorpher 50 7 0 4
net.sf.ezmorph.primitive.BooleanMorpher 60 7 0 4
Averages.
NCSS average Program NCSS Classes average Functions average Javadocs average
65.36 3,209.00 0.02 8.49 4.53

Functions

[ package ] [ object ] [ function ] [ explanation ]

TOP 30 functions containing the most NCSS.

Functions NCSS CCN Javadocs
net.sf.ezmorph.test.ArrayAssertions.assertEquals(String,Object[],Object[]) 103 40 1
net.sf.ezmorph.test.ArrayAssertions.assertExpectedPrimitiveArrays(String,Object,Object,Class,Class) 96 33 0
net.sf.ezmorph.test.ArrayAssertions.assertActualPrimitiveArrays(String,Object,Object,Class,Class) 48 17 0
net.sf.ezmorph.bean.BeanMorpher.morph(Object) 40 15 0
net.sf.ezmorph.object.BigIntegerMorpher.morph(Object) 33 27 0
net.sf.ezmorph.object.BigDecimalMorpher.morph(Object) 33 27 0
net.sf.ezmorph.test.ArrayAssertions.assertEquals(String,List,List) 31 17 1
net.sf.ezmorph.array.BooleanObjectArrayMorpher.morph(Object) 29 16 0
net.sf.ezmorph.array.CharacterObjectArrayMorpher.morph(Object) 29 15 0
net.sf.ezmorph.object.NumberMorpher.morph(Object) 28 29 0
net.sf.ezmorph.bean.MorphDynaClass.process() 28 13 0
net.sf.ezmorph.bean.BeanMorpher.validateClass(Class) 27 21 0
net.sf.ezmorph.primitive.BooleanMorpher.morph(Object) 27 28 1
net.sf.ezmorph.bean.MorphDynaBean.set(String,int,Object) 26 11 0
net.sf.ezmorph.array.ObjectArrayMorpher.morph(Object) 25 16 0
net.sf.ezmorph.bean.MorphDynaBean.isDynaAssignable(Class,Class) 23 44 0
net.sf.ezmorph.object.ObjectListMorpher.morph(Object) 22 14 0
net.sf.ezmorph.object.MapToDateMorpher.morph(Object) 22 11 0
net.sf.ezmorph.MorpherRegistry.morph(Class,Object) 22 14 1
net.sf.ezmorph.object.DateMorpher.morph(Object) 21 14 0
net.sf.ezmorph.object.DateMorpher.equals(Object) 20 13 0
net.sf.ezmorph.bean.BeanMorpher.setProperty(Object,String,Class,Class,Object) 20 10 0
net.sf.ezmorph.array.CharArrayMorpher.morph(Object) 20 12 0
net.sf.ezmorph.array.ByteArrayMorpher.morph(Object) 20 12 0
net.sf.ezmorph.array.BooleanArrayMorpher.morph(Object) 20 13 0
net.sf.ezmorph.array.FloatArrayMorpher.morph(Object) 20 12 0
net.sf.ezmorph.array.ShortArrayMorpher.morph(Object) 20 12 0
net.sf.ezmorph.array.DoubleArrayMorpher.morph(Object) 20 12 0
net.sf.ezmorph.array.IntArrayMorpher.morph(Object) 20 12 0
net.sf.ezmorph.array.LongArrayMorpher.morph(Object) 20 12 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
3,209.00 7.36 4.39 0.42

Explanations

[ package ] [ object ] [ function ] [ 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 Comments
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 {
expression, if, else, while, do, for, switch, break, continue, return, throw, synchronized, catch, finally
Label declaration fine : normal, case, default

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 (no matter if it's a function or a procedure) will not be counted.

Note that else, default, and finallydon't increment the CCN value any further. On the other hand, a simple method with a switchstatement and a huge block of casestatements can have a surprisingly high CCN value (still it has the same value when converting a switchblock to an equivalent sequence of ifstatements).

The first article about this trivial software metric is one of the most cited papers in computer science. Sometimes you just must be the first to point out some basic shit and you are history. It seems just like a wonder that nobody was able to package Lines of Code in a more scientific manner. Now it's too late to label someone's name on it :).