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
cppncss754339231114376
cpptools946306241220316
cppncss.counter95628117903375
cppncss.measure1034179251280334
cpptools.preprocessor62414915830194
cppstyle1648212036
cppstyle.checks115210027
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
43221130710855671658

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
cpptools.Analyzer1221322
cppncss.CppNcss871133
cppncss.CppNcssTask861145
cppncss.counter.FunctionNameExtractor69841
cppncss.counter.NcssCounter692302
cpptools.preprocessor.AbstractTokenFilter50702
cppncss.measure.MeasureCollector44702
cpptools.Options43702
cppstyle.CppStyle37602
cppncss.measure.Measure36604
cppncss.XmlResultOutput36803
cpptools.Usage34402
cpptools.preprocessor.PreProcessor31804
cppncss.AsciiResultOutput29803
cpptools.AbstractLogger29604
cpptools.preprocessor.Macro28402
cppncss.counter.CcnCounter27902
cppncss.AbstractResultOutput24605
cppncss.measure.AverageCollector19503
cppncss.measure.SumCollector19503
cppncss.counter.FunctionVisitor18602
cpptools.ConsoleLogger17402
cppncss.measure.Average16302
cppncss.counter.AbstractCounter15302
cppncss.ResultOutputAdapter14502
cppncss.counter.FileVisitor13302
cppncss.measure.Sum13302
cpptools.AntLogger11402
cpptools.preprocessor.Define8202
cpptools.FileObserverComposite7202

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
cppncss.counter.NcssCounter692302
cpptools.Analyzer1221322
cppncss.CppNcss871133
cppncss.CppNcssTask861145
cppncss.counter.CcnCounter27902
cppncss.AsciiResultOutput29803
cppncss.counter.FunctionNameExtractor69841
cppncss.XmlResultOutput36803
cpptools.preprocessor.PreProcessor31804
cppncss.measure.MeasureCollector44702
cpptools.Options43702
cpptools.preprocessor.AbstractTokenFilter50702
cppncss.AbstractResultOutput24605
cppncss.counter.FunctionVisitor18602
cppncss.measure.Measure36604
cppstyle.CppStyle37602
cpptools.AbstractLogger29604
cppncss.measure.AverageCollector19503
cppncss.measure.SumCollector19503
cppncss.ResultOutput6502
cppncss.ResultOutputAdapter14502
cpptools.EventHandler6506
cpptools.AntLogger11402
cpptools.ConsoleLogger17402
cpptools.preprocessor.Macro28402
cpptools.Usage34402
cppncss.counter.AbstractCounter15302
cppncss.counter.FileVisitor13302
cppncss.measure.Average16302
cppncss.measure.Sum13302

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
25.371,307.000.305.142.51

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
cppncss.CppNcssTask.buildArguments()1970
cppncss.counter.FunctionNameExtractor.Filter$1.decorate(Token)16120
cpptools.Analyzer.Analyzer(Options,ParserVisitor,FileObserver,EventHandler)1671
cppncss.CppNcss.usage()1510
cppstyle.CppStyle.usage()1410
cpptools.Usage.display()1320
cppncss.counter.FunctionNameExtractor.Filter$2.decorate(Token)1290
cppncss.measure.Measure.Measure(String,String,int,int)1171
cpptools.Analyzer.createProcessor(Options)1130
cpptools.Analyzer.resolve(List,String,boolean)1160
cpptools.Analyzer.process(ParserVisitor)1150
cpptools.Analyzer.process(ParserVisitor,String)1140
cpptools.preprocessor.AbstractTokenFilter.check(String)1170
cpptools.preprocessor.AbstractTokenFilter.copy(Token,Token)1110
cppncss.AbstractResultOutput.notify(String,String,int)1040
cppncss.measure.MeasureCollector.getThreshold(Options)1070
cpptools.Options.getOptionProperties(String)1040
cpptools.Options.getOptionPropertyValues(String)1040
cppncss.measure.MeasureCollector.notify(String,String,int,int)940
cppncss.XmlResultOutput.printHeaders(String,List)930
cpptools.Analyzer.sort(List)910
cpptools.preprocessor.Macro.process(Token)940
cpptools.preprocessor.Macro.erase()950
cppncss.CppNcss.CppNcss(Options,EventHandler)811
cppncss.CppNcss.create(Collector,String)880
cppncss.measure.Measure.compareTo(Object)851
cpptools.AbstractLogger.displayLocation(int,int,String)830
cpptools.preprocessor.AbstractTokenFilter.AbstractTokenFilter(Stack,String,String)851
cpptools.preprocessor.AbstractTokenFilter.parse(String)820
cppncss.AsciiResultOutput.printHeaders(String,List)730

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,307.003.992.000.27

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