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.assertions 52 778 3037 706 4390 3 823
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
52 778 3037 706 4390 3 823

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.fest.assertions.ListAssert 200 39 0 30
org.fest.assertions.CollectionAssert 124 30 0 25
org.fest.assertions.MapAssert 122 29 1 24
org.fest.assertions.FileAssert 115 27 0 24
org.fest.assertions.StringAssert 107 27 0 27
org.fest.assertions.ImageAssert 105 25 0 19
org.fest.assertions.ObjectArrayAssert 104 25 0 24
org.fest.assertions.DoubleArrayAssert 90 24 0 22
org.fest.assertions.ArrayAssert 80 15 0 12
org.fest.assertions.Assertions 79 38 0 38
org.fest.assertions.DoubleAssert 75 21 1 18
org.fest.assertions.FloatAssert 75 21 1 18
org.fest.assertions.BooleanArrayAssert 71 21 0 21
org.fest.assertions.ByteArrayAssert 71 21 0 21
org.fest.assertions.CharArrayAssert 71 21 0 21
org.fest.assertions.FloatArrayAssert 71 21 0 21
org.fest.assertions.IntArrayAssert 71 21 0 21
org.fest.assertions.LongArrayAssert 71 21 0 21
org.fest.assertions.ShortArrayAssert 71 21 0 21
org.fest.assertions.ObjectAssert 70 20 0 18
org.fest.assertions.ThrowableAssert 70 19 0 20
org.fest.assertions.GenericAssert 68 31 0 26
org.fest.assertions.BigDecimalAssert 67 24 0 25
org.fest.assertions.FileContentComparator 65 3 1 1
org.fest.assertions.CharAssert 57 14 0 15
org.fest.assertions.Fail 55 15 0 14
org.fest.assertions.ByteAssert 54 15 0 16
org.fest.assertions.IntAssert 54 15 0 16
org.fest.assertions.LongAssert 54 15 0 16
org.fest.assertions.ShortAssert 54 15 0 16

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.fest.assertions.ListAssert 200 39 0 30
org.fest.assertions.Assertions 79 38 0 38
org.fest.assertions.GenericAssert 68 31 0 26
org.fest.assertions.CollectionAssert 124 30 0 25
org.fest.assertions.MapAssert 122 29 1 24
org.fest.assertions.FileAssert 115 27 0 24
org.fest.assertions.StringAssert 107 27 0 27
org.fest.assertions.ImageAssert 105 25 0 19
org.fest.assertions.ObjectArrayAssert 104 25 0 24
org.fest.assertions.BigDecimalAssert 67 24 0 25
org.fest.assertions.DoubleArrayAssert 90 24 0 22
org.fest.assertions.BooleanArrayAssert 71 21 0 21
org.fest.assertions.ByteArrayAssert 71 21 0 21
org.fest.assertions.CharArrayAssert 71 21 0 21
org.fest.assertions.DoubleAssert 75 21 1 18
org.fest.assertions.FloatArrayAssert 71 21 0 21
org.fest.assertions.FloatAssert 75 21 1 18
org.fest.assertions.IntArrayAssert 71 21 0 21
org.fest.assertions.LongArrayAssert 71 21 0 21
org.fest.assertions.ShortArrayAssert 71 21 0 21
org.fest.assertions.ObjectAssert 70 20 0 18
org.fest.assertions.ThrowableAssert 70 19 0 20
org.fest.assertions.ArrayAssert 80 15 0 12
org.fest.assertions.ByteAssert 54 15 0 16
org.fest.assertions.Fail 55 15 0 14
org.fest.assertions.IntAssert 54 15 0 16
org.fest.assertions.LongAssert 54 15 0 16
org.fest.assertions.ShortAssert 54 15 0 16
org.fest.assertions.Assert 31 14 0 13
org.fest.assertions.CharAssert 57 14 0 15

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
53.87 3,037.00 0.10 14.96 13.58

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.fest.assertions.FileContentComparator.verifyEqualContent(LineNumberReader,LineNumberReader) 17 11 0
org.fest.assertions.ListAssert.containsSequence(Object) 17 7 1
org.fest.assertions.ListAssert.endsWith(Object) 17 9 1
org.fest.assertions.ToString.toStringOf(Object) 16 16 0
org.fest.assertions.ListAssert.startsWith(Object) 15 9 1
org.fest.assertions.FileContentComparator.LineDiff.equals(Object) 13 11 0
org.fest.assertions.ObjectArrayAssert.hasAtLeastOneElementOfType(Class) 13 6 1
org.fest.assertions.DoubleArrayAssert.isEqualTo(double[],Delta) 12 8 1
org.fest.assertions.ListAssert.contains(Object,Index) 12 6 1
org.fest.assertions.FileAssert.hasSameContentAs(File) 11 5 1
org.fest.assertions.ArrayAssert.assertExcludes(List) 10 5 1
org.fest.assertions.CollectionAssert.containsOnly(Object) 10 6 1
org.fest.assertions.FileContentComparator.compareContents(File,File) 10 2 0
org.fest.assertions.ImageAssert.isNotEqualTo(BufferedImage) 10 8 1
org.fest.assertions.ListAssert.containsOnly(Object) 10 6 1
org.fest.assertions.MapAssert.includes(Entry) 10 4 1
org.fest.assertions.MapAssert.excludes(Entry) 10 4 1
org.fest.assertions.ConstructorInvoker.newInstance(String,Class[],Object[]) 9 3 0
org.fest.assertions.ObjectArrayAssert.hasAllElementsOfType(Class) 9 3 1
org.fest.assertions.ArrayAssert.notFoundInActual(List) 8 3 0
org.fest.assertions.ArrayAssert.assertContainsOnly(List) 8 5 1
org.fest.assertions.ArrayAssert.notFoundInCopy(List,List) 8 3 0
org.fest.assertions.CollectionAssert.notFoundInCopy(List,Object) 8 3 0
org.fest.assertions.CollectionAssert.excludes(Object) 8 4 1
org.fest.assertions.ComparisonFailureFactory.newComparisonFailure(String,Object,Object) 8 3 0
org.fest.assertions.ImageAssert.hasEqualColor(BufferedImage) 8 5 0
org.fest.assertions.ListAssert.notFoundInCopy(List,Object) 8 3 0
org.fest.assertions.ListAssert.excludes(Object) 8 4 1
org.fest.assertions.ObjectArrayAssert.doesNotHaveDuplicates() 8 4 1
org.fest.assertions.ObjectAssert.isInstanceOf(Class) 8 4 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
3,037.00 3.42 1.74 0.83

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