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.impl.sim10121147776587108364
org.fosstrak.hal.impl.sim.graphic8807077437053178
org.fosstrak.hal.impl.sim.multi7606084121159146
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
2526127921911168220688

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.fosstrak.hal.impl.sim.GraphicSimulator377301532
org.fosstrak.hal.impl.sim.graphic.Tag351211521
org.fosstrak.hal.impl.sim.multi.GraphicSimulatorServer31537935
org.fosstrak.hal.impl.sim.MgmtSimDialog281685
org.fosstrak.hal.impl.sim.SimulatorController24745010
org.fosstrak.hal.impl.sim.SimulatorClient1321002
org.fosstrak.hal.impl.sim.BatchSimulator131907
org.fosstrak.hal.impl.sim.Tag10213014
org.fosstrak.hal.impl.sim.multi.SimulatorServerController981011
org.fosstrak.hal.impl.sim.CmdLineSim74502
org.fosstrak.hal.impl.sim.graphic.Reader641205
org.fosstrak.hal.impl.sim.multi.BatchSimulatorServer64203
org.fosstrak.hal.impl.sim.graphic.SelectionComponent58908
org.fosstrak.hal.impl.sim.graphic.Antenna51909
org.fosstrak.hal.impl.sim.multi.SimulatorClientStub39801
org.fosstrak.hal.impl.sim.graphic.DragListener34607
org.fosstrak.hal.impl.sim.graphic.Cable30404
org.fosstrak.hal.impl.sim.graphic.TranslationListener18607
org.fosstrak.hal.impl.sim.graphic.IGraphicSimulator1413013
org.fosstrak.hal.impl.sim.multi.SimulatorServerTokens8000
org.fosstrak.hal.impl.sim.SimulatorException6202
org.fosstrak.hal.impl.sim.multi.SimulatorServerException5200
org.fosstrak.hal.impl.sim.BatchSimulatorTokens3000
org.fosstrak.hal.impl.sim.multi.SimulatorServerEngine2101
org.fosstrak.hal.impl.sim.SimulatorEngine2102

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.fosstrak.hal.impl.sim.SimulatorController24745010
org.fosstrak.hal.impl.sim.multi.GraphicSimulatorServer31537935
org.fosstrak.hal.impl.sim.GraphicSimulator377301532
org.fosstrak.hal.impl.sim.graphic.Tag351211521
org.fosstrak.hal.impl.sim.graphic.IGraphicSimulator1413013
org.fosstrak.hal.impl.sim.Tag10213014
org.fosstrak.hal.impl.sim.graphic.Reader641205
org.fosstrak.hal.impl.sim.multi.SimulatorServerController981011
org.fosstrak.hal.impl.sim.SimulatorClient1321002
org.fosstrak.hal.impl.sim.BatchSimulator131907
org.fosstrak.hal.impl.sim.graphic.Antenna51909
org.fosstrak.hal.impl.sim.graphic.SelectionComponent58908
org.fosstrak.hal.impl.sim.multi.SimulatorClientStub39801
org.fosstrak.hal.impl.sim.graphic.DragListener34607
org.fosstrak.hal.impl.sim.graphic.TranslationListener18607
org.fosstrak.hal.impl.sim.MgmtSimDialog281685
org.fosstrak.hal.impl.sim.CmdLineSim74502
org.fosstrak.hal.impl.sim.graphic.Cable30404
org.fosstrak.hal.impl.sim.multi.BatchSimulatorServer64203
org.fosstrak.hal.impl.sim.multi.SimulatorServerException5200
org.fosstrak.hal.impl.sim.SimulatorException6202
org.fosstrak.hal.impl.sim.multi.SimulatorServerEngine2101
org.fosstrak.hal.impl.sim.SimulatorEngine2102
org.fosstrak.hal.impl.sim.BatchSimulatorTokens3000
org.fosstrak.hal.impl.sim.multi.SimulatorServerTokens8000

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
100.242,792.001.9210.447.64

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.fosstrak.hal.impl.sim.MgmtSimDialog.initGUI()17521
org.fosstrak.hal.impl.sim.graphic.Tag.showMemoryBanksDialog(int,int)137101
org.fosstrak.hal.impl.sim.graphic.Tag.Tag(String,Point,IGraphicSimulator)8511
org.fosstrak.hal.impl.sim.BatchSimulator.run()59151
org.fosstrak.hal.impl.sim.CmdLineSim.getInputString(String)53120
org.fosstrak.hal.impl.sim.SimulatorController.identify(String[])4980
org.fosstrak.hal.impl.sim.MgmtSimDialog.updateController()41331
org.fosstrak.hal.impl.sim.multi.BatchSimulatorServer.run()41141
org.fosstrak.hal.impl.sim.GraphicSimulator.getJLayeredPane()3831
org.fosstrak.hal.impl.sim.GraphicSimulator.showAddTagDialog()3741
org.fosstrak.hal.impl.sim.multi.GraphicSimulatorServer.showAddTagDialog()3741
org.fosstrak.hal.impl.sim.GraphicSimulator.initialize(SimulatorController,String)36101
org.fosstrak.hal.impl.sim.GraphicSimulator.showAddAntennaDialog()3321
org.fosstrak.hal.impl.sim.multi.SimulatorServerController.SimulatorServerController(String,String)33210
org.fosstrak.hal.impl.sim.multi.GraphicSimulatorServer.getJLayeredPane()3121
org.fosstrak.hal.impl.sim.graphic.Tag.showRemoveTagsDialog(int,int)2711
org.fosstrak.hal.impl.sim.GraphicSimulator.initializeGUI()2681
org.fosstrak.hal.impl.sim.graphic.Tag.showRemoveTagDialog(int,int)2511
org.fosstrak.hal.impl.sim.multi.GraphicSimulatorServer.computeProperties()2581
org.fosstrak.hal.impl.sim.SimulatorClient.generateEvent(String)25110
org.fosstrak.hal.impl.sim.SimulatorController.readBytes(String,String,int,int,int,String[])25130
org.fosstrak.hal.impl.sim.SimulatorClient.tryToConnect()23120
org.fosstrak.hal.impl.sim.SimulatorController.writeBytes(String,String,int,int,UnsignedByteArray,String[])23120
org.fosstrak.hal.impl.sim.Tag.setTagID(String)2371
org.fosstrak.hal.impl.sim.multi.GraphicSimulatorServer.initialize(SimulatorServerController,String,String)2261
org.fosstrak.hal.impl.sim.SimulatorClient.initialize(SimulatorController,String)21131
org.fosstrak.hal.impl.sim.BatchSimulator.initSimulator()2071
org.fosstrak.hal.impl.sim.GraphicSimulator.getHelpMenu()1911
org.fosstrak.hal.impl.sim.multi.GraphicSimulatorServer.getHelpMenu()1911
org.fosstrak.hal.impl.sim.multi.BatchSimulatorServer.initialize(SimulatorServerController,String,String)18111

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
2,792.007.942.270.54

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