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
de.smartics.testdoc.maven.export.sink 8 62 509 22 148 98 162
de.smartics.testdoc.maven 3 27 290 16 404 41 45
de.smartics.testdoc.maven.export.xml 2 15 149 13 81 24 39
de.smartics.testdoc.maven.export 2 21 99 15 96 23 59
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
15 125 1047 66 729 186 305

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.testdoc.maven.export.sink.SinkExporter 143 22 0 5
de.smartics.testdoc.maven.export.sink.RenderHelper 139 14 0 3
de.smartics.testdoc.maven.export.xml.XmlExporter 95 13 0 10
de.smartics.testdoc.maven.TestDocReportMojo 93 8 0 3
de.smartics.testdoc.maven.export.sink.TestDocPageRenderer 87 8 0 2
de.smartics.testdoc.maven.AbstractSourceReportMojo 77 7 0 2
de.smartics.testdoc.maven.export.AbstractReportExporter 56 18 0 11
de.smartics.testdoc.maven.AbstractReportMojo 55 12 0 11
de.smartics.testdoc.maven.export.sink.AbstractPageRenderer 34 6 0 3
de.smartics.testdoc.maven.export.xml.XmlOutputManager 21 2 0 3
de.smartics.testdoc.maven.export.AbstractOutputManager 17 3 0 4
de.smartics.testdoc.maven.export.sink.AbstractLinkRenderer 17 4 0 2
de.smartics.testdoc.maven.export.sink.ScenarioLinkRenderer 10 3 0 2
de.smartics.testdoc.maven.export.sink.UutLinkRenderer 9 3 0 2
de.smartics.testdoc.maven.export.sink.SinkOutputManager 6 2 0 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.testdoc.maven.export.sink.SinkExporter 143 22 0 5
de.smartics.testdoc.maven.export.AbstractReportExporter 56 18 0 11
de.smartics.testdoc.maven.export.sink.RenderHelper 139 14 0 3
de.smartics.testdoc.maven.export.xml.XmlExporter 95 13 0 10
de.smartics.testdoc.maven.AbstractReportMojo 55 12 0 11
de.smartics.testdoc.maven.export.sink.TestDocPageRenderer 87 8 0 2
de.smartics.testdoc.maven.TestDocReportMojo 93 8 0 3
de.smartics.testdoc.maven.AbstractSourceReportMojo 77 7 0 2
de.smartics.testdoc.maven.export.sink.AbstractPageRenderer 34 6 0 3
de.smartics.testdoc.maven.export.sink.AbstractLinkRenderer 17 4 0 2
de.smartics.testdoc.maven.export.AbstractOutputManager 17 3 0 4
de.smartics.testdoc.maven.export.sink.ScenarioLinkRenderer 10 3 0 2
de.smartics.testdoc.maven.export.sink.UutLinkRenderer 9 3 0 2
de.smartics.testdoc.maven.export.sink.SinkOutputManager 6 2 0 3
de.smartics.testdoc.maven.export.xml.XmlOutputManager 21 2 0 3

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
57.27 1,047.00 0.00 8.33 4.40

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.testdoc.maven.export.sink.RenderHelper.renderSectionTitle(int,String) 32 6 0
de.smartics.testdoc.maven.AbstractSourceReportMojo.createStrategy(String,File,boolean,String) 21 6 0
de.smartics.testdoc.maven.export.xml.XmlExporter.renderJUnitStatus(ScenarioTestDoc) 21 6 1
de.smartics.testdoc.maven.export.sink.RenderHelper.renderSectionStart(int) 20 6 0
de.smartics.testdoc.maven.export.sink.RenderHelper.renderSectionEnd(int) 20 6 0
de.smartics.testdoc.maven.export.sink.TestDocPageRenderer.renderIndexOfIndexes(ExportMultiIndex) 19 5 0
de.smartics.testdoc.maven.export.sink.TestDocPageRenderer.renderSections(UnitTestDoc,int) 19 4 0
de.smartics.testdoc.maven.export.AbstractReportExporter.export(UnitTestDoc,OutputStream) 18 5 1
de.smartics.testdoc.maven.export.sink.RenderHelper.normalizeKey(String) 18 7 1
de.smartics.testdoc.maven.export.sink.SinkExporter.renderJUnitStatus(ScenarioTestDoc) 18 5 0
de.smartics.testdoc.maven.export.sink.TestDocPageRenderer.renderSectionIndex(UnitTestDoc) 17 3 0
de.smartics.testdoc.maven.export.xml.XmlOutputManager.finish() 16 6 1
de.smartics.testdoc.maven.TestDocReportMojo.createExportIndices() 15 10 0
de.smartics.testdoc.maven.export.sink.SinkExporter.renderTestCase(ScenarioTestDoc) 13 4 0
de.smartics.testdoc.maven.TestDocReportMojo.exportXmlReport(ExportIndex,UnitTestDocIndex) 13 3 0
de.smartics.testdoc.maven.export.sink.RenderHelper.renderIndexTableStart() 12 1 0
de.smartics.testdoc.maven.export.sink.SinkExporter.renderJUnitStatusLink(ResultType,String) 12 2 0
de.smartics.testdoc.maven.export.sink.SinkExporter.renderCategories(ScenarioTestDoc) 12 5 0
de.smartics.testdoc.maven.export.xml.XmlExporter.renderReports(Type,ExternalReport,TestMethodDoc) 12 3 0
de.smartics.testdoc.maven.TestDocReportMojo.executeReport(Locale) 12 3 1
de.smartics.testdoc.maven.TestDocReportMojo.createReportConfig() 12 1 0
de.smartics.testdoc.maven.AbstractSourceReportMojo.executeReport(Locale) 10 2 1
de.smartics.testdoc.maven.export.xml.XmlExporter.renderTestCase(ScenarioTestDoc) 10 3 1
de.smartics.testdoc.maven.export.sink.AbstractLinkRenderer.renderTestMethodLink(ExternalReport) 9 2 0
de.smartics.testdoc.maven.export.sink.RenderHelper.renderIndexRow(int,String,String) 9 1 0
de.smartics.testdoc.maven.export.sink.SinkExporter.renderTableStart(ScenarioTestDoc) 9 1 0
de.smartics.testdoc.maven.export.sink.SinkExporter.renderTestDocTypeStart(UnitTestDoc) 9 1 0
de.smartics.testdoc.maven.export.sink.TestDocPageRenderer.renderTestDocs(UnitTestDoc) 9 2 0
de.smartics.testdoc.maven.export.xml.XmlExporter.renderCategories(ScenarioTestDoc) 9 5 1
de.smartics.testdoc.maven.TestDocReportMojo.exportIndex(Locale) 9 7 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,047.00 6.18 2.14 0.41

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