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.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
openlr.otk.options 16 74 516 89 727 15 536
openlr.otk.binview 3 49 508 51 477 6 162
openlr.otk.coding 5 46 472 49 392 4 211
openlr.otk.binview.data 13 89 386 102 570 0 474
openlr.otk.kml.location 15 41 351 43 297 5 528
openlr.otk.kml.locationreference 11 29 204 37 225 0 366
openlr.otk.utils 6 24 203 31 209 1 220
openlr.otk.locrefboundary 4 15 190 16 120 1 111
openlr.otk.converter 3 17 189 20 142 3 115
openlr.otk.kml 7 26 140 33 298 4 234
openlr.otk.loaderinfo 3 16 134 18 133 0 103
openlr.otk 2 8 127 10 63 1 83
openlr.otk.xml2kml 2 12 116 13 96 1 69
openlr.otk.common 4 18 69 14 140 0 192
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
94 464 3605 526 3889 41 3404

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
openlr.otk.binview.BinaryDataViewer 359 36 0 37
openlr.otk.coding.Encode 136 12 0 12
openlr.otk.options.MapLoadFromParametersStringOption 113 8 0 8
openlr.otk.locrefboundary.LocRefBoundaryTool 98 6 1 6
openlr.otk.converter.PhysFormatConverter 97 6 0 6
openlr.otk.coding.DecodeOptions 76 11 0 12
openlr.otk.binview.BinaryViewerOptions 73 10 0 10
openlr.otk.loaderinfo.LoaderInfo 63 5 0 6
openlr.otk.options.UsageBuilder 62 7 0 8
openlr.otk.xml2kml.Xml2Kml 61 6 0 6
openlr.otk.OTK 59 5 0 6
openlr.otk.coding.EncodeOptions 59 11 0 12
openlr.otk.binview.data.IntermediateValue 53 14 0 15
openlr.otk.binview.data.LastValue 51 14 0 15
openlr.otk.binview.data.FirstValue 50 14 0 15
openlr.otk.coding.Decode 49 6 0 6
openlr.otk.ToolSelector 43 3 0 4
openlr.otk.binview.data.CoordinateValue 39 10 0 11
openlr.otk.options.InputFileOrStdInOption 37 6 0 7
openlr.otk.utils.DataResolver 36 4 0 5
openlr.otk.kml.locationreference.LRPBasedLocationReferenceFeatures 35 4 0 5
openlr.otk.options.CommandLineData 35 9 0 10
openlr.otk.options.InputFileOption 33 5 0 6
openlr.otk.converter.PhysFormatConvOptions 32 8 0 9
openlr.otk.common.Format 31 7 0 0
openlr.otk.coding.BaseOptions 31 6 0 7
openlr.otk.kml.location.GridLocationFeatures 31 3 0 4
openlr.otk.utils.StdInHandler 31 4 1 5
openlr.otk.utils.IOUtils 29 5 0 6
openlr.otk.binview.data.ByteValue 27 4 0 5

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
openlr.otk.binview.BinaryDataViewer 359 36 0 37
openlr.otk.binview.data.FirstValue 50 14 0 15
openlr.otk.binview.data.IntermediateValue 53 14 0 15
openlr.otk.binview.data.LastValue 51 14 0 15
openlr.otk.coding.Encode 136 12 0 12
openlr.otk.coding.DecodeOptions 76 11 0 12
openlr.otk.coding.EncodeOptions 59 11 0 12
openlr.otk.binview.BinaryViewerOptions 73 10 0 10
openlr.otk.binview.data.CoordinateValue 39 10 0 11
openlr.otk.kml.location.LocationContentProviderFactory 21 10 0 2
openlr.otk.kml.locationreference.LocationReferenceContentProviderFactory 21 10 0 11
openlr.otk.options.CommandLineData 35 9 0 10
openlr.otk.converter.PhysFormatConvOptions 32 8 0 9
openlr.otk.options.MapLoadFromParametersStringOption 113 8 0 8
openlr.otk.common.Format 31 7 0 0
openlr.otk.common.OpenLRCommandLineTool 15 7 0 8
openlr.otk.kml.ContentProvider 27 7 0 8
openlr.otk.options.UsageBuilder 62 7 0 8
openlr.otk.locrefboundary.LocRefBoundaryOptions 19 6 0 7
openlr.otk.locrefboundary.LocRefBoundaryTool 98 6 1 6
openlr.otk.loaderinfo.LoaderInfoOptions 15 6 0 6
openlr.otk.binview.data.LastClosedLineValue 25 6 0 7
openlr.otk.binview.data.OffsetValue 22 6 0 7
openlr.otk.coding.BaseOptions 31 6 0 7
openlr.otk.coding.Decode 49 6 0 6
openlr.otk.converter.PhysFormatConverter 97 6 0 6
openlr.otk.options.InputFileOrStdInOption 37 6 0 7
openlr.otk.options.Argument 16 6 0 7
openlr.otk.utils.Formatter 24 6 0 7
openlr.otk.xml2kml.Xml2Kml 61 6 0 6

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
29.81 3,605.00 0.04 4.94 5.60

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
openlr.otk.locrefboundary.LocRefBoundaryTool.readLocationReferencesFromFile(File) 45 23 1
openlr.otk.binview.BinaryDataViewer.processBinaryData(RawLocationReference,RawBinaryData,StringBuilder,Bytes) 45 15 1
openlr.otk.converter.PhysFormatConverter.executeImpl(PhysFormatConvOptions) 44 13 1
openlr.otk.locrefboundary.LocRefBoundaryTool.executeImpl(LocRefBoundaryOptions) 33 15 1
openlr.otk.loaderinfo.LoaderInfo.printInfo(OpenLRMapLoader,Writer) 32 5 1
openlr.otk.binview.BinaryViewerOptions.readContent(boolean,InputStream) 31 14 1
openlr.otk.options.MapLoadFromParametersStringOption.identifyMapLoader(String) 30 12 1
openlr.otk.coding.DecodeOptions.handleDecoding(String,InputStream,Format,String) 27 9 1
openlr.otk.kml.locationreference.LRPBasedLocationReferenceFeatures.createBaseContent(T) 27 9 1
openlr.otk.xml2kml.Xml2Kml.executeImpl(Xml2KmlOptions) 27 8 1
openlr.otk.converter.PhysFormatConverter.doConversion(Format,Format,PhysicalEncoder,PhysicalDecoder,LocationReference,OutputStream) 26 12 1
openlr.otk.options.MapLoadFromParametersStringOption.readAndPutValue(StringTokenizer,String,String) 26 7 1
openlr.otk.coding.Encode.writeResult(EncodeOptions,String,String) 22 6 1
openlr.otk.OTK.handleInfoParameters(String[]) 21 9 1
openlr.otk.loaderinfo.LoaderInfo.executeImpl(LoaderInfoOptions) 21 5 1
openlr.otk.binview.BinaryDataViewer.processHeader(StringBuilder,Header,LocationType) 21 5 1
openlr.otk.binview.BinaryDataViewer.processIntermediates(StringBuilder,IntermediateLRP,double,double) 21 2 1
openlr.otk.binview.BinaryDataViewer.processLastLRP(StringBuilder,LastLRP,double,double,int) 20 3 1
openlr.otk.coding.Encode.writeKml(File,Location,MapDatabase,LocationReferenceHolder,String) 20 9 1
openlr.otk.binview.BinaryDataViewer.handlePoiAccessLocation(StringBuilder,RawLocationReference,RawBinaryData,Header) 19 1 1
openlr.otk.coding.EncodeOptions.parseLocation(InputStream,String,MapDatabase) 19 9 1
openlr.otk.binview.BinaryDataViewer.handleCircleLocation(StringBuilder,RawLocationReference,RawBinaryData) 17 2 1
openlr.otk.coding.Decode.runAction(DecodeOptions) 17 6 1
openlr.otk.coding.Encode.runAction(EncodeOptions) 17 6 1
openlr.otk.coding.Encode.handleBinaryLocRef(EncodeOptions,LocationReferenceHolder,Format,String) 17 6 1
openlr.otk.kml.location.CircleLocationFeatures.createContent(CircleLocation) 17 4 0
openlr.otk.options.MapLoadFromParametersStringOption.loadMap(String) 17 6 1
openlr.otk.options.MapLoadFromParametersStringOption.executeMapLoader(String,OpenLRMapLoader) 17 10 1
openlr.otk.coding.DecodeOptions.processInput(CommandLine) 16 3 1
openlr.otk.kml.location.LineLocationFeatures.createAdditionalContent(Location) 16 3 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
3,605.00 5.31 2.04 0.93

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