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.ci.config.load 11 49 311 42 333 111 231
de.smartics.ci.config.hudson 5 22 156 11 61 54 188
de.smartics.ci.config.utils 2 13 90 7 55 15 42
de.smartics.ci.config.maven 3 16 65 18 106 34 69
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
21 100 622 78 555 214 530

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.ci.config.utils.JDomUtils 77 9 1 7
de.smartics.ci.config.load.HudsonJobConfigLoader 49 7 0 4
de.smartics.ci.config.load.MavenInfoApplier 48 6 0 1
de.smartics.ci.config.maven.MavenPom 40 11 0 12
de.smartics.ci.config.load.LoaderPlan 37 9 0 10
de.smartics.ci.config.hudson.HudsonConfigElement 36 7 0 0
de.smartics.ci.config.hudson.ScmType 30 6 0 0
de.smartics.ci.config.load.HudsonJobConfigurationLoaderConfig 29 4 1 10
de.smartics.ci.config.hudson.HudsonConfigScmElement 28 3 0 3
de.smartics.ci.config.hudson.HudsonConfigEntry 27 3 0 4
de.smartics.ci.config.load.LocationManager 26 5 1 7
de.smartics.ci.config.load.LoaderPlanLoader 24 3 0 3
de.smartics.ci.config.utils.JDomUtils.Cursor 22 4 0 0
de.smartics.ci.config.load.HudsonJobDocumentFixer 17 5 0 1
de.smartics.ci.config.load.HudsonJobConfigurationLoaderConfig.Builder 15 4 0 4
de.smartics.ci.config.maven.MavenConfig 14 4 0 4
de.smartics.ci.config.load.HudsonJobConfig 12 3 0 4
de.smartics.ci.config.hudson.AbstractHudsonConfigHelper 8 3 0 4
de.smartics.ci.config.load.DocumentMerger 8 1 0 2
de.smartics.ci.config.load.LocationManager.DynamicUrlClassLoader 5 2 0 0
de.smartics.ci.config.maven.MavenSettings 2 1 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.ci.config.maven.MavenPom 40 11 0 12
de.smartics.ci.config.utils.JDomUtils 77 9 1 7
de.smartics.ci.config.load.LoaderPlan 37 9 0 10
de.smartics.ci.config.hudson.HudsonConfigElement 36 7 0 0
de.smartics.ci.config.load.HudsonJobConfigLoader 49 7 0 4
de.smartics.ci.config.hudson.ScmType 30 6 0 0
de.smartics.ci.config.load.MavenInfoApplier 48 6 0 1
de.smartics.ci.config.load.HudsonJobDocumentFixer 17 5 0 1
de.smartics.ci.config.load.LocationManager 26 5 1 7
de.smartics.ci.config.utils.JDomUtils.Cursor 22 4 0 0
de.smartics.ci.config.maven.MavenConfig 14 4 0 4
de.smartics.ci.config.load.HudsonJobConfigurationLoaderConfig 29 4 1 10
de.smartics.ci.config.load.HudsonJobConfigurationLoaderConfig.Builder 15 4 0 4
de.smartics.ci.config.hudson.HudsonConfigEntry 27 3 0 4
de.smartics.ci.config.hudson.HudsonConfigScmElement 28 3 0 3
de.smartics.ci.config.hudson.AbstractHudsonConfigHelper 8 3 0 4
de.smartics.ci.config.load.LoaderPlanLoader 24 3 0 3
de.smartics.ci.config.load.HudsonJobConfig 12 3 0 4
de.smartics.ci.config.load.LocationManager.DynamicUrlClassLoader 5 2 0 0
de.smartics.ci.config.maven.MavenSettings 2 1 0 2
de.smartics.ci.config.load.DocumentMerger 8 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
26.38 622.00 0.14 4.76 3.90

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.ci.config.hudson.HudsonConfigScmElement.addScmConfig(ScmType,String) 21 3 1
de.smartics.ci.config.load.HudsonJobConfigLoader.load(LoaderPlan) 17 9 1
de.smartics.ci.config.maven.MavenPom.setScmConnectionString(String) 15 10 1
de.smartics.ci.config.load.MavenInfoApplier.addProjectInfo(Document) 15 1 0
de.smartics.ci.config.hudson.HudsonConfigEntry.addScmConfig(ScmType,String) 14 1 1
de.smartics.ci.config.hudson.HudsonConfigElement.findElementWithin(Element,Element,Element) 13 5 0
de.smartics.ci.config.utils.JDomUtils.merge(Element,Element) 12 6 1
de.smartics.ci.config.load.LoaderPlanLoader.load(LoaderPlan,Document) 11 3 0
de.smartics.ci.config.utils.JDomUtils.calcXPath(Element,Element) 10 3 1
de.smartics.ci.config.hudson.HudsonConfigEntry.addEntry(Element) 10 2 1
de.smartics.ci.config.load.MavenInfoApplier.addScmInfo(Document) 10 3 0
de.smartics.ci.config.hudson.ScmType.create(String) 9 1 0
de.smartics.ci.config.load.LoaderPlanLoader.load(InputSource) 9 3 1
de.smartics.ci.config.utils.JDomUtils.handleAsElement(Cursor,Content) 8 2 0
de.smartics.ci.config.utils.JDomUtils.toString(Document) 8 4 1
de.smartics.ci.config.hudson.ScmType.getValueFor(String) 8 6 0
de.smartics.ci.config.load.LoaderPlan.equals(Object) 8 7 1
de.smartics.ci.config.load.LocationManager.open(String) 8 4 1
de.smartics.ci.config.utils.JDomUtils.Cursor.checkRootElementsMatch(Element,Element) 7 3 0
de.smartics.ci.config.load.LoaderPlan.toString() 7 2 1
de.smartics.ci.config.load.DocumentMerger.merge(Document,Document) 7 5 1
de.smartics.ci.config.utils.JDomUtils.Cursor.Cursor(Element,Element) 6 1 0
de.smartics.ci.config.hudson.HudsonConfigElement.findElement(Element,Element,Element) 6 3 0
de.smartics.ci.config.load.MavenInfoApplier.createAuthToken() 6 1 0
de.smartics.ci.config.hudson.HudsonConfigElement.valueFor(String) 5 5 0
de.smartics.ci.config.hudson.HudsonConfigElement.defaultFindElement(Element,Element,Element) 5 1 0
de.smartics.ci.config.load.LoaderPlan.LoaderPlan(String,MavenConfig) 5 1 1
de.smartics.ci.config.load.MavenInfoApplier.addProjectDescription(Document) 5 1 0
de.smartics.ci.config.load.LocationManager.addLocation(File) 5 3 1
de.smartics.ci.config.load.HudsonJobConfig.HudsonJobConfig(String,String) 5 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
622.00 4.56 1.77 0.59

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