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.util.report.link 8 44 208 45 276 84 199
de.smartics.maven.util.report 5 31 199 24 170 46 141
de.smartics.maven.util.eclipse 2 12 144 14 145 25 53
de.smartics.maven.util 3 14 99 13 75 33 45
de.smartics.maven.util.project 3 15 84 18 128 20 51
de.smartics.maven.io 1 11 59 9 63 12 15
de.smartics.maven.util.report.link.strategy 5 15 56 18 92 56 96
de.smartics.maven.util.log4j 1 3 24 3 16 11 15
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
28 145 873 144 965 287 615

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.maven.util.eclipse.WorkspaceUtils 109 7 0 8
de.smartics.maven.util.report.MavenExternalReportFactory 63 9 0 4
de.smartics.maven.io.MojoIoUtils 46 11 0 9
de.smartics.maven.util.report.link.LinkConstructorStrategyConfig 46 5 1 12
de.smartics.maven.util.LoggingUtils 43 7 0 5
de.smartics.maven.util.report.link.AbstractLinkConstructorStrategy 43 11 0 8
de.smartics.maven.util.report.ExternalReportReferences 36 8 1 9
de.smartics.maven.util.report.link.ReportId 36 7 0 7
de.smartics.maven.util.report.MessageHelper 36 9 0 7
de.smartics.maven.util.project.DefaultMavenContext 34 8 0 9
de.smartics.maven.util.PathUtils 32 5 0 5
de.smartics.maven.util.report.link.JavaElementRef 29 6 0 6
de.smartics.maven.util.report.link.LinkConstructorStrategyConfig.Builder 28 5 0 5
de.smartics.maven.util.report.link.ExternalReport 27 7 0 7
de.smartics.maven.util.project.ProjectComparator 25 2 0 3
de.smartics.maven.util.log4j.Log4jConfigurator 20 3 0 3
de.smartics.maven.util.report.ReportUtils 20 3 0 4
de.smartics.maven.util.eclipse.Messages 16 5 0 6
de.smartics.maven.util.report.link.strategy.LineNumberDirectoryPathLinkConstructorStrategy 13 3 0 3
de.smartics.maven.util.report.link.strategy.SingleDocumentLinkConstructorStrategy 11 6 0 6
de.smartics.maven.util.SunLoggerConfigurator 11 2 0 3
de.smartics.maven.util.project.MavenContext 6 5 0 6
de.smartics.maven.util.report.link.strategy.DirectoryPathLinkConstructorStrategy 5 2 0 3
de.smartics.maven.util.report.link.strategy.FilePathLinkConstructorStrategy 5 2 0 3
de.smartics.maven.util.report.link.strategy.SurefireLinkConstructorStrategy 5 2 0 3
de.smartics.maven.util.report.ExternalReportReferences.ExternalReportReferences 4 2 0 0
de.smartics.maven.util.report.link.LinkConstructorStrategy 3 2 0 3
de.smartics.maven.util.report.link.ExternalReportFactory 2 1 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.maven.io.MojoIoUtils 46 11 0 9
de.smartics.maven.util.report.link.AbstractLinkConstructorStrategy 43 11 0 8
de.smartics.maven.util.report.MavenExternalReportFactory 63 9 0 4
de.smartics.maven.util.report.MessageHelper 36 9 0 7
de.smartics.maven.util.project.DefaultMavenContext 34 8 0 9
de.smartics.maven.util.report.ExternalReportReferences 36 8 1 9
de.smartics.maven.util.eclipse.WorkspaceUtils 109 7 0 8
de.smartics.maven.util.LoggingUtils 43 7 0 5
de.smartics.maven.util.report.link.ExternalReport 27 7 0 7
de.smartics.maven.util.report.link.ReportId 36 7 0 7
de.smartics.maven.util.report.link.JavaElementRef 29 6 0 6
de.smartics.maven.util.report.link.strategy.SingleDocumentLinkConstructorStrategy 11 6 0 6
de.smartics.maven.util.eclipse.Messages 16 5 0 6
de.smartics.maven.util.PathUtils 32 5 0 5
de.smartics.maven.util.project.MavenContext 6 5 0 6
de.smartics.maven.util.report.link.LinkConstructorStrategyConfig 46 5 1 12
de.smartics.maven.util.report.link.LinkConstructorStrategyConfig.Builder 28 5 0 5
de.smartics.maven.util.log4j.Log4jConfigurator 20 3 0 3
de.smartics.maven.util.report.link.strategy.LineNumberDirectoryPathLinkConstructorStrategy 13 3 0 3
de.smartics.maven.util.report.ReportUtils 20 3 0 4
de.smartics.maven.util.project.ProjectComparator 25 2 0 3
de.smartics.maven.util.report.ExternalReportReferences.ExternalReportReferences 4 2 0 0
de.smartics.maven.util.report.link.LinkConstructorStrategy 3 2 0 3
de.smartics.maven.util.report.link.strategy.DirectoryPathLinkConstructorStrategy 5 2 0 3
de.smartics.maven.util.report.link.strategy.FilePathLinkConstructorStrategy 5 2 0 3
de.smartics.maven.util.report.link.strategy.SurefireLinkConstructorStrategy 5 2 0 3
de.smartics.maven.util.SunLoggerConfigurator 11 2 0 3
de.smartics.maven.util.report.link.ExternalReportFactory 2 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
26.93 873.00 0.07 5.18 5.32

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.maven.util.eclipse.WorkspaceUtils.fetchMavenProjects(MavenContext,File,String,String,boolean) 38 13 1
de.smartics.maven.util.eclipse.WorkspaceUtils.addModules(Log,String,MavenProject) 26 9 1
de.smartics.maven.util.eclipse.WorkspaceUtils.filterSubprojects(Log,String,MavenProject) 18 7 1
de.smartics.maven.util.eclipse.WorkspaceUtils.createScanner(File,String,String) 15 4 1
de.smartics.maven.util.project.ProjectComparator.compare(MavenProject,MavenProject) 13 3 1
de.smartics.maven.util.report.ReportUtils.getSkinArtifactFile(MavenProject,ArtifactRepository,ArtifactResolver,ArtifactFactory) 13 8 1
de.smartics.maven.util.report.MavenExternalReportFactory.createRelativeReportLocationLink(ReportId,LinkConstructorStrategy) 12 5 0
de.smartics.maven.util.log4j.Log4jConfigurator.determineLog4jLevel(String) 11 8 0
de.smartics.maven.util.LoggingUtils.configureLogger(Log,String) 11 4 1
de.smartics.maven.util.LoggingUtils.determineLevel(Log) 11 7 1
de.smartics.maven.util.project.ProjectComparator.compareTo(String,String) 11 7 1
de.smartics.maven.util.report.link.AbstractLinkConstructorStrategy.constructLink(String,JavaElementRef) 11 5 1
de.smartics.maven.io.MojoIoUtils.normalizeFileName(String) 10 3 1
de.smartics.maven.util.PathUtils.getUpPath(String) 10 5 0
de.smartics.maven.util.report.MavenExternalReportFactory.calcRelativePath(File) 10 2 0
de.smartics.maven.util.report.MavenExternalReportFactory.createExternalReport(ReportId,LinkConstructorStrategy) 10 7 1
de.smartics.maven.util.report.ExternalReportReferences.registerReport(boolean,ReportId,LinkConstructorStrategy) 9 5 1
de.smartics.maven.util.SunLoggerConfigurator.configure(Log,String) 9 4 1
de.smartics.maven.util.LoggingUtils.runLog4jConfigure(Log,String) 8 3 0
de.smartics.maven.util.report.link.JavaElementRef.toString() 8 3 1
de.smartics.maven.util.report.link.ReportId.equals(Object) 8 7 1
de.smartics.maven.io.MojoIoUtils.serialize(Document,OutputStream,boolean) 7 2 1
de.smartics.maven.util.eclipse.WorkspaceUtils.fetchMavenProjectIds(MavenContext,File,String,String,boolean) 7 2 1
de.smartics.maven.util.log4j.Log4jConfigurator.configure(Log,String) 7 3 1
de.smartics.maven.util.PathUtils.toClassPathString(Artifact,char) 7 2 1
de.smartics.maven.util.PathUtils.toClassPath(Artifact) 7 2 1
de.smartics.maven.util.project.DefaultMavenContext.DefaultMavenContext(Log,PlexusContainer,String) 7 1 1
de.smartics.maven.util.report.link.AbstractLinkConstructorStrategy.isReferencedReportExisting(JavaElementRef) 7 1 0
de.smartics.maven.util.report.link.ExternalReport.checkArguments(ReportId,String,LinkConstructorStrategy) 7 7 0
de.smartics.maven.util.report.link.LinkConstructorStrategyConfig.Builder.setReportLocation(File) 7 2 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
873.00 4.48 2.30 0.81

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