JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 33.54.
JavaNCSS web site.

Packages

Packages

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

Packages sorted by NCSS.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.apache.myfaces.tobago.example.data 16 118 599 1 4 5 288
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
16 118 599 1 4 5 288

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.example.data.SolarObject 134 33 0 0
org.apache.myfaces.tobago.example.data.CantorInterval 72 8 1 1
org.apache.myfaces.tobago.example.data.Node 56 21 0 0
org.apache.myfaces.tobago.example.data.CategoryTree 54 4 0 0
org.apache.myfaces.tobago.example.data.Planet 42 12 0 0
org.apache.myfaces.tobago.example.data.LocaleList 33 1 0 0
org.apache.myfaces.tobago.example.data.LocaleEntry 28 10 0 0
org.apache.myfaces.tobago.example.data.NamedNode 26 8 0 0
org.apache.myfaces.tobago.example.data.MixedCommandTree 17 1 0 0
org.apache.myfaces.tobago.example.data.CommandNode 16 5 0 0
org.apache.myfaces.tobago.example.data.Element 14 5 0 0
org.apache.myfaces.tobago.example.data.CommandNodeFactory 13 1 0 0
org.apache.myfaces.tobago.example.data.Salutation 10 3 0 0
org.apache.myfaces.tobago.example.data.Solar 9 3 0 0
org.apache.myfaces.tobago.example.data.SmallTree 8 1 0 0
org.apache.myfaces.tobago.example.data.SalutationConverter 7 2 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.example.data.SolarObject 134 33 0 0
org.apache.myfaces.tobago.example.data.Node 56 21 0 0
org.apache.myfaces.tobago.example.data.Planet 42 12 0 0
org.apache.myfaces.tobago.example.data.LocaleEntry 28 10 0 0
org.apache.myfaces.tobago.example.data.CantorInterval 72 8 1 1
org.apache.myfaces.tobago.example.data.NamedNode 26 8 0 0
org.apache.myfaces.tobago.example.data.CommandNode 16 5 0 0
org.apache.myfaces.tobago.example.data.Element 14 5 0 0
org.apache.myfaces.tobago.example.data.CategoryTree 54 4 0 0
org.apache.myfaces.tobago.example.data.Salutation 10 3 0 0
org.apache.myfaces.tobago.example.data.Solar 9 3 0 0
org.apache.myfaces.tobago.example.data.SalutationConverter 7 2 0 0
org.apache.myfaces.tobago.example.data.CommandNodeFactory 13 1 0 0
org.apache.myfaces.tobago.example.data.LocaleList 33 1 0 0
org.apache.myfaces.tobago.example.data.MixedCommandTree 17 1 0 0
org.apache.myfaces.tobago.example.data.SmallTree 8 1 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
33.69 599.00 0.06 7.38 0.06

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.myfaces.tobago.example.data.CategoryTree.createSample2() 31 2 0
org.apache.myfaces.tobago.example.data.CategoryTree.createSample() 19 1 0
org.apache.myfaces.tobago.example.data.MixedCommandTree.createSample() 16 1 0
org.apache.myfaces.tobago.example.data.CommandNodeFactory.createSample() 12 1 0
org.apache.myfaces.tobago.example.data.SolarObject.SolarObject(String,String,String,Integer,Double,Double,Double,String,Integer) 11 2 0
org.apache.myfaces.tobago.example.data.SolarObject.SolarObject(SolarObject) 11 1 0
org.apache.myfaces.tobago.example.data.SolarObject.getTree() 11 3 0
org.apache.myfaces.tobago.example.data.CantorInterval.init() 9 2 0
org.apache.myfaces.tobago.example.data.CantorInterval.Fraction.toString() 9 2 0
org.apache.myfaces.tobago.example.data.CantorInterval.getLabel() 8 1 0
org.apache.myfaces.tobago.example.data.CantorInterval.Fraction.Fraction(BigInteger,BigInteger) 8 3 0
org.apache.myfaces.tobago.example.data.SolarObject.getMarkup() 8 5 0
org.apache.myfaces.tobago.example.data.SmallTree.createSample() 7 1 0
org.apache.myfaces.tobago.example.data.SolarObject.getSatellites(String) 7 3 0
org.apache.myfaces.tobago.example.data.Planet.Planet(Planet) 6 1 0
org.apache.myfaces.tobago.example.data.Planet.Planet(String,String,String,String,List) 6 1 0
org.apache.myfaces.tobago.example.data.LocaleEntry.LocaleEntry(Locale,Locale) 5 1 0
org.apache.myfaces.tobago.example.data.NamedNode.NamedNode(String,String,String,String) 5 1 0
org.apache.myfaces.tobago.example.data.Salutation.getSalutation(String) 5 4 0
org.apache.myfaces.tobago.example.data.SolarObject.getList() 5 1 0
org.apache.myfaces.tobago.example.data.SolarObject.find(String) 5 4 0
org.apache.myfaces.tobago.example.data.CommandNode.CommandNode(String,String,String) 4 1 0
org.apache.myfaces.tobago.example.data.SalutationConverter.getAsString(FacesContext,UIComponent,Object) 4 3 0
org.apache.myfaces.tobago.example.data.CantorInterval.CantorInterval() 3 1 0
org.apache.myfaces.tobago.example.data.CantorInterval.CantorInterval(Fraction,Fraction) 3 1 0
org.apache.myfaces.tobago.example.data.CantorInterval.getChildCount() 3 1 0
org.apache.myfaces.tobago.example.data.CantorInterval.getChildAt(int) 3 1 0
org.apache.myfaces.tobago.example.data.CantorInterval.children() 3 1 0
org.apache.myfaces.tobago.example.data.CantorInterval.Fraction.Fraction(long) 3 1 0
org.apache.myfaces.tobago.example.data.Element.Element(String,double) 3 1 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
599.00 3.44 1.19 0.00

Explanations

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