JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis.
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.naftulin.configmgr.parsers 16 66 696 28 178 19 94
org.naftulin.configmgr 15 117 513 64 373 4 177
org.naftulin.configmgr.content 10 80 274 24 182 0 103
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
41 263 1483 116 733 23 374

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.naftulin.configmgr.parsers.DbDirectParserImpl 101 14 0 0
org.naftulin.configmgr.parsers.MasterRecordParser 86 8 0 2
org.naftulin.configmgr.ConfigurationManagementImpl 84 10 1 6
org.naftulin.configmgr.ConfigurationUtilityHelper 79 11 1 0
org.naftulin.configmgr.parsers.DbJndiParserImpl 67 5 0 1
org.naftulin.configmgr.ConfigurationUtility 63 14 0 6
org.naftulin.configmgr.ConfigurationManagerConsole 62 12 0 0
org.naftulin.configmgr.ConfigurationManagementEntryImpl 60 15 0 5
org.naftulin.configmgr.content.DbDirectRecordImpl 50 19 0 1
org.naftulin.configmgr.parsers.ConfigurationRecordsToEntriesConverter 49 3 0 3
org.naftulin.configmgr.parsers.XmlFileParserImpl 44 5 0 1
org.naftulin.configmgr.content.DbJndiRecordImpl 40 15 0 1
org.naftulin.configmgr.parsers.ExternalConfigurationParserImpl 33 4 0 4
org.naftulin.configmgr.parsers.AbstractJndiParser 29 4 0 0
org.naftulin.configmgr.parsers.AbstractLog4JParser 27 4 0 3
org.naftulin.configmgr.ConfigurationManagerFactory 25 6 0 3
org.naftulin.configmgr.content.JndiRecordImpl 25 9 0 2
org.naftulin.configmgr.parsers.PropertyFileParserImpl 24 3 0 2
org.naftulin.configmgr.content.AbstractRecordImpl 20 9 0 6
org.naftulin.configmgr.content.MasterRecordImpl 20 8 0 4
org.naftulin.configmgr.parsers.JndiParserImpl 20 2 0 0
org.naftulin.configmgr.ConfigurationType 19 3 0 1
org.naftulin.configmgr.content.Log4JRecordImpl 19 3 0 3
org.naftulin.configmgr.parsers.DBUtils 17 3 0 0
org.naftulin.configmgr.content.XmlRecordImpl 15 6 0 2
org.naftulin.configmgr.ConfigurationManagementEntry 13 12 0 13
org.naftulin.configmgr.content.ExternalRecordImpl 12 3 0 2
org.naftulin.configmgr.content.NameValuePairImpl 12 4 0 1
org.naftulin.configmgr.parsers.AbstractConfigEntryParser 12 1 0 2
org.naftulin.configmgr.ConfigurationManagerConsoleMBean 11 10 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.naftulin.configmgr.content.DbDirectRecordImpl 50 19 0 1
org.naftulin.configmgr.ConfigurationManagementEntryImpl 60 15 0 5
org.naftulin.configmgr.content.DbJndiRecordImpl 40 15 0 1
org.naftulin.configmgr.ConfigurationUtility 63 14 0 6
org.naftulin.configmgr.parsers.DbDirectParserImpl 101 14 0 0
org.naftulin.configmgr.ConfigurationManagementEntry 13 12 0 13
org.naftulin.configmgr.ConfigurationManagerConsole 62 12 0 0
org.naftulin.configmgr.ConfigurationUtilityHelper 79 11 1 0
org.naftulin.configmgr.ConfigurationManagementImpl 84 10 1 6
org.naftulin.configmgr.ConfigurationManagerConsoleMBean 11 10 0 0
org.naftulin.configmgr.content.AbstractRecordImpl 20 9 0 6
org.naftulin.configmgr.content.JndiRecordImpl 25 9 0 2
org.naftulin.configmgr.content.MasterRecordImpl 20 8 0 4
org.naftulin.configmgr.parsers.MasterRecordParser 86 8 0 2
org.naftulin.configmgr.ConfigurationManagement 7 6 0 7
org.naftulin.configmgr.ConfigurationManagerFactory 25 6 0 3
org.naftulin.configmgr.content.XmlRecordImpl 15 6 0 2
org.naftulin.configmgr.parsers.DbJndiParserImpl 67 5 0 1
org.naftulin.configmgr.parsers.XmlFileParserImpl 44 5 0 1
org.naftulin.configmgr.ConfigurationManagerException 10 4 0 5
org.naftulin.configmgr.ConfigurationManagerRuntimeException 10 4 0 5
org.naftulin.configmgr.content.NameValuePairImpl 12 4 0 1
org.naftulin.configmgr.content.PropertyRecordImpl 10 4 0 2
org.naftulin.configmgr.EntryInErrorException 10 4 0 5
org.naftulin.configmgr.EntryNotFoundException 10 4 0 5
org.naftulin.configmgr.parsers.AbstractJndiParser 29 4 0 0
org.naftulin.configmgr.parsers.AbstractLog4JParser 27 4 0 3
org.naftulin.configmgr.parsers.ExternalConfigurationParserImpl 33 4 0 4
org.naftulin.configmgr.ConfigurationType 19 3 0 1
org.naftulin.configmgr.content.ExternalRecordImpl 12 3 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
29.76 1,483.00 0.05 6.41 2.83

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.naftulin.configmgr.parsers.DbJndiParserImpl.getConfigurationManagementEntry(String,URL) 27 3 0
org.naftulin.configmgr.parsers.DbDirectParserImpl.getConfigurationManagementEntry(String,URL) 26 3 0
org.naftulin.configmgr.parsers.XmlFileParserImpl.getConfigurationManagementEntry(String,URL) 24 9 0
org.naftulin.configmgr.parsers.ConfigurationRecordsToEntriesConverter.createEntiresFromMasterRecord(MasterRecordImpl) 23 6 1
org.naftulin.configmgr.parsers.ExternalConfigurationParserImpl.getConfigurationManagementEntry(String,URL) 22 12 0
org.naftulin.configmgr.parsers.MasterRecordParser.digestMasterRecord(String) 21 11 0
org.naftulin.configmgr.parsers.AbstractLog4JParser.getConfigurationManagementEntry(String,URL) 16 3 1
org.naftulin.configmgr.parsers.JndiParserImpl.getConfigurationManagementEntry(String,URL) 16 3 0
org.naftulin.configmgr.parsers.MasterRecordParser.getConfigurationManagementEntry(String,URL) 15 3 1
org.naftulin.configmgr.ConfigurationManagementImpl.ConfigurationManagerImpl.getConfigurationSilent(String) 13 4 0
org.naftulin.configmgr.parsers.ConfigurationRecordsToEntriesConverter.createConfigurationEntriesFromConfigurationFile(String) 13 4 0
org.naftulin.configmgr.parsers.DbDirectParserImpl.createEntryBasedOnResultSet(String,ResultSet) 13 2 0
org.naftulin.configmgr.parsers.DbJndiParserImpl.createEntryBasedOnNameValuePairs(String,ResultSet) 13 2 0
org.naftulin.configmgr.parsers.MasterRecordParser.doSubstitutions(String) 13 3 0
org.naftulin.configmgr.ConfigurationManagerConsole.getConfigurationEntries() 12 3 0
org.naftulin.configmgr.content.Log4JRecordImpl.getParser() 12 6 0
org.naftulin.configmgr.parsers.PropertyFileParserImpl.getConfigurationManagementEntry(String,URL) 12 3 1
org.naftulin.configmgr.ConfigurationManagementEntryImpl.ConfigurationManagementEntryImpl(String,String,Object,ConfigEntryParser,ConfigurationType) 11 4 1
org.naftulin.configmgr.ConfigurationManagementImpl.getConfigurationManagmentEntries() 11 3 0
org.naftulin.configmgr.ConfigurationUtilityHelper.getObject(String,String) 11 2 0
org.naftulin.configmgr.parsers.DbDirectParserImpl.validateParameters(String) 11 11 0
org.naftulin.configmgr.ConfigurationManagementImpl.ConfigurationManagerImpl.getConfiguration(String) 10 6 1
org.naftulin.configmgr.ConfigurationUtilityHelper.getObject(String) 10 2 0
org.naftulin.configmgr.parsers.AbstractConfigEntryParser.readStreamContentAsString(InputStream) 10 2 1
org.naftulin.configmgr.parsers.ConfigurationRecordsToEntriesConverter.convertRecordToEntry(AbstractRecordImpl) 10 6 1
org.naftulin.configmgr.parsers.DbDirectParserImpl.DbDirectParserImpl(String,String,String,String,String,String,String,List) 10 1 0
org.naftulin.configmgr.parsers.MasterRecordParser.preprocessConfigurationFile(URL) 10 2 0
org.naftulin.configmgr.ConfigurationManagementEntryImpl.toString() 9 2 0
org.naftulin.configmgr.ConfigurationManagementImpl.getConfigurationManagmentEntry(String) 9 3 1
org.naftulin.configmgr.ConfigurationManagerConsole.getContent(String) 9 4 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,483.00 3.94 1.78 0.32

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