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.plugin.buildmetadata 8 69 662 50 906 123 185
de.smartics.maven.plugin.buildmetadata.data 8 53 379 43 464 89 166
de.smartics.maven.plugin.buildmetadata.common 9 46 348 53 429 97 593
de.smartics.maven.plugin.buildmetadata.io 3 29 323 13 99 34 151
de.smartics.maven.plugin.buildmetadata.scm.maven 5 54 308 51 364 57 144
de.smartics.maven.plugin.buildmetadata.maven 1 8 58 5 30 11 52
de.smartics.maven.plugin.buildmetadata.scm 5 13 41 17 117 49 114
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
39 272 2119 232 2409 460 1405

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.maven.plugin.buildmetadata.BuildReportRenderer 184 19 0 7
de.smartics.maven.plugin.buildmetadata.io.SdocBuilder 168 18 0 3
de.smartics.maven.plugin.buildmetadata.BuildMetaDataMojo 150 14 0 7
de.smartics.maven.plugin.buildmetadata.data.MavenMetaDataProvider 128 15 0 4
de.smartics.maven.plugin.buildmetadata.common.Constant 118 7 1 10
de.smartics.maven.plugin.buildmetadata.scm.maven.MavenScmRevisionNumberFetcher 94 9 0 7
de.smartics.maven.plugin.buildmetadata.scm.maven.ScmConnectionInfo 74 20 0 18
de.smartics.maven.plugin.buildmetadata.scm.maven.ScmAccessInfo 66 18 0 17
de.smartics.maven.plugin.buildmetadata.data.MetaDataProviderBuilder 59 8 0 3
de.smartics.maven.plugin.buildmetadata.data.ScmMetaDataProvider 59 6 0 7
de.smartics.maven.plugin.buildmetadata.AbstractReportMojo 59 11 0 11
de.smartics.maven.plugin.buildmetadata.maven.MavenPropertyHelper 52 8 0 5
de.smartics.maven.plugin.buildmetadata.io.BuildXmlFileHelper 49 6 0 4
de.smartics.maven.plugin.buildmetadata.data.MavenMetaDataSelection 46 18 0 19
de.smartics.maven.plugin.buildmetadata.io.BuildPropertiesFileHelper 45 5 0 6
de.smartics.maven.plugin.buildmetadata.common.RevisionHelper 44 3 0 4
de.smartics.maven.plugin.buildmetadata.PropertyOutputFileMapper 39 3 0 2
de.smartics.maven.plugin.buildmetadata.BuildPointMojo 38 4 0 2
de.smartics.maven.plugin.buildmetadata.common.ScmInfo 38 10 0 11
de.smartics.maven.plugin.buildmetadata.AbstractBuildMojo 36 7 0 8
de.smartics.maven.plugin.buildmetadata.common.ScmCredentials 31 6 0 7
de.smartics.maven.plugin.buildmetadata.BuildReportMojo 30 7 0 8
de.smartics.maven.plugin.buildmetadata.common.ScmControl 26 7 0 8
de.smartics.maven.plugin.buildmetadata.common.Property 16 5 0 6
de.smartics.maven.plugin.buildmetadata.common.MojoUtils 15 3 0 4
de.smartics.maven.plugin.buildmetadata.scm.LocallyModifiedInfo 14 4 0 4
de.smartics.maven.plugin.buildmetadata.common.SortedProperties 13 2 0 3
de.smartics.maven.plugin.buildmetadata.scm.maven.StringRevision 13 4 0 5
de.smartics.maven.plugin.buildmetadata.FileMapping 11 4 0 5
de.smartics.maven.plugin.buildmetadata.common.Constant.Section 10 3 0 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.maven.plugin.buildmetadata.scm.maven.ScmConnectionInfo 74 20 0 18
de.smartics.maven.plugin.buildmetadata.BuildReportRenderer 184 19 0 7
de.smartics.maven.plugin.buildmetadata.io.SdocBuilder 168 18 0 3
de.smartics.maven.plugin.buildmetadata.scm.maven.ScmAccessInfo 66 18 0 17
de.smartics.maven.plugin.buildmetadata.data.MavenMetaDataSelection 46 18 0 19
de.smartics.maven.plugin.buildmetadata.data.MavenMetaDataProvider 128 15 0 4
de.smartics.maven.plugin.buildmetadata.BuildMetaDataMojo 150 14 0 7
de.smartics.maven.plugin.buildmetadata.AbstractReportMojo 59 11 0 11
de.smartics.maven.plugin.buildmetadata.common.ScmInfo 38 10 0 11
de.smartics.maven.plugin.buildmetadata.scm.maven.MavenScmRevisionNumberFetcher 94 9 0 7
de.smartics.maven.plugin.buildmetadata.maven.MavenPropertyHelper 52 8 0 5
de.smartics.maven.plugin.buildmetadata.data.MetaDataProviderBuilder 59 8 0 3
de.smartics.maven.plugin.buildmetadata.common.ScmControl 26 7 0 8
de.smartics.maven.plugin.buildmetadata.common.Constant 118 7 1 10
de.smartics.maven.plugin.buildmetadata.BuildReportMojo 30 7 0 8
de.smartics.maven.plugin.buildmetadata.AbstractBuildMojo 36 7 0 8
de.smartics.maven.plugin.buildmetadata.io.BuildXmlFileHelper 49 6 0 4
de.smartics.maven.plugin.buildmetadata.common.ScmCredentials 31 6 0 7
de.smartics.maven.plugin.buildmetadata.data.ScmMetaDataProvider 59 6 0 7
de.smartics.maven.plugin.buildmetadata.io.BuildPropertiesFileHelper 45 5 0 6
de.smartics.maven.plugin.buildmetadata.common.Property 16 5 0 6
de.smartics.maven.plugin.buildmetadata.BuildPointMojo 38 4 0 2
de.smartics.maven.plugin.buildmetadata.FileMapping 11 4 0 5
de.smartics.maven.plugin.buildmetadata.scm.maven.StringRevision 13 4 0 5
de.smartics.maven.plugin.buildmetadata.scm.LocallyModifiedInfo 14 4 0 4
de.smartics.maven.plugin.buildmetadata.PropertyOutputFileMapper 39 3 0 2
de.smartics.maven.plugin.buildmetadata.common.MojoUtils 15 3 0 4
de.smartics.maven.plugin.buildmetadata.common.RevisionHelper 44 3 0 4
de.smartics.maven.plugin.buildmetadata.common.Constant.Section 10 3 0 3
de.smartics.maven.plugin.buildmetadata.scm.ScmException 8 3 0 4

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
45.62 2,119.00 0.03 6.97 6.03

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.maven.plugin.buildmetadata.scm.maven.MavenScmRevisionNumberFetcher.findEndVersion(ChangeLogSet) 28 13 1
de.smartics.maven.plugin.buildmetadata.PropertyOutputFileMapper.initPropertyOutputFileMapping() 26 3 0
de.smartics.maven.plugin.buildmetadata.BuildReportRenderer.renderCell(Properties,String) 24 6 1
de.smartics.maven.plugin.buildmetadata.BuildMetaDataMojo.execute() 23 4 1
de.smartics.maven.plugin.buildmetadata.AbstractReportMojo.provideSink() 20 7 1
de.smartics.maven.plugin.buildmetadata.BuildMetaDataMojo.createFullVersion(Properties,Date) 19 7 1
de.smartics.maven.plugin.buildmetadata.data.MavenMetaDataProvider.provideSelectedProperties(Properties,Property) 19 6 0
de.smartics.maven.plugin.buildmetadata.io.BuildXmlFileHelper.writeContent(Properties,File) 18 9 0
de.smartics.maven.plugin.buildmetadata.io.BuildPropertiesFileHelper.writePropertiesFile(Properties) 18 6 1
de.smartics.maven.plugin.buildmetadata.common.RevisionHelper.provideScmBuildInfo(Properties,ScmControl) 18 5 1
de.smartics.maven.plugin.buildmetadata.data.MavenMetaDataProvider.provideProjectInfo(Properties) 17 6 0
de.smartics.maven.plugin.buildmetadata.BuildReportRenderer.renderMultiTupleValue(Properties,Object,String) 16 3 0
de.smartics.maven.plugin.buildmetadata.scm.maven.MavenScmRevisionNumberFetcher.fetchLatestRevisionNumber() 16 6 1
de.smartics.maven.plugin.buildmetadata.data.ScmMetaDataProvider.loadConnectionInfo() 16 4 1
de.smartics.maven.plugin.buildmetadata.io.SdocBuilder.createMavenElement(Element) 15 3 0
de.smartics.maven.plugin.buildmetadata.common.RevisionHelper.provideLocallyModifiedInfo(Properties,RevisionNumberFetcher) 15 8 1
de.smartics.maven.plugin.buildmetadata.scm.maven.MavenScmRevisionNumberFetcher.containsModifications(ScmFileSet) 15 8 1
de.smartics.maven.plugin.buildmetadata.BuildReportRenderer.renderSections(Properties) 14 4 0
de.smartics.maven.plugin.buildmetadata.data.MavenMetaDataProvider.provideRuntimeInfo(Properties) 14 3 0
de.smartics.maven.plugin.buildmetadata.io.SdocBuilder.writeDocumentContent() 13 1 1
de.smartics.maven.plugin.buildmetadata.io.SdocBuilder.formatDate(String) 13 6 0
de.smartics.maven.plugin.buildmetadata.io.SdocBuilder.createEnvElement(Element) 13 5 0
de.smartics.maven.plugin.buildmetadata.BuildReportRenderer.renderMultiValue(Object) 13 3 0
de.smartics.maven.plugin.buildmetadata.BuildMetaDataMojo.provideMavenMetaData(Properties) 13 1 0
de.smartics.maven.plugin.buildmetadata.scm.maven.ScmConnectionInfo.createRepository(ScmManager) 13 7 1
de.smartics.maven.plugin.buildmetadata.data.ScmMetaDataProvider.provideBuildMetaData(Properties) 13 8 1
de.smartics.maven.plugin.buildmetadata.data.MavenMetaDataProvider.provideSpecialEnvVars(Properties,Properties) 13 7 0
de.smartics.maven.plugin.buildmetadata.BuildPointMojo.execute() 12 2 1
de.smartics.maven.plugin.buildmetadata.io.SdocBuilder.renderFiles(Element,String) 12 5 0
de.smartics.maven.plugin.buildmetadata.BuildReportRenderer.renderBody() 12 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,119.00 5.49 2.25 0.71

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