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.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.jrobin.core 42 593 3153 375 3229 827 1110
org.jrobin.graph 42 300 2779 87 922 108 1086
org.jrobin.data 13 125 1224 60 548 59 346
org.jrobin.inspector 12 89 1154 2 12 57 288
org.jrobin.cmd 14 91 917 8 72 64 336
org.jrobin.core.jrrd 13 93 879 64 379 48 159
org.jrobin.core.timespec 5 31 536 9 88 12 183
org.jrobin.convertor 1 6 63 2 17 0 24
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
142 1328 10705 607 5267 1175 3532

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.jrobin.graph.RrdGraphDefTemplate 536 25 0 5
org.jrobin.data.RpnCalculator 479 9 2 0
org.jrobin.graph.RrdGraph 388 36 0 4
org.jrobin.inspector.RrdInspector 325 17 15 2
org.jrobin.core.RrdDb 324 55 0 46
org.jrobin.data.DataProcessor 288 50 0 36
org.jrobin.core.timespec.TimeParser 263 7 0 3
org.jrobin.core.Util 261 41 1 33
org.jrobin.graph.RrdGraphDef 258 71 0 68
org.jrobin.cmd.RrdGraphCmd 247 17 0 1
org.jrobin.core.RrdDef 229 38 0 32
org.jrobin.core.RrdToolkit 210 25 0 21
org.jrobin.core.Datasource 205 26 0 18
org.jrobin.core.Archive 198 22 0 14
org.jrobin.core.jrrd.Archive 192 16 0 8
org.jrobin.core.jrrd.RRDatabase 182 19 0 18
org.jrobin.inspector.GraphFrame 179 7 9 0
org.jrobin.graph.GifPixelsEncoder 175 12 0 0
org.jrobin.core.FetchData 164 33 0 29
org.jrobin.graph.TimeAxis 139 10 0 0
org.jrobin.core.RrdBackend 131 29 0 10
org.jrobin.graph.ImageWorker 130 22 0 0
org.jrobin.core.XmlTemplate 129 35 0 12
org.jrobin.inspector.EditDatasourceDialog 129 7 2 0
org.jrobin.inspector.EditArchiveDialog 121 7 2 0
org.jrobin.core.jrrd.DataSource 110 11 0 8
org.jrobin.graph.ValueAxis 103 2 1 0
org.jrobin.graph.LegendComposer 102 2 1 0
org.jrobin.core.Robin 99 17 0 12
org.jrobin.cmd.RrdCmdScanner 97 13 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.jrobin.graph.RrdGraphDef 258 71 0 68
org.jrobin.core.RrdDb 324 55 0 46
org.jrobin.data.DataProcessor 288 50 0 36
org.jrobin.core.Util 261 41 1 33
org.jrobin.core.RrdDef 229 38 0 32
org.jrobin.graph.RrdGraph 388 36 0 4
org.jrobin.core.XmlTemplate 129 35 0 12
org.jrobin.core.FetchData 164 33 0 29
org.jrobin.core.RrdBackend 131 29 0 10
org.jrobin.core.Datasource 205 26 0 18
org.jrobin.core.RrdToolkit 210 25 0 21
org.jrobin.graph.RrdGraphDefTemplate 536 25 0 5
org.jrobin.core.RrdToolReader 52 23 0 0
org.jrobin.core.Archive 198 22 0 14
org.jrobin.core.DataImporter 29 22 0 0
org.jrobin.graph.ImageWorker 130 22 0 0
org.jrobin.cmd.RrdToolCmd 67 21 0 0
org.jrobin.core.XmlReader 60 21 0 0
org.jrobin.graph.GifEncoder 92 21 0 0
org.jrobin.core.jrrd.RRDatabase 182 19 0 18
org.jrobin.cmd.RrdGraphCmd 247 17 0 1
org.jrobin.core.Header 78 17 0 9
org.jrobin.core.Robin 99 17 0 12
org.jrobin.core.RrdPrimitive 52 17 0 0
org.jrobin.data.Def 48 17 0 0
org.jrobin.inspector.RrdInspector 325 17 15 2
org.jrobin.core.jrrd.Archive 192 16 0 8
org.jrobin.core.jrrd.RRDFile 77 16 0 1
org.jrobin.core.XmlWriter 60 16 0 15
org.jrobin.core.FetchRequest 49 14 0 12

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
71.53 10,705.00 0.30 9.35 4.27

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.jrobin.data.RpnCalculator.calculateValues() 202 80 0
org.jrobin.data.RpnCalculator.createToken(String) 167 54 0
org.jrobin.inspector.RrdInspector.constructUI() 114 1 0
org.jrobin.graph.RrdGraphDefTemplate.resolveOptions(Node) 113 38 0
org.jrobin.cmd.RrdGraphCmd.getGraphDef() 101 32 1
org.jrobin.graph.ValueAxis.draw() 86 28 0
org.jrobin.core.timespec.TimeParser.day() 79 42 0
org.jrobin.core.timespec.TimeParser.parse() 71 40 1
org.jrobin.inspector.EditDatasourceDialog.constructUI(DsDef) 70 3 0
org.jrobin.inspector.EditArchiveDialog.constructUI(ArcDef) 62 3 0
org.jrobin.graph.RrdGraph.expandValueRange() 61 23 0
org.jrobin.core.jrrd.Archive.toXml(PrintStream) 52 8 0
org.jrobin.graph.GifPixelsEncoder.compress(int,OutputStream) 51 10 0
org.jrobin.graph.ValueAxisLogarithmic.draw() 50 16 0
org.jrobin.core.timespec.TimeParser.plusMinus(int) 49 20 0
org.jrobin.inspector.GraphFrame.createRrdGraph() 46 8 0
org.jrobin.graph.TimeAxis.adjustStartingTime(int,int) 44 9 0
org.jrobin.core.timespec.TimeScanner.nextToken() 42 24 0
org.jrobin.graph.RrdGraphDefTemplate.resolveTimeGrid(Node) 41 28 0
org.jrobin.core.Archive.fetchData(FetchRequest) 39 9 0
org.jrobin.core.jrrd.RRDatabase.findBestArchive(long,long,long,ArrayList) 37 12 0
org.jrobin.inspector.GraphFrame.constructUI() 37 1 0
org.jrobin.core.timespec.TimeParser.timeOfDay() 36 19 0
org.jrobin.core.RrdDb.findMatchingArchive(FetchRequest) 34 16 0
org.jrobin.cmd.RrdXportCmd.xport() 33 5 0
org.jrobin.core.Datasource.calculateUpdateValue(long,double,long,double) 33 19 0
org.jrobin.cmd.RrdUpdateCmd.execute() 31 18 0
org.jrobin.core.RrdDefTemplate.getRrdDef() 31 7 1
org.jrobin.core.jrrd.DataSource.toXml(PrintStream) 30 1 0
org.jrobin.graph.ValueAxisMrtg.draw() 30 13 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
10,705.00 6.55 2.62 0.39

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