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.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
org.fosstrak.hal.util563510625068491
org.fosstrak.hal1411240012597063278
org.fosstrak.hal.transponder852327044170
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
2722712371871520164369

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.fosstrak.hal.util.ByteBlock15926027
org.fosstrak.hal.transponder.EPCTransponderModel1342000
org.fosstrak.hal.UnsignedByteArray13222023
org.fosstrak.hal.util.Tools12214015
org.fosstrak.hal.util.ResourceLocator113607
org.fosstrak.hal.util.RFIDTools8116011
org.fosstrak.hal.Observation5516017
org.fosstrak.hal.transponder.TransponderSystemInformationISO551000
org.fosstrak.hal.transponder.IDType47500
org.fosstrak.hal.ControllerProperties45505
org.fosstrak.hal.HardwareAbstraction3433034
org.fosstrak.hal.transponder.TransponderModel19600
org.fosstrak.hal.transponder.TransponderType19500
org.fosstrak.hal.Trigger16506
org.fosstrak.hal.MemoryBankDescriptor14405
org.fosstrak.hal.util.CRC1614102
org.fosstrak.hal.HardwareAbstractionException11405
org.fosstrak.hal.transponder.RFTechnology11300
org.fosstrak.hal.HardwareException10405
org.fosstrak.hal.OutOfBoundsException10405
org.fosstrak.hal.ReadPointNotFoundException10405
org.fosstrak.hal.TagDescriptor10304
org.fosstrak.hal.transponder.TransponderManufacturer10300
org.fosstrak.hal.UnsupportedOperationException10405
org.fosstrak.hal.transponder.InventoryItem9000
org.fosstrak.hal.MemoryDescriptor8304
org.fosstrak.hal.AsynchronousIdentifyListener2102

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.fosstrak.hal.HardwareAbstraction3433034
org.fosstrak.hal.util.ByteBlock15926027
org.fosstrak.hal.UnsignedByteArray13222023
org.fosstrak.hal.transponder.EPCTransponderModel1342000
org.fosstrak.hal.Observation5516017
org.fosstrak.hal.util.RFIDTools8116011
org.fosstrak.hal.util.Tools12214015
org.fosstrak.hal.transponder.TransponderSystemInformationISO551000
org.fosstrak.hal.transponder.TransponderModel19600
org.fosstrak.hal.util.ResourceLocator113607
org.fosstrak.hal.ControllerProperties45505
org.fosstrak.hal.transponder.IDType47500
org.fosstrak.hal.transponder.TransponderType19500
org.fosstrak.hal.Trigger16506
org.fosstrak.hal.HardwareAbstractionException11405
org.fosstrak.hal.HardwareException10405
org.fosstrak.hal.MemoryBankDescriptor14405
org.fosstrak.hal.OutOfBoundsException10405
org.fosstrak.hal.ReadPointNotFoundException10405
org.fosstrak.hal.UnsupportedOperationException10405
org.fosstrak.hal.MemoryDescriptor8304
org.fosstrak.hal.TagDescriptor10304
org.fosstrak.hal.transponder.RFTechnology11300
org.fosstrak.hal.transponder.TransponderManufacturer10300
org.fosstrak.hal.AsynchronousIdentifyListener2102
org.fosstrak.hal.util.CRC1614102
org.fosstrak.hal.transponder.InventoryItem9000

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
42.961,237.000.008.416.93

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.fosstrak.hal.transponder.EPCTransponderModel.initialize(String)3680
org.fosstrak.hal.util.ResourceLocator.locateDefault(String,String,Class)31101
org.fosstrak.hal.transponder.EPCTransponderModel.getEpcTrasponderModel(byte[],String)2850
org.fosstrak.hal.util.ResourceLocator.getURL(String,String,Class)28131
org.fosstrak.hal.transponder.IDType.initialize(String)2060
org.fosstrak.hal.util.Tools.decodeURL(String)2041
org.fosstrak.hal.util.Tools.encodeURL(String)18111
org.fosstrak.hal.ControllerProperties.getParameterNames()1741
org.fosstrak.hal.transponder.EPCTransponderModel.EPCTransponderModel(TransponderType,String,String,int,boolean,boolean,int,boolean,boolean,int,boolean,boolean,int,boolean,boolean)1610
org.fosstrak.hal.UnsignedByteArray.stringConverter(String)1621
org.fosstrak.hal.util.ByteBlock.stringConverter(String)1621
org.fosstrak.hal.transponder.TransponderSystemInformationISO.toString()1510
org.fosstrak.hal.util.ResourceLocator.getBestClassLoader(Class)1551
org.fosstrak.hal.util.Tools.replaceString(String,String,String)1561
org.fosstrak.hal.transponder.IDType.getIdType(String,String)1460
org.fosstrak.hal.util.ResourceLocator.locate(String,ClassLoader,Class)1481
org.fosstrak.hal.UnsignedByteArray.hexStringToByteArray(String)1241
org.fosstrak.hal.util.ByteBlock.hexStringToByteArray(String)1241
org.fosstrak.hal.util.CRC16.crc16(byte[])1221
org.fosstrak.hal.ControllerProperties.getParameter(String)1131
org.fosstrak.hal.Observation.toString()1131
org.fosstrak.hal.util.ResourceLocator.isChild(ClassLoader,ClassLoader)11101
org.fosstrak.hal.util.ResourceLocator.locateAbsolute(String)1141
org.fosstrak.hal.util.Tools.readFile(String)1121
org.fosstrak.hal.transponder.TransponderSystemInformationISO.copyOfRange(byte[],int,int)1050
org.fosstrak.hal.UnsignedByteArray.equalsRegion(byte[],int,byte[],int,int)1091
org.fosstrak.hal.UnsignedByteArray.compareRegion(byte[],int,byte[],int,int)1071
org.fosstrak.hal.UnsignedByteArray.compare(byte,byte)1051
org.fosstrak.hal.util.ByteBlock.equalsRegion(byte[],int,byte[],int,int)1091
org.fosstrak.hal.util.ByteBlock.compareRegion(byte[],int,byte[],int,int)1071

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,237.004.661.940.74

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 declarationpackage java.lang;
Import declarationimport java.awt.*;
Class declaration
  • public class Foo {
  • public class Foo extends Bla {
Interface declarationpublic interface Able ; {
Field declaration
  • int a;
  • int a, b, c = 5, d = 6;
Method declaration
  • public void cry();
  • public void gib() throws DeadException {
Constructor declarationpublic Foo() {
Constructor invocation
  • this();
  • super();
Statement declaration
  • i = 0;
  • if (ok)
  • if (exit) {
  • if (3 == 4);
  • if (4 == 4) { ;
  • } else {
Label declarationfine :
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).