JavaNCSS Metric Results

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

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

Packages

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

Packages sorted by NCSS.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
cern.colt.list1343126224444287246206
cern.colt513214721181482210104
cern.colt.map4219111191671417156127
openlr.location14199790213148911518
openlr.rawLocRef12935041055394415
openlr.location.utils.worker1021441311780366
openlr.collection4353123937565195
openlr.location.utils639277452870239
openlr.utils.locref.boundary1029194312021255
cern.jet.math217146191291944
openlr.properties516135201780214
openlr1261127695200418
cern.jet.random33111034164728
cern.jet.random.engine321100242762355
openlr.encoder43282362170131
openlr.utils.location1126413109167
openlr.utils.locref1126413109267
openlr.decoder32063231390101
cern.colt.function182561435960144
openlr.location.data39286420181
cern.colt.buffer228420016
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
173142887191497127557453891

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
cern.colt.Sorting105090072
cern.colt.list.ObjectArrayList30650051
cern.colt.Arrays25428029
cern.colt.list.AbstractDoubleList24444045
cern.colt.list.AbstractIntList24444045
cern.colt.list.AbstractByteList24243044
cern.colt.list.AbstractFloatList24243044
cern.colt.list.AbstractLongList24243044
cern.colt.list.ByteArrayList22529030
cern.colt.list.IntArrayList22128029
cern.colt.list.LongArrayList21828029
cern.colt.map.OpenIntObjectHashMap20223024
cern.colt.map.OpenLongObjectHashMap20223024
cern.colt.map.OpenIntIntHashMap20023024
cern.colt.list.DoubleArrayList17826027
cern.colt.list.FloatArrayList17526027
cern.colt.GenericSorting14511012
openlr.collection.OpenLongIntHashMap14017018
cern.jet.math.Arithmetic13316017
cern.colt.map.AbstractIntObjectMap131211122
cern.colt.map.AbstractLongObjectMap131211122
cern.colt.map.AbstractIntIntMap129211122
openlr.location.InvalidLocation9822023
openlr.collection.OpenLongHashSet8810011
cern.jet.random.Uniform8221022
openlr.location.AbstractLocation6829030
openlr.location.utils.LocationDataReader67506
openlr.collection.OpenAbstractCollection66708
openlr.properties.OpenLRPropertyAccess62708
openlr.location.LocationFactory6129030

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
cern.colt.Sorting105090072
cern.colt.list.ObjectArrayList30650051
cern.colt.list.AbstractDoubleList24444045
cern.colt.list.AbstractIntList24444045
cern.colt.list.AbstractByteList24243044
cern.colt.list.AbstractFloatList24243044
cern.colt.list.AbstractLongList24243044
openlr.location.AbstractLocation6829030
openlr.location.LocationFactory6129030
cern.colt.list.ByteArrayList22529030
cern.colt.Arrays25428029
cern.colt.list.IntArrayList22128029
cern.colt.list.LongArrayList21828029
cern.colt.list.DoubleArrayList17826027
cern.colt.list.FloatArrayList17526027
openlr.rawLocRef.RawLocationReference5423024
cern.colt.map.OpenIntIntHashMap20023024
cern.colt.map.OpenIntObjectHashMap20223024
cern.colt.map.OpenLongObjectHashMap20223024
openlr.location.InvalidLocation9822023
openlr.location.Location2322023
cern.colt.list.AbstractList4721022
cern.colt.map.AbstractIntIntMap129211122
cern.colt.map.AbstractIntObjectMap131211122
cern.colt.map.AbstractLongObjectMap131211122
cern.jet.random.Uniform8221022
openlr.collection.OpenLongIntHashMap14017018
cern.jet.math.Arithmetic13316017
openlr.location.utils.LocationDataIterator4615016
openlr.location.PoiAccessLocation5214015

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
47.758,719.000.238.258.72

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
cern.colt.GenericSorting.quickSort1(int,int,IntComparator,Swapper)54241
cern.colt.Sorting.inplace_merge(first[],int,int,int)43130
openlr.location.utils.LocationDataReader.resolveDataLine(String,MapDatabase,LocationData)40131
cern.colt.Sorting.quickSort1(byte[],int,int,ByteComparator)40181
cern.colt.Sorting.quickSort1(char[],int,int,CharComparator)40181
cern.colt.Sorting.quickSort1(double[],int,int,DoubleComparator)40181
cern.colt.Sorting.quickSort1(float[],int,int,FloatComparator)40181
cern.colt.Sorting.quickSort1(int[],int,int,IntComparator)40181
cern.colt.Sorting.quickSort1(long[],int,int,LongComparator)40181
cern.colt.Sorting.quickSort1(Object[],int,int)40181
cern.colt.Sorting.quickSort1(Object[],int,int,Comparator)40181
cern.colt.Sorting.quickSort1(short[],int,int,ShortComparator)40181
openlr.utils.location.LocationProcessor.process(Location)36121
openlr.utils.locref.LocationReferenceProcessor.process(RawLocationReference)36121
openlr.location.utils.LocationDataWriter.createLocationString(Location)35121
cern.colt.GenericSorting.inplace_merge(int,int,int,IntComparator,Swapper)34131
openlr.location.utils.worker.LineRW.readLocationString(String,String[],MapDatabase)27141
openlr.location.utils.worker.PoiAccessRW.readLocationString(String,String[],MapDatabase)25161
openlr.collection.OpenAbstractCollection.indexOfInsertion(long)24131
openlr.location.utils.worker.PoiAccessRW.createLocationString(Location)2411
openlr.location.InvalidLocation.toString()2491
cern.colt.list.ByteArrayList.removeAll(AbstractByteList)24101
cern.colt.list.DoubleArrayList.removeAll(AbstractDoubleList)24101
cern.colt.list.FloatArrayList.removeAll(AbstractFloatList)24101
cern.colt.list.IntArrayList.removeAll(AbstractIntList)24101
cern.colt.list.LongArrayList.removeAll(AbstractLongList)24101
cern.colt.map.OpenIntIntHashMap.indexOfInsertion(int)24131
cern.colt.map.OpenIntObjectHashMap.indexOfInsertion(int)24131
cern.colt.map.OpenLongObjectHashMap.indexOfInsertion(long)24131
cern.jet.math.Arithmetic.binomial(long,long)24151

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
8,719.005.492.490.95

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