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.report.export.doc 9 69 359 66 466 97 274
de.smartics.testdoc.report.index 6 41 158 45 241 61 185
de.smartics.testdoc.report.junit 6 23 134 23 136 63 177
de.smartics.testdoc.report.resource 6 22 123 25 156 64 123
de.smartics.testdoc.report.export.doc.link.strategy 0 0 1 0 0 0 21
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
27 155 775 159 999 285 780

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.testdoc.report.export.doc.SelectionFilter 66 9 0 9
de.smartics.testdoc.report.export.doc.IndexProvider 57 9 0 4
de.smartics.testdoc.report.export.doc.ExternalReportReferences 49 11 1 12
de.smartics.testdoc.report.export.doc.InformationFilter 41 6 1 14
de.smartics.testdoc.report.index.StaticSection 35 11 0 11
de.smartics.testdoc.report.export.doc.ImageHelper 33 5 0 5
de.smartics.testdoc.report.junit.DirectoryJUnitTestCaseManager 32 6 0 5
de.smartics.testdoc.report.index.UutPackageIndex 31 6 0 6
de.smartics.testdoc.report.resource.AbstractClassPathCategoryResourceProvider 31 4 0 3
de.smartics.testdoc.report.export.doc.TestDocHelper 30 12 0 13
de.smartics.testdoc.report.junit.JUnitXmlReportParser 30 4 0 3
de.smartics.testdoc.report.resource.CategoryResource 30 7 0 8
de.smartics.testdoc.report.export.doc.ReportConfig 28 8 0 9
de.smartics.testdoc.report.index.ExportMultiIndex 26 7 0 8
de.smartics.testdoc.report.resource.CategoryResourceLoader 23 5 0 6
de.smartics.testdoc.report.junit.JUnitTestMethodDoc 22 6 1 7
de.smartics.testdoc.report.export.doc.InformationFilter.Builder 18 6 0 6
de.smartics.testdoc.report.index.UutNameIndex 18 5 0 6
de.smartics.testdoc.report.resource.IconNotFoundException 12 4 0 4
de.smartics.testdoc.report.junit.JUnitTestCaseDoc 10 3 0 2
de.smartics.testdoc.report.index.Section 9 8 0 9
de.smartics.testdoc.report.export.doc.ExternalReportReferences.ExternalReportReferences 6 3 0 0
de.smartics.testdoc.report.index.ExportIndex 5 4 0 5
de.smartics.testdoc.report.junit.JUnitTestCaseManager 4 3 0 4
de.smartics.testdoc.report.junit.TestCaseReportException 4 1 0 2
de.smartics.testdoc.report.resource.DefaultCategoryResourceProvider 3 1 0 2
de.smartics.testdoc.report.resource.CategoryResourceProvider 2 1 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.testdoc.report.export.doc.TestDocHelper 30 12 0 13
de.smartics.testdoc.report.export.doc.ExternalReportReferences 49 11 1 12
de.smartics.testdoc.report.index.StaticSection 35 11 0 11
de.smartics.testdoc.report.export.doc.IndexProvider 57 9 0 4
de.smartics.testdoc.report.export.doc.SelectionFilter 66 9 0 9
de.smartics.testdoc.report.export.doc.ReportConfig 28 8 0 9
de.smartics.testdoc.report.index.Section 9 8 0 9
de.smartics.testdoc.report.index.ExportMultiIndex 26 7 0 8
de.smartics.testdoc.report.resource.CategoryResource 30 7 0 8
de.smartics.testdoc.report.export.doc.InformationFilter 41 6 1 14
de.smartics.testdoc.report.export.doc.InformationFilter.Builder 18 6 0 6
de.smartics.testdoc.report.index.UutPackageIndex 31 6 0 6
de.smartics.testdoc.report.junit.DirectoryJUnitTestCaseManager 32 6 0 5
de.smartics.testdoc.report.junit.JUnitTestMethodDoc 22 6 1 7
de.smartics.testdoc.report.export.doc.ImageHelper 33 5 0 5
de.smartics.testdoc.report.index.UutNameIndex 18 5 0 6
de.smartics.testdoc.report.resource.CategoryResourceLoader 23 5 0 6
de.smartics.testdoc.report.index.ExportIndex 5 4 0 5
de.smartics.testdoc.report.junit.JUnitXmlReportParser 30 4 0 3
de.smartics.testdoc.report.resource.AbstractClassPathCategoryResourceProvider 31 4 0 3
de.smartics.testdoc.report.resource.IconNotFoundException 12 4 0 4
de.smartics.testdoc.report.export.doc.ExternalReportReferences.ExternalReportReferences 6 3 0 0
de.smartics.testdoc.report.junit.JUnitTestCaseDoc 10 3 0 2
de.smartics.testdoc.report.junit.JUnitTestCaseManager 4 3 0 4
de.smartics.testdoc.report.junit.TestCaseReportException 4 1 0 2
de.smartics.testdoc.report.resource.CategoryResourceProvider 2 1 0 2
de.smartics.testdoc.report.resource.DefaultCategoryResourceProvider 3 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
24.26 775.00 0.11 5.74 6.11

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.testdoc.report.export.doc.IndexProvider.readIndex() 16 8 0
de.smartics.testdoc.report.junit.DirectoryJUnitTestCaseManager.readTestCase(Type) 16 8 1
de.smartics.testdoc.report.export.doc.IndexProvider.readIndex(JmxExportAdapterMBean) 14 9 0
de.smartics.testdoc.report.export.doc.SelectionFilter.provideCategories(String) 11 7 1
de.smartics.testdoc.report.export.doc.SelectionFilter.acceptCategory(String) 11 8 1
de.smartics.testdoc.report.junit.JUnitXmlReportParser.getResultType(Element) 11 7 0
de.smartics.testdoc.report.resource.AbstractClassPathCategoryResourceProvider.calcIconLocation(ResourceBundle,String) 11 6 0
de.smartics.testdoc.report.export.doc.ExternalReportReferences.registerReport(boolean,ReportId,LinkConstructorStrategy) 10 7 1
de.smartics.testdoc.report.export.doc.SelectionFilter.filterCategories(String) 10 8 1
de.smartics.testdoc.report.index.UutPackageIndex.getSection() 10 3 1
de.smartics.testdoc.report.export.doc.ImageHelper.ImageHelper(String) 9 5 1
de.smartics.testdoc.report.resource.AbstractClassPathCategoryResourceProvider.getResource(Locale,Class) 9 3 1
de.smartics.testdoc.report.junit.JUnitXmlReportParser.read(InputStream) 8 2 1
de.smartics.testdoc.report.resource.CategoryResource.equals(Object) 8 7 1
de.smartics.testdoc.report.resource.CategoryResourceLoader.getResource(Locale,Class) 8 5 1
de.smartics.testdoc.report.export.doc.ImageHelper.addLink(String,String) 7 2 1
de.smartics.testdoc.report.export.doc.ReportConfig.ReportConfig(SelectionFilter,InformationFilter,JUnitTestCaseManager,ImageHelper,ExternalReportReferences,UnitTestDoc) 7 1 1
de.smartics.testdoc.report.export.doc.SelectionFilter.filterScenarios(ScenarioTestDoc) 7 3 1
de.smartics.testdoc.report.export.doc.SelectionFilter.acceptsAllOf(String) 7 6 1
de.smartics.testdoc.report.export.doc.SelectionFilter.acceptIncludes(Class) 7 6 0
de.smartics.testdoc.report.junit.JUnitXmlReportParser.createTestCase(Element) 7 1 0
de.smartics.testdoc.report.resource.CategoryResourceLoader.getResource(Locale,String) 7 4 1
de.smartics.testdoc.report.export.doc.InformationFilter.InformationFilter(Builder) 6 1 1
de.smartics.testdoc.report.index.ExportMultiIndex.getSection() 6 2 1
de.smartics.testdoc.report.index.ExportMultiIndex.isEmpty() 6 4 1
de.smartics.testdoc.report.index.StaticSection.isEmpty() 6 5 1
de.smartics.testdoc.report.index.UutPackageIndex.addToIndex(UnitTestDoc) 6 1 1
de.smartics.testdoc.report.index.UutPackageIndex.getNameIndex(String) 6 2 0
de.smartics.testdoc.report.export.doc.ExternalReportReferences.getReports(ReportId) 5 2 1
de.smartics.testdoc.report.export.doc.ImageHelper.initLinks() 5 1 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
775.00 3.42 1.83 0.86

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