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
org.settings4j.config 5 33 513 29 157 49 54
org.settings4j.connector 11 84 494 67 335 24 185
org.settings4j.settings 5 25 164 27 86 13 94
org.settings4j.contentresolver 4 18 141 20 91 5 68
org.settings4j.objectresolver 6 18 135 18 172 4 85
org.settings4j.helper.spring 6 25 127 23 223 4 87
org.settings4j.settings.position 9 16 127 25 87 0 144
org.settings4j.helper.web 4 13 117 14 104 6 74
org.settings4j 11 51 109 59 630 0 214
org.settings4j.util 7 13 87 13 91 0 52
org.settings4j.helper.configuration 1 3 13 2 32 0 16
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
69 299 2027 297 2008 105 1073

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.settings4j.config.DOMConfigurator 446 25 2 23
org.settings4j.connector.JNDIConnector 152 19 0 7
org.settings4j.connector.PreferencesConnector 61 9 0 7
org.settings4j.settings.DefaultSettings 60 12 0 12
org.settings4j.contentresolver.FSContentResolver 53 5 0 6
org.settings4j.objectresolver.AbstractObjectResolver 50 9 0 5
org.settings4j.connector.CachedConnectorWrapper 48 11 0 12
org.settings4j.helper.spring.Settings4jFactoryBean 41 12 0 9
org.settings4j.helper.web.DefaultPropertiesLoader 40 4 0 2
org.settings4j.helper.web.Log4jConfigurationLoader 40 5 0 6
org.settings4j.util.ELConnectorWrapper 38 4 3 5
org.settings4j.connector.FSConnector 36 10 0 9
org.settings4j.connector.FilteredConnectorWrapper 35 10 0 11
org.settings4j.contentresolver.ClasspathContentResolver 32 5 0 5
org.settings4j.settings.SettingsManager 31 5 0 5
org.settings4j.helper.spring.Settings4jPlaceholderConfigurer 28 5 1 6
org.settings4j.connector.ClasspathConnector 26 6 0 5
org.settings4j.settings.DefaultFilter 24 3 0 4
org.settings4j.connector.PropertyFileConnector 23 4 0 4
org.settings4j.contentresolver.UnionContentResolver 23 5 0 5
org.settings4j.connector.AbstractConnector 22 9 0 3
org.settings4j.util.MatchPatternTransformer 22 2 0 3
org.settings4j.ConnectorPositions 21 10 0 11
org.settings4j.contentresolver.FilteredContentResolverWrapper 17 3 0 4
org.settings4j.objectresolver.FilteredObjectResolverWrapper 17 3 0 4
org.settings4j.Settings4j 17 8 0 9
org.settings4j.helper.spring.Settings4jContextLoader 15 2 0 3
org.settings4j.objectresolver.JavaXMLBeansObjectResolver 15 1 1 4
org.settings4j.objectresolver.UnionObjectResolver 15 2 0 3
org.settings4j.settings.DefaultSettingsRepository 15 4 0 4

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.settings4j.config.DOMConfigurator 446 25 2 23
org.settings4j.connector.JNDIConnector 152 19 0 7
org.settings4j.helper.spring.Settings4jFactoryBean 41 12 0 9
org.settings4j.settings.DefaultSettings 60 12 0 12
org.settings4j.connector.CachedConnectorWrapper 48 11 0 12
org.settings4j.connector.FilteredConnectorWrapper 35 10 0 11
org.settings4j.connector.FSConnector 36 10 0 9
org.settings4j.ConnectorPositions 21 10 0 11
org.settings4j.Settings4jInstance 11 10 0 10
org.settings4j.connector.AbstractConnector 22 9 0 3
org.settings4j.connector.PreferencesConnector 61 9 0 7
org.settings4j.Connector 10 9 0 9
org.settings4j.objectresolver.AbstractObjectResolver 50 9 0 5
org.settings4j.Settings4j 17 8 0 9
org.settings4j.connector.ClasspathConnector 26 6 0 5
org.settings4j.contentresolver.ClasspathContentResolver 32 5 0 5
org.settings4j.contentresolver.FSContentResolver 53 5 0 6
org.settings4j.contentresolver.UnionContentResolver 23 5 0 5
org.settings4j.helper.spring.Settings4jPlaceholderConfigurer 28 5 1 6
org.settings4j.helper.web.Log4jConfigurationLoader 40 5 0 6
org.settings4j.settings.SettingsManager 31 5 0 5
org.settings4j.config.SAXErrorHandler 10 4 0 4
org.settings4j.connector.AbstractPropertyConnector 14 4 0 5
org.settings4j.connector.PropertyFileConnector 23 4 0 4
org.settings4j.helper.web.DefaultPropertiesLoader 40 4 0 2
org.settings4j.settings.DefaultSettingsRepository 15 4 0 4
org.settings4j.Settings4jRepository 5 4 0 5
org.settings4j.util.ELConnectorWrapper 38 4 3 5
org.settings4j.contentresolver.FilteredContentResolverWrapper 17 3 0 4
org.settings4j.Filter 4 3 0 4

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
25.67 2,027.00 0.12 4.33 4.33

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.settings4j.config.DOMConfigurator.parseConnector(Element) 52 14 1
org.settings4j.config.DOMConfigurator.parseObjectResolver(Element) 50 14 1
org.settings4j.config.DOMConfigurator.parseContentResolver(Element) 43 12 1
org.settings4j.config.DOMConfigurator.parseChildrenOfSettingsElement(Element,Settings4jInstance) 41 11 1
org.settings4j.config.DOMConfigurator.parseFilter(Element) 31 8 1
org.settings4j.config.DOMConfigurator.parseMapping(Element) 31 9 1
org.settings4j.config.DOMConfigurator.subst(String,Connector[],Class) 24 14 1
org.settings4j.connector.JNDIConnector.rebindToContext(String,Object) 23 8 1
org.settings4j.connector.JNDIConnector.lookupInContext(String,boolean) 21 8 0
org.settings4j.objectresolver.AbstractObjectResolver.getObject(String,ContentResolver) 20 13 1
org.settings4j.config.DOMConfigurator.doConfigure(ParseAction) 18 4 0
org.settings4j.connector.JNDIConnector.createParentContext(Context,String) 18 6 0
org.settings4j.config.DOMConfigurator.setParameter(Element,Object,Connector[]) 17 5 1
org.settings4j.contentresolver.FSContentResolver.getContent(String) 16 8 1
org.settings4j.contentresolver.FSContentResolver.setContent(String,String[]) 16 4 1
org.settings4j.helper.web.Log4jConfigurationLoader.initLogging(String) 16 4 1
org.settings4j.util.MatchPatternTransformer.transform(String) 16 4 1
org.settings4j.helper.web.Log4jConfigurationLoader.initLog4jConfiguration(ServletContext) 15 5 1
org.settings4j.config.DOMConfigurator.getConnectors(Element) 14 4 1
org.settings4j.connector.JNDIConnector.isJNDIAvailable() 13 4 1
org.settings4j.connector.JNDIConnector.normalizeKey(String,boolean) 13 8 0
org.settings4j.settings.SettingsManager.initializeRepository(String) 13 4 0
org.settings4j.connector.JNDIConnector.getContent(String) 12 9 1
org.settings4j.config.DOMConfigurator.findConnectorByName(Document,String) 11 5 1
org.settings4j.config.DOMConfigurator.findContentResolverByName(Document,String) 11 5 1
org.settings4j.config.DOMConfigurator.findObjectResolverByName(Document,String) 11 5 1
org.settings4j.config.DOMConfigurator.getElementByNameAttr(Document,String,String) 11 3 0
org.settings4j.connector.EnvironmentConnector.getProperty(String,String) 11 7 1
org.settings4j.connector.JNDIConnector.getJNDIContext() 11 4 0
org.settings4j.helper.web.DefaultPropertiesLoader.addPropertyConnector(ServletContext) 11 4 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,027.00 5.20 2.24 0.78

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