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
net.sf.mavenhist.extractor 9 21 158 28 126 0 9
net.sf.mavenhist.extractor.surefire 7 17 93 20 69 3 0
net.sf.mavenhist.extractor.jncss 8 16 66 24 72 0 0
net.sf.mavenhist.extractor.checkstyle 7 13 48 20 68 0 0
net.sf.mavenhist.extractor.util 3 6 46 8 35 1 0
net.sf.mavenhist.extractor.junit 5 9 29 14 42 0 0
net.sf.mavenhist.extractor.cobertura 4 7 23 11 35 0 0
net.sf.mavenhist.extractor.findbugs 3 6 21 9 27 0 0
net.sf.mavenhist.extractor.pmd 3 5 17 8 24 0 0
net.sf.mavenhist.extractor.cpd 2 3 11 5 15 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
51 103 512 147 513 4 9

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
net.sf.mavenhist.extractor.ExtractorFactory 46 5 0 6
net.sf.mavenhist.extractor.surefire.AbstractTestExtractor 43 4 0 4
net.sf.mavenhist.extractor.AbstractXPathValueExtractor 22 4 0 5
net.sf.mavenhist.extractor.jncss.JNCSSFunctionsPerPackageExtractor 17 3 0 4
net.sf.mavenhist.extractor.util.MultimetricArrayToStringUtil 14 2 0 3
net.sf.mavenhist.extractor.AbstractValidatingXMLValueExtractor 13 4 0 5
net.sf.mavenhist.extractor.checkstyle.AbstractCheckstyleViolationExtractor 12 2 0 3
net.sf.mavenhist.extractor.surefire.TestTimeExtractor 11 3 0 3
net.sf.mavenhist.extractor.MultiMetric 10 3 0 4
net.sf.mavenhist.extractor.util.DocumentReader 10 3 0 3
net.sf.mavenhist.extractor.findbugs.FindbugsViolationsExtractor 9 3 0 4
net.sf.mavenhist.extractor.AbstractXMLValueExtractor 5 1 0 0
net.sf.mavenhist.extractor.checkstyle.CheckstyleAllExtractor 5 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleCheckedFilesExtractor 5 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleErrorExtractor 5 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleInfoExtractor 5 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleWarningExtractor 5 2 0 3
net.sf.mavenhist.extractor.cobertura.CoberturaBranchPercentageExtractor 5 2 0 3
net.sf.mavenhist.extractor.cobertura.CoberturaLinesOfCodeExtractor 5 2 0 3
net.sf.mavenhist.extractor.cobertura.CoberturaLinesPercentageExtractor 5 2 0 3
net.sf.mavenhist.extractor.cpd.CPDDuplicatedLinesExtractor 5 2 0 3
net.sf.mavenhist.extractor.findbugs.FindbugsViolationFilesExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSCCNExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSClassesExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSFunctionsExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSJavadocsExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSNCSSExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSPackagesExtractor 5 2 0 3
net.sf.mavenhist.extractor.junit.JUnitErrorsExtractor 5 2 0 3
net.sf.mavenhist.extractor.junit.JUnitFailuresExtractor 5 2 0 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
net.sf.mavenhist.extractor.ExtractorFactory 46 5 0 6
net.sf.mavenhist.extractor.AbstractValidatingXMLValueExtractor 13 4 0 5
net.sf.mavenhist.extractor.AbstractXPathValueExtractor 22 4 0 5
net.sf.mavenhist.extractor.surefire.AbstractTestExtractor 43 4 0 4
net.sf.mavenhist.extractor.MultiMetric 10 3 0 4
net.sf.mavenhist.extractor.findbugs.FindbugsViolationsExtractor 9 3 0 4
net.sf.mavenhist.extractor.jncss.JNCSSFunctionsPerPackageExtractor 17 3 0 4
net.sf.mavenhist.extractor.surefire.TestTimeExtractor 11 3 0 3
net.sf.mavenhist.extractor.util.DocumentReader 10 3 0 3
net.sf.mavenhist.extractor.checkstyle.AbstractCheckstyleViolationExtractor 12 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleAllExtractor 5 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleCheckedFilesExtractor 5 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleErrorExtractor 5 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleInfoExtractor 5 2 0 3
net.sf.mavenhist.extractor.checkstyle.CheckstyleWarningExtractor 5 2 0 3
net.sf.mavenhist.extractor.cobertura.CoberturaBranchPercentageExtractor 5 2 0 3
net.sf.mavenhist.extractor.cobertura.CoberturaLinesOfCodeExtractor 5 2 0 3
net.sf.mavenhist.extractor.cobertura.CoberturaLinesPercentageExtractor 5 2 0 3
net.sf.mavenhist.extractor.cpd.CPDDuplicatedLinesExtractor 5 2 0 3
net.sf.mavenhist.extractor.findbugs.FindbugsViolationFilesExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSCCNExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSClassesExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSFunctionsExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSJavadocsExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSNCSSExtractor 5 2 0 3
net.sf.mavenhist.extractor.jncss.JNCSSPackagesExtractor 5 2 0 3
net.sf.mavenhist.extractor.junit.JUnitErrorsExtractor 5 2 0 3
net.sf.mavenhist.extractor.junit.JUnitFailuresExtractor 5 2 0 3
net.sf.mavenhist.extractor.junit.JUnitPassrateExtractor 5 2 0 3
net.sf.mavenhist.extractor.junit.JUnitTestsExtractor 5 2 0 3

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
7.47 512.00 0.00 2.02 2.88

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
net.sf.mavenhist.extractor.ExtractorFactory.initialize() 32 1 1
net.sf.mavenhist.extractor.surefire.AbstractTestExtractor.extract(InputStream) 26 14 1
net.sf.mavenhist.extractor.jncss.JNCSSFunctionsPerPackageExtractor.extractValidatedDocument(Document) 12 2 1
net.sf.mavenhist.extractor.util.MultimetricArrayToStringUtil.toString(MultiMetric[]) 12 4 1
net.sf.mavenhist.extractor.AbstractXPathValueExtractor.getVersion(Document) 10 6 1
net.sf.mavenhist.extractor.checkstyle.AbstractCheckstyleViolationExtractor.getXPath(String) 10 2 1
net.sf.mavenhist.extractor.surefire.AbstractTestExtractor.getString(InputStream) 9 3 1
net.sf.mavenhist.extractor.AbstractXPathValueExtractor.extractValidatedDocument(Document) 8 3 1
net.sf.mavenhist.extractor.AbstractValidatingXMLValueExtractor.extract(Document) 7 6 1
net.sf.mavenhist.extractor.surefire.TestTimeExtractor.reformatValue(String) 6 2 0
net.sf.mavenhist.extractor.util.DocumentReader.getParsedDoc(InputStream) 6 1 1
net.sf.mavenhist.extractor.ExtractorFactory.getInstance() 5 2 1
net.sf.mavenhist.extractor.AbstractXMLValueExtractor.extract(InputStream) 4 4 0
net.sf.mavenhist.extractor.findbugs.FindbugsViolationsExtractor.getXPath(String) 4 3 1
net.sf.mavenhist.extractor.AbstractValidatingXMLValueExtractor.isDocumentValid(Document,String) 3 1 1
net.sf.mavenhist.extractor.MultiMetric.MultiMetric(String,String) 3 1 1
net.sf.mavenhist.extractor.surefire.AbstractTestExtractor.AbstractTestExtractor(int,int) 3 1 0
net.sf.mavenhist.extractor.util.RemoveDTDLookupResolver.resolveEntity(String,String) 3 1 1
net.sf.mavenhist.extractor.AbstractXPathValueExtractor.getVersionXPath() 2 1 1
net.sf.mavenhist.extractor.ExtractionException.ExtractionException(String,Throwable) 2 1 1
net.sf.mavenhist.extractor.ExtractorFactory.getValueExtractor(String) 2 1 1
net.sf.mavenhist.extractor.ExtractorFactory.putInMap(INamedExtractor) 2 1 1
net.sf.mavenhist.extractor.ExtractorFactory.getAllExtractors() 2 1 1
net.sf.mavenhist.extractor.MultiMetric.getLocation() 2 1 1
net.sf.mavenhist.extractor.MultiMetric.getValue() 2 1 1
net.sf.mavenhist.extractor.checkstyle.AbstractCheckstyleSingleValueExtractor.getValidityTestXPath() 2 1 1
net.sf.mavenhist.extractor.checkstyle.CheckstyleAllExtractor.getSeverity() 2 1 1
net.sf.mavenhist.extractor.checkstyle.CheckstyleAllExtractor.getName() 2 1 1
net.sf.mavenhist.extractor.checkstyle.CheckstyleCheckedFilesExtractor.getXPath(String) 2 1 1
net.sf.mavenhist.extractor.checkstyle.CheckstyleCheckedFilesExtractor.getName() 2 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
512.00 3.15 1.38 0.94

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