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.core.doc 10 93 522 83 554 108 315
de.smartics.testdoc.collect.extractor 11 60 387 39 275 110 201
de.smartics.testdoc.core.adapter 18 59 350 62 348 176 313
de.smartics.testdoc.collect.processor 4 23 216 9 65 55 96
de.smartics.testdoc.core.export 9 34 203 34 224 90 189
de.smartics.testdoc.collect.generator 4 19 128 16 158 11 67
de.smartics.testdoc.core.source 4 10 70 11 58 42 91
de.smartics.testdoc.core.doc.names 3 5 32 8 44 30 66
de.smartics.testdoc.core 2 9 28 2 12 19 134
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
65 312 1936 264 1738 641 1472

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.testdoc.collect.generator.TestDocGenerator 102 5 2 16
de.smartics.testdoc.core.doc.UnitTestDoc 87 19 0 17
de.smartics.testdoc.core.doc.UnitTestDocIndex 79 13 0 11
de.smartics.testdoc.collect.processor.TestDocProcessor 77 9 0 3
de.smartics.testdoc.core.doc.ScenarioTestDoc 72 17 0 17
de.smartics.testdoc.collect.generator.TestDocGenerator.Config 61 4 1 10
de.smartics.testdoc.core.doc.FileHelper 61 11 0 3
de.smartics.testdoc.collect.processor.UutProcess 57 6 0 2
de.smartics.testdoc.core.doc.Type 54 9 0 8
de.smartics.testdoc.core.export.XmlDocumentBuilder 54 8 0 2
de.smartics.testdoc.collect.extractor.TestDocHintsExtractor 53 5 1 8
de.smartics.testdoc.core.doc.SortKey 51 9 0 9
de.smartics.testdoc.core.doc.TestMethodDoc 50 10 0 10
de.smartics.testdoc.collect.extractor.AbstractExtractor 49 9 0 3
de.smartics.testdoc.collect.extractor.TestDocAnnotationExtractor 48 7 1 8
de.smartics.testdoc.core.adapter.AbstractFileBasedExportAdapter 46 7 1 5
de.smartics.testdoc.core.adapter.PersistenceUtils 43 7 0 7
de.smartics.testdoc.collect.extractor.TestDocVariableExtractor 40 7 0 3
de.smartics.testdoc.collect.extractor.TestDocMethodExtractor 34 6 0 3
de.smartics.testdoc.core.export.XmlExporter 32 6 0 6
de.smartics.testdoc.collect.generator.TestDocGenerator.Config.Builder 31 9 0 8
de.smartics.testdoc.core.adapter.JmxExportAdapterClient 29 7 0 5
de.smartics.testdoc.collect.extractor.CategoryExtractor 26 4 0 2
de.smartics.testdoc.core.source.SunSourceCodeHelper 25 4 0 3
de.smartics.testdoc.core.adapter.FilerExportAdapter 24 4 0 2
de.smartics.testdoc.collect.extractor.ExtractorConfig 22 5 0 5
de.smartics.testdoc.collect.extractor.TestDocHintsExtractor.Hints 22 7 0 5
de.smartics.testdoc.collect.extractor.TestDocTypeExtractor 21 3 0 3
de.smartics.testdoc.core.source.SourceCodeHelperFactory 19 3 0 3
de.smartics.testdoc.collect.processor.AnnotationLogHelper 18 5 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.testdoc.core.doc.UnitTestDoc 87 19 0 17
de.smartics.testdoc.core.doc.ScenarioTestDoc 72 17 0 17
de.smartics.testdoc.core.doc.UnitTestDocIndex 79 13 0 11
de.smartics.testdoc.core.doc.FileHelper 61 11 0 3
de.smartics.testdoc.core.doc.TestMethodDoc 50 10 0 10
de.smartics.testdoc.collect.extractor.AbstractExtractor 49 9 0 3
de.smartics.testdoc.collect.generator.TestDocGenerator.Config.Builder 31 9 0 8
de.smartics.testdoc.collect.processor.TestDocProcessor 77 9 0 3
de.smartics.testdoc.core.doc.SortKey 51 9 0 9
de.smartics.testdoc.core.doc.Type 54 9 0 8
de.smartics.testdoc.core.export.XmlDocumentBuilder 54 8 0 2
de.smartics.testdoc.core.TestDocProperty 17 8 0 0
de.smartics.testdoc.collect.extractor.TestDocAnnotationExtractor 48 7 1 8
de.smartics.testdoc.collect.extractor.TestDocHintsExtractor.Hints 22 7 0 5
de.smartics.testdoc.collect.extractor.TestDocVariableExtractor 40 7 0 3
de.smartics.testdoc.core.adapter.AbstractFileBasedExportAdapter 46 7 1 5
de.smartics.testdoc.core.adapter.JmxExportAdapterClient 29 7 0 5
de.smartics.testdoc.core.adapter.PersistenceUtils 43 7 0 7
de.smartics.testdoc.collect.extractor.TestDocMethodExtractor 34 6 0 3
de.smartics.testdoc.collect.processor.UutProcess 57 6 0 2
de.smartics.testdoc.core.export.XmlExporter 32 6 0 6
de.smartics.testdoc.collect.extractor.ExtractorConfig 22 5 0 5
de.smartics.testdoc.collect.extractor.TestDocHintsExtractor 53 5 1 8
de.smartics.testdoc.collect.generator.TestDocGenerator 102 5 2 16
de.smartics.testdoc.collect.processor.AnnotationLogHelper 18 5 0 2
de.smartics.testdoc.core.adapter.AbstractInMemoryExportAdapter 13 5 0 6
de.smartics.testdoc.core.export.AbstractOutputManager 12 5 0 6
de.smartics.testdoc.collect.extractor.CategoryExtractor 26 4 0 2
de.smartics.testdoc.collect.extractor.TestDocAnnotationExtractor.UutInfo 11 4 0 4
de.smartics.testdoc.collect.generator.TestDocGenerator.Config 61 4 1 10

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
25.57 1,936.00 0.11 4.80 4.49

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.testdoc.collect.processor.UutProcess.processElements(RoundEnvironment,TypeElement) 20 6 0
de.smartics.testdoc.collect.processor.TestDocProcessor.initExporter(String) 16 5 0
de.smartics.testdoc.core.doc.FileHelper.provideFile(File) 15 8 0
de.smartics.testdoc.collect.extractor.TestDocAnnotationExtractor.addInfo(UutInfo,AnnotationValue) 14 6 0
de.smartics.testdoc.core.adapter.AbstractFileBasedExportAdapter.export(UnitTestDoc) 13 5 1
de.smartics.testdoc.core.doc.Type.compareTo(Type) 13 5 1
de.smartics.testdoc.core.doc.UnitTestDocIndex.registerByTestCase(UnitTestDoc) 13 5 1
de.smartics.testdoc.collect.extractor.TestDocVariableExtractor.initTypeElement(VariableElement) 12 7 0
de.smartics.testdoc.collect.processor.TestDocProcessor.init(ProcessingEnvironment) 12 1 1
de.smartics.testdoc.core.doc.ScenarioTestDoc.toString() 12 4 1
de.smartics.testdoc.core.doc.UnitTestDoc.getSortedScenarios() 12 3 0
de.smartics.testdoc.core.doc.UnitTestDocIndex.register(UnitTestDoc) 12 2 1
de.smartics.testdoc.core.source.SunSourceCodeHelper.getSourceCodeLocation(Element) 12 3 1
de.smartics.testdoc.core.adapter.PersistenceUtils.deserialize(InputStream) 11 6 1
de.smartics.testdoc.core.doc.names.EnglishTestNameUtils.calculateTestNameSentence(String) 11 4 1
de.smartics.testdoc.core.doc.SortKey.compare(String,String) 11 10 0
de.smartics.testdoc.core.export.XmlDocumentBuilder.createScenarioElement(ScenarioTestDoc) 11 1 0
de.smartics.testdoc.collect.extractor.TestDocHintsExtractor.addHint(Hints,AnnotationValue) 10 5 0
de.smartics.testdoc.collect.extractor.TestDocTypeExtractor.calcScenarios(UutInfo) 10 4 0
de.smartics.testdoc.core.adapter.AbstractFileBasedExportAdapter.calcTestCaseType(UnitTestDoc) 10 6 1
de.smartics.testdoc.core.adapter.AbstractFileBasedExportAdapter.clear(Type) 10 6 1
de.smartics.testdoc.core.doc.Type.Type(String) 10 2 1
de.smartics.testdoc.collect.extractor.AbstractExtractor.createScenarioIfElementIsTestMethod(UutInfo,String,ExecutableElement) 9 1 0
de.smartics.testdoc.collect.extractor.CategoryExtractor.addCategories(String,AnnotationValue) 9 5 0
de.smartics.testdoc.collect.extractor.TestDocMethodExtractor.initTypeElement(ExecutableElement) 9 5 0
de.smartics.testdoc.collect.extractor.TestDocVariableExtractor.calcScenarios(UutInfo,String) 9 4 0
de.smartics.testdoc.collect.generator.TestDocGenerator.generate() 9 5 1
de.smartics.testdoc.core.adapter.JmxExportAdapterClient.createAndRegisterMBeanToPlatformServer() 9 4 0
de.smartics.testdoc.core.doc.FileHelper.createDirectoryRef(Type) 9 2 0
de.smartics.testdoc.core.doc.ScenarioTestDoc.checkArguments(String,Type,TestMethodDoc,SortKey) 9 10 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,936.00 4.33 2.07 0.64

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