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.maven.exceptions 6 49 608 27 420 109 156
de.smartics.maven.exceptions.sdoc 3 42 368 16 95 40 124
de.smartics.maven.exceptions.conf 6 73 306 77 495 70 147
de.smartics.maven.exceptions.runtime 4 20 176 19 138 37 51
de.smartics.maven.exceptions.util 3 16 140 19 161 37 48
de.smartics.maven.exceptions.report 3 15 113 6 21 33 65
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
25 215 1711 164 1330 326 591

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.maven.exceptions.sdoc.SdocCodeBuilder 191 20 0 3
de.smartics.maven.exceptions.AbstractSinkReportGenerator 170 12 0 4
de.smartics.maven.exceptions.conf.DefaultProjectConfiguration 163 19 1 38
de.smartics.maven.exceptions.AbstractSdocCodeMojo 106 12 0 6
de.smartics.maven.exceptions.ExceptionCodeReport 92 7 0 2
de.smartics.maven.exceptions.conf.DefaultProjectConfiguration.Builder 81 19 0 18
de.smartics.maven.exceptions.sdoc.TagInfo 79 16 0 11
de.smartics.maven.exceptions.conf.DefaultJavadocProjectConfiguration 76 10 1 22
de.smartics.maven.exceptions.AbstractElementReport 63 13 0 12
de.smartics.maven.exceptions.runtime.ProjectClassLoader 59 8 1 7
de.smartics.maven.exceptions.util.FileNameUtils 57 8 0 9
de.smartics.maven.exceptions.runtime.AbstractProjectClassLoader 56 5 0 6
de.smartics.maven.exceptions.util.FilterUtils 56 6 0 7
de.smartics.maven.exceptions.ExportSdocCodeMojo 39 3 0 1
de.smartics.maven.exceptions.conf.DefaultJavadocProjectConfiguration.Builder 38 10 0 10
de.smartics.maven.exceptions.sdoc.SdocCodeReportGenerator 38 6 0 2
de.smartics.maven.exceptions.report.ComponentCodeSortedSinkReportGenerator 36 5 0 2
de.smartics.maven.exceptions.report.CodeSortedSinkReportGenerator 32 5 0 2
de.smartics.maven.exceptions.runtime.RuntimeUtils 31 5 0 6
de.smartics.maven.exceptions.conf.ConfigUtils 30 6 0 7
de.smartics.maven.exceptions.report.PackageSortedSinkReportGenerator 16 5 0 2
de.smartics.maven.exceptions.CopySdocCodeMojo 12 2 0 2
de.smartics.maven.exceptions.util.TextCoder 12 2 0 3
de.smartics.maven.exceptions.conf.JavadocProjectConfiguration 10 9 0 10
de.smartics.maven.exceptions.runtime.ProjectClassLoader.Enumeration 9 2 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.maven.exceptions.sdoc.SdocCodeBuilder 191 20 0 3
de.smartics.maven.exceptions.conf.DefaultProjectConfiguration 163 19 1 38
de.smartics.maven.exceptions.conf.DefaultProjectConfiguration.Builder 81 19 0 18
de.smartics.maven.exceptions.sdoc.TagInfo 79 16 0 11
de.smartics.maven.exceptions.AbstractElementReport 63 13 0 12
de.smartics.maven.exceptions.AbstractSdocCodeMojo 106 12 0 6
de.smartics.maven.exceptions.AbstractSinkReportGenerator 170 12 0 4
de.smartics.maven.exceptions.conf.DefaultJavadocProjectConfiguration 76 10 1 22
de.smartics.maven.exceptions.conf.DefaultJavadocProjectConfiguration.Builder 38 10 0 10
de.smartics.maven.exceptions.conf.JavadocProjectConfiguration 10 9 0 10
de.smartics.maven.exceptions.runtime.ProjectClassLoader 59 8 1 7
de.smartics.maven.exceptions.util.FileNameUtils 57 8 0 9
de.smartics.maven.exceptions.ExceptionCodeReport 92 7 0 2
de.smartics.maven.exceptions.conf.ConfigUtils 30 6 0 7
de.smartics.maven.exceptions.sdoc.SdocCodeReportGenerator 38 6 0 2
de.smartics.maven.exceptions.util.FilterUtils 56 6 0 7
de.smartics.maven.exceptions.report.CodeSortedSinkReportGenerator 32 5 0 2
de.smartics.maven.exceptions.report.ComponentCodeSortedSinkReportGenerator 36 5 0 2
de.smartics.maven.exceptions.report.PackageSortedSinkReportGenerator 16 5 0 2
de.smartics.maven.exceptions.runtime.AbstractProjectClassLoader 56 5 0 6
de.smartics.maven.exceptions.runtime.RuntimeUtils 31 5 0 6
de.smartics.maven.exceptions.ExportSdocCodeMojo 39 3 0 1
de.smartics.maven.exceptions.CopySdocCodeMojo 12 2 0 2
de.smartics.maven.exceptions.runtime.ProjectClassLoader.Enumeration 9 2 0 0
de.smartics.maven.exceptions.util.TextCoder 12 2 0 3

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
62.08 1,711.00 0.12 8.60 7.68

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.maven.exceptions.AbstractSinkReportGenerator.renderPlaceholderInfo(Sink,ExceptionCodeReportItem,Sink) 43 9 0
de.smartics.maven.exceptions.ExceptionCodeReport.createProjectConfiguration(Locale) 32 2 0
de.smartics.maven.exceptions.AbstractSdocCodeMojo.createProjectConfiguration(Locale,File) 29 2 0
de.smartics.maven.exceptions.AbstractSinkReportGenerator.writeInfoHeader(Sink,Sink,String,ExceptionCodeReportItem) 29 4 1
de.smartics.maven.exceptions.AbstractSinkReportGenerator.writeReportElementInfo(Sink,Sink,ExceptionCodeReportItem) 26 2 0
de.smartics.maven.exceptions.AbstractSdocCodeMojo.execute() 24 8 1
de.smartics.maven.exceptions.AbstractSinkReportGenerator.writeContent(Sink,Sink,StoredExceptionCodesReport) 23 2 0
de.smartics.maven.exceptions.sdoc.SdocCodeBuilder.writeDocumentContent() 22 1 1
de.smartics.maven.exceptions.AbstractSinkReportGenerator.writeTableHeader(Sink,Sink) 21 1 1
de.smartics.maven.exceptions.runtime.AbstractProjectClassLoader.loadClassFromLibrary(String,String,File) 21 8 1
de.smartics.maven.exceptions.ExceptionCodeReport.executeReport(Locale) 20 8 0
de.smartics.maven.exceptions.conf.DefaultProjectConfiguration.DefaultProjectConfiguration(O) 18 3 1
de.smartics.maven.exceptions.ExportSdocCodeMojo.addMetaData() 18 3 0
de.smartics.maven.exceptions.sdoc.SdocCodeBuilder.addPlaceholder(MessageType,PlaceHolderInfo,ResourceBundle,Element,String) 18 6 0
de.smartics.maven.exceptions.AbstractElementReport.provideSink() 16 7 1
de.smartics.maven.exceptions.util.FileNameUtils.createPackageNames(Log,String,ScannerFactory) 16 8 1
de.smartics.maven.exceptions.conf.DefaultProjectConfiguration.Builder.checkConstraints() 15 4 1
de.smartics.maven.exceptions.runtime.ProjectClassLoader.findResource(String) 15 8 0
de.smartics.maven.exceptions.runtime.AbstractProjectClassLoader.loadClassFile(String,File) 14 5 1
de.smartics.maven.exceptions.sdoc.SdocCodeBuilder.replaceText(String,Element) 14 4 0
de.smartics.maven.exceptions.util.FilterUtils.isInterfaceDeclared(ClassDoc,Class) 14 8 1
de.smartics.maven.exceptions.ExportSdocCodeMojo.attachArtifact() 13 4 0
de.smartics.maven.exceptions.sdoc.SdocCodeBuilder.renderShortDescription(TagInfo,JavaField,Element) 13 6 0
de.smartics.maven.exceptions.sdoc.SdocCodeBuilder.addText(ExceptionCodeReportItem,ResourceBundle,Element,MessageType,String) 13 4 0
de.smartics.maven.exceptions.conf.DefaultProjectConfiguration.getJavadocRelativeDir() 12 4 1
de.smartics.maven.exceptions.report.ComponentCodeSortedSinkReportGenerator.getCodeTitle(String,ExceptionCodeReportItem) 12 3 0
de.smartics.maven.exceptions.sdoc.TagInfo.TagInfo(JavaClass,JavaField) 12 1 1
de.smartics.maven.exceptions.util.FileNameUtils.containsJavaFiles(String,String) 12 9 1
de.smartics.maven.exceptions.util.FilterUtils.isInterfaceDeclaredInExtendingInterfaces(Type,String) 12 6 1
de.smartics.maven.exceptions.AbstractSdocCodeMojo.createReportConfiguration(File) 11 2 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,711.00 6.00 2.26 0.65

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