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.properties.reports 9 66 431 35 186 107 219
de.smartics.properties.utils 7 40 317 33 225 66 134
de.smartics.properties.report 4 26 217 13 74 39 102
de.smartics.properties.report.data 6 42 176 46 278 66 127
de.smartics.properties.report.qdox 1 2 22 3 20 11 39
de.smartics.properties.report.app 1 3 10 4 28 11 38
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
28 179 1173 134 811 300 659

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.properties.report.AddReportItemHelper 111 11 0 1
de.smartics.properties.reports.XmlPropertyReporter 103 15 0 6
de.smartics.properties.reports.AbstractReporter 93 17 0 2
de.smartics.properties.utils.JavadocCommentHelper 75 10 0 6
de.smartics.properties.report.data.PropertyReportItem 72 14 1 19
de.smartics.properties.utils.ProjectClassLoader 63 10 1 9
de.smartics.properties.report.data.PropertyReportSet 54 7 1 13
de.smartics.properties.utils.AbstractProjectClassLoader 52 6 0 6
de.smartics.properties.utils.HtmlUtils 44 6 1 6
de.smartics.properties.report.ReportBuilder 40 7 1 4
de.smartics.properties.reports.AbstractPropertyReport 37 9 0 8
de.smartics.properties.utils.RuntimeUtils 33 5 0 6
de.smartics.properties.reports.XmlPropertyReport 31 4 0 3
de.smartics.properties.reports.PropertiesPropertyReport 28 5 0 3
de.smartics.properties.reports.XmlPropertySetReporter 25 7 0 1
de.smartics.properties.report.data.PropertyReportSet.Builder 21 5 0 5
de.smartics.properties.report.data.ReportProblem 21 6 0 7
de.smartics.properties.report.data.PropertyReportItem.Builder 20 4 0 4
de.smartics.properties.report.ReportConfiguration 18 7 0 8
de.smartics.properties.report.qdox.PropertyDescriptorSearcher 13 2 0 3
de.smartics.properties.reports.InMemoryPropertyReport 13 5 0 6
de.smartics.properties.utils.ProjectClassLoader.Enumeration 9 2 0 0
de.smartics.properties.report.app.ReportException 8 3 0 4
de.smartics.properties.report.data.PropertyReport 7 6 0 7
de.smartics.properties.reports.XmlPropertyItemReport 7 2 0 3
de.smartics.properties.reports.XmlPropertySetReport 7 2 0 3
de.smartics.properties.utils.HtmlUtils.CleanerProperties 3 1 0 0
de.smartics.properties.report.ReportBuilder.ErrorHandler 2 1 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.properties.reports.AbstractReporter 93 17 0 2
de.smartics.properties.reports.XmlPropertyReporter 103 15 0 6
de.smartics.properties.report.data.PropertyReportItem 72 14 1 19
de.smartics.properties.report.AddReportItemHelper 111 11 0 1
de.smartics.properties.utils.JavadocCommentHelper 75 10 0 6
de.smartics.properties.utils.ProjectClassLoader 63 10 1 9
de.smartics.properties.reports.AbstractPropertyReport 37 9 0 8
de.smartics.properties.report.data.PropertyReportSet 54 7 1 13
de.smartics.properties.report.ReportBuilder 40 7 1 4
de.smartics.properties.report.ReportConfiguration 18 7 0 8
de.smartics.properties.reports.XmlPropertySetReporter 25 7 0 1
de.smartics.properties.report.data.PropertyReport 7 6 0 7
de.smartics.properties.report.data.ReportProblem 21 6 0 7
de.smartics.properties.utils.AbstractProjectClassLoader 52 6 0 6
de.smartics.properties.utils.HtmlUtils 44 6 1 6
de.smartics.properties.report.data.PropertyReportSet.Builder 21 5 0 5
de.smartics.properties.reports.InMemoryPropertyReport 13 5 0 6
de.smartics.properties.reports.PropertiesPropertyReport 28 5 0 3
de.smartics.properties.utils.RuntimeUtils 33 5 0 6
de.smartics.properties.report.data.PropertyReportItem.Builder 20 4 0 4
de.smartics.properties.reports.XmlPropertyReport 31 4 0 3
de.smartics.properties.report.app.ReportException 8 3 0 4
de.smartics.properties.report.qdox.PropertyDescriptorSearcher 13 2 0 3
de.smartics.properties.reports.XmlPropertyItemReport 7 2 0 3
de.smartics.properties.reports.XmlPropertySetReport 7 2 0 3
de.smartics.properties.utils.ProjectClassLoader.Enumeration 9 2 0 0
de.smartics.properties.report.ReportBuilder.ErrorHandler 2 1 0 0
de.smartics.properties.utils.HtmlUtils.CleanerProperties 3 1 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
36.07 1,173.00 0.18 6.39 5.11

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.properties.reports.AbstractReporter.writeDescription() 21 4 0
de.smartics.properties.reports.XmlPropertyReporter.renderPropertyDescriptor() 20 4 0
de.smartics.properties.utils.JavadocCommentHelper.replaceJavadocInlines(String) 18 7 1
de.smartics.properties.reports.XmlPropertyReporter.addRanges(PropertyDescriptor) 17 5 0
de.smartics.properties.report.AddReportItemHelper.handleItem(PropertyReport,Class,JavaMethod) 15 3 0
de.smartics.properties.report.AddReportItemHelper.loadValueComment(PropertyReport,JavaClass) 15 4 0
de.smartics.properties.utils.AbstractProjectClassLoader.loadClassFromLibrary(String,String,File) 15 6 1
de.smartics.properties.utils.ProjectClassLoader.findResource(String) 15 8 0
de.smartics.properties.report.AddReportItemHelper.addReportSet(PropertyReport) 13 1 0
de.smartics.properties.reports.AbstractReporter.writeFiling() 13 2 0
de.smartics.properties.utils.HtmlUtils.clean(String) 13 6 1
de.smartics.properties.utils.JavadocCommentHelper.expandFirstBlock(String) 13 7 1
de.smartics.properties.reports.XmlPropertyReporter.addRestrictions(PropertyDescriptor) 12 3 0
de.smartics.properties.report.AddReportItemHelper.isPropertyMethod(JavaMethod) 11 7 0
de.smartics.properties.reports.AbstractPropertyReport.checkForUniqueness(PropertyReportItem,String) 11 3 0
de.smartics.properties.reports.XmlPropertyReport.handle(PropertyReportItem) 11 3 0
de.smartics.properties.reports.XmlPropertyReporter.renderImplementation() 11 3 0
de.smartics.properties.utils.AbstractProjectClassLoader.loadClassFile(String,File) 11 4 1
de.smartics.properties.utils.ProjectClassLoader.initDirectories(Logger,String) 11 7 1
de.smartics.properties.utils.ProjectClassLoader.findResources(String) 11 1 0
de.smartics.properties.utils.ProjectClassLoader.findClass(String) 11 7 1
de.smartics.properties.report.AddReportItemHelper.loadValueComment(PropertyReport,PropertyDescriptor) 10 4 0
de.smartics.properties.report.AddReportItemHelper.normalizeExpression(Expression) 10 4 0
de.smartics.properties.report.ReportBuilder.reportTo(PropertyReport) 10 3 1
de.smartics.properties.reports.XmlPropertyReport.handle(PropertyReportSet) 10 3 0
de.smartics.properties.utils.AbstractProjectClassLoader.loadResourceFromLibrary(String,String,File) 10 5 1
de.smartics.properties.utils.HtmlUtils.createCleanerProperties() 10 1 0
de.smartics.properties.utils.JavadocCommentHelper.calcElementName(String) 10 3 0
de.smartics.properties.report.AddReportItemHelper.addReportPropertyItems(PropertyReport) 9 5 0
de.smartics.properties.report.qdox.PropertyDescriptorSearcher.hasPropertyAnnotation(JavaClass) 9 5 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,173.00 4.87 1.93 0.61

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