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 7 59 387 37 182 87 180
de.smartics.properties.utils 6 28 229 25 179 54 95
de.smartics.properties.report 4 26 216 13 74 39 102
de.smartics.properties.report.data 8 52 211 58 337 88 175
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
27 170 1075 140 820 290 629

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.AbstractReporter 93 17 0 2
de.smartics.properties.reports.PropertyReporter 88 13 0 6
de.smartics.properties.report.data.PropertyReportItem 69 13 1 19
de.smartics.properties.utils.ProjectClassLoader 63 10 1 9
de.smartics.properties.report.data.PropertyReportSet 55 7 1 13
de.smartics.properties.utils.AbstractProjectClassLoader 52 6 0 6
de.smartics.properties.report.ReportBuilder 40 7 1 4
de.smartics.properties.utils.HtmlUtils 38 4 1 4
de.smartics.properties.reports.AbstractPropertyReport 37 9 0 8
de.smartics.properties.utils.RuntimeUtils 33 5 0 6
de.smartics.properties.reports.PropertiesPropertyReport 29 5 0 5
de.smartics.properties.reports.XmlPropertyReport 27 3 0 4
de.smartics.properties.reports.PropertySetReporter 24 7 0 6
de.smartics.properties.report.data.PropertyReportSet.Builder 22 5 0 5
de.smartics.properties.report.data.PropertyReportItem.Builder 21 5 0 5
de.smartics.properties.report.data.ReportProblem 21 6 0 7
de.smartics.properties.report.data.SourceInfo 20 6 0 7
de.smartics.properties.report.ReportConfiguration 18 7 0 8
de.smartics.properties.report.data.ValueComment 14 4 0 5
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.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.report.data.PropertyReportItem 69 13 1 19
de.smartics.properties.reports.PropertyReporter 88 13 0 6
de.smartics.properties.report.AddReportItemHelper 111 11 0 1
de.smartics.properties.utils.ProjectClassLoader 63 10 1 9
de.smartics.properties.reports.AbstractPropertyReport 37 9 0 8
de.smartics.properties.report.data.PropertyReportSet 55 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.PropertySetReporter 24 7 0 6
de.smartics.properties.report.data.PropertyReport 7 6 0 7
de.smartics.properties.report.data.ReportProblem 21 6 0 7
de.smartics.properties.report.data.SourceInfo 20 6 0 7
de.smartics.properties.utils.AbstractProjectClassLoader 52 6 0 6
de.smartics.properties.report.data.PropertyReportItem.Builder 21 5 0 5
de.smartics.properties.report.data.PropertyReportSet.Builder 22 5 0 5
de.smartics.properties.reports.InMemoryPropertyReport 13 5 0 6
de.smartics.properties.reports.PropertiesPropertyReport 29 5 0 5
de.smartics.properties.utils.RuntimeUtils 33 5 0 6
de.smartics.properties.report.data.ValueComment 14 4 0 5
de.smartics.properties.utils.HtmlUtils 38 4 1 4
de.smartics.properties.report.app.ReportException 8 3 0 4
de.smartics.properties.reports.XmlPropertyReport 27 3 0 4
de.smartics.properties.report.qdox.PropertyDescriptorSearcher 13 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
34.44 1,075.00 0.19 6.30 5.56

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.PropertyReporter.renderPropertyDescriptor() 17 4 0
de.smartics.properties.reports.PropertyReporter.addRanges(PropertyDescriptor) 16 3 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.reports.PropertyReporter.addRestrictions(PropertyDescriptor) 13 3 0
de.smartics.properties.utils.HtmlUtils.clean(String) 13 6 1
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.PropertyReporter.renderImplementation() 11 2 0
de.smartics.properties.reports.XmlPropertyReport.handle(PropertyReportItem) 11 3 1
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 1
de.smartics.properties.utils.AbstractProjectClassLoader.loadResourceFromLibrary(String,String,File) 10 5 1
de.smartics.properties.utils.HtmlUtils.createCleanerProperties() 10 1 0
de.smartics.properties.report.AddReportItemHelper.addReportPropertyItems(PropertyReport) 9 5 0
de.smartics.properties.report.qdox.PropertyDescriptorSearcher.hasPropertyAnnotation(JavaClass) 9 5 1
de.smartics.properties.utils.RuntimeUtils.loadInstance(JavaField) 9 3 1
de.smartics.properties.reports.AbstractReporter.writeIdentification() 8 2 0
de.smartics.properties.reports.AbstractReporter.addItems(String,Element,String,String) 8 3 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,075.00 4.66 1.82 0.68

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