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.exceptions.i18n.message 14 79 646 74 593 182 756
de.smartics.exceptions.i18n 16 159 521 137 1040 288 369
de.smartics.exceptions.i18n.context 3 16 79 6 31 38 121
de.smartics.exceptions.i18n.app 3 21 53 2 6 35 259
de.smartics.exceptions.ognl 1 4 15 5 32 11 41
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
37 279 1314 224 1702 554 1546

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.exceptions.i18n.message.DefaultMessageComposer 183 18 0 15
de.smartics.exceptions.i18n.AbstractMessageBean 64 25 0 22
de.smartics.exceptions.i18n.AbstractLocalizedException 63 24 0 18
de.smartics.exceptions.i18n.message.MessageParamParser 63 5 1 9
de.smartics.exceptions.i18n.AbstractLocalizedRuntimeException 59 21 0 16
de.smartics.exceptions.i18n.message.MessageType 59 5 0 0
de.smartics.exceptions.i18n.message.LocalizedInfo 56 16 0 17
de.smartics.exceptions.i18n.AbstractMessageException 53 19 0 13
de.smartics.exceptions.i18n.AbstractMessageRuntimeException 53 19 0 13
de.smartics.exceptions.i18n.CauseTrailMessages 36 6 0 4
de.smartics.exceptions.i18n.I18nExceptionContextManager 34 7 0 7
de.smartics.exceptions.i18n.message.StructuredTextHandler 33 4 0 3
de.smartics.exceptions.i18n.message.MessageTemplateAnalyser 26 3 0 4
de.smartics.exceptions.i18n.message.Helper 25 4 0 5
de.smartics.exceptions.i18n.message.Messages 23 4 1 7
de.smartics.exceptions.i18n.app.ConfigurationExceptionCode 21 10 0 0
de.smartics.exceptions.i18n.app.ParseExceptionCode 21 10 0 0
de.smartics.exceptions.i18n.message.AbstractTextHandler 21 5 0 4
de.smartics.exceptions.i18n.context.AbstractI18nExceptionContext 20 5 0 2
de.smartics.exceptions.i18n.message.ParseException 18 6 0 7
de.smartics.exceptions.i18n.context.I18nExceptionContextProperty 17 8 0 0
de.smartics.exceptions.i18n.message.SingleLineTextHandler 16 2 0 3
de.smartics.exceptions.i18n.PropertyAccessConfigurationException 14 4 0 5
de.smartics.exceptions.i18n.context.SystemDefaultI18nExceptionContext 13 3 0 4
de.smartics.exceptions.i18n.ConfigurationException 10 4 0 5
de.smartics.exceptions.i18n.message.MessageParamParser.MessageParamInfo 10 3 0 3
de.smartics.exceptions.i18n.MethodAccessConfigurationException 10 3 0 4
de.smartics.exceptions.ognl.OgnlExpression 10 4 0 5
de.smartics.exceptions.i18n.DefaultI18nCodeMessageFormatter 9 4 0 2
de.smartics.exceptions.i18n.LocalizedException 9 8 0 9

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.exceptions.i18n.AbstractMessageBean 64 25 0 22
de.smartics.exceptions.i18n.AbstractLocalizedException 63 24 0 18
de.smartics.exceptions.i18n.AbstractLocalizedRuntimeException 59 21 0 16
de.smartics.exceptions.i18n.AbstractMessageException 53 19 0 13
de.smartics.exceptions.i18n.AbstractMessageRuntimeException 53 19 0 13
de.smartics.exceptions.i18n.message.DefaultMessageComposer 183 18 0 15
de.smartics.exceptions.i18n.message.LocalizedInfo 56 16 0 17
de.smartics.exceptions.i18n.app.ConfigurationExceptionCode 21 10 0 0
de.smartics.exceptions.i18n.app.ParseExceptionCode 21 10 0 0
de.smartics.exceptions.i18n.context.I18nExceptionContextProperty 17 8 0 0
de.smartics.exceptions.i18n.LocalizedException 9 8 0 9
de.smartics.exceptions.i18n.I18nExceptionContextManager 34 7 0 7
de.smartics.exceptions.i18n.MessageBean 8 7 0 8
de.smartics.exceptions.i18n.CauseTrailMessages 36 6 0 4
de.smartics.exceptions.i18n.message.ParseException 18 6 0 7
de.smartics.exceptions.i18n.context.AbstractI18nExceptionContext 20 5 0 2
de.smartics.exceptions.i18n.message.AbstractTextHandler 21 5 0 4
de.smartics.exceptions.i18n.message.MessageParamParser 63 5 1 9
de.smartics.exceptions.i18n.message.MessageType 59 5 0 0
de.smartics.exceptions.i18n.ConfigurationException 10 4 0 5
de.smartics.exceptions.i18n.DefaultI18nCodeMessageFormatter 9 4 0 2
de.smartics.exceptions.i18n.I18nExceptionContext 5 4 0 5
de.smartics.exceptions.i18n.message.Helper 25 4 0 5
de.smartics.exceptions.i18n.message.Messages 23 4 1 7
de.smartics.exceptions.i18n.message.StructuredTextHandler 33 4 0 3
de.smartics.exceptions.i18n.PropertyAccessConfigurationException 14 4 0 5
de.smartics.exceptions.ognl.OgnlExpression 10 4 0 5
de.smartics.exceptions.i18n.context.SystemDefaultI18nExceptionContext 13 3 0 4
de.smartics.exceptions.i18n.I18nCodeMessageFormatter 4 3 0 4
de.smartics.exceptions.i18n.message.MessageParamParser.MessageParamInfo 10 3 0 3

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
29.27 1,314.00 0.05 7.54 6.19

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
de.smartics.exceptions.i18n.message.MessageType.getMessageParamInfos(MessageParam) 26 8 0
de.smartics.exceptions.i18n.message.MessageType.getParentMessageParamInfos(ParentMessageParam) 26 8 0
de.smartics.exceptions.i18n.message.DefaultMessageComposer.composeMessage(Object,Locale,ResourceBundle,String,MessageType) 22 8 0
de.smartics.exceptions.i18n.message.MessageParamParser.parse(String) 20 8 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.supplyPropertyValues(Object,String,ResourceBundle,MessageFormat,MessageType,Object[],Method[]) 18 7 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.supplyPropertyValues(Object,String,ResourceBundle,MessageFormat,MessageType,Object[],Field[]) 17 7 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.supplyParentPropertyValues(Object,String,ResourceBundle,MessageFormat,MessageType,Object[]) 16 6 1
de.smartics.exceptions.i18n.message.MessageTemplateAnalyser.maxIndex(String) 15 6 1
de.smartics.exceptions.i18n.message.StructuredTextHandler.appendWhatHasHappendMessage(Object,Locale,ClassLoader,StringBuilder,ResourceBundle) 15 7 0
de.smartics.exceptions.i18n.CauseTrailMessages.initCauseTrail(Locale,Throwable) 14 3 0
de.smartics.exceptions.i18n.I18nExceptionContextManager.fetchContextFromService(ClassLoader) 14 7 0
de.smartics.exceptions.i18n.message.DefaultMessageComposer.createLimitStrings(Object,String,String,int,ResourceBundle) 14 7 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.getValue(Object,String,String) 14 12 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.getValue(Object,Field) 13 3 1
de.smartics.exceptions.i18n.message.MessageParamParser.parseToken(String,MessageParamInfo,String,int) 13 7 1
de.smartics.exceptions.i18n.message.Helper.capitalize(String) 12 7 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.getValue(Object,Method) 11 10 0
de.smartics.exceptions.i18n.message.DefaultMessageComposer.getProperty(Object,String) 11 8 1
de.smartics.exceptions.i18n.message.MessageParamParser.parseParentMessageParam(String) 11 5 1
de.smartics.exceptions.i18n.message.SingleLineTextHandler.getMessage(Object,Locale,ClassLoader) 11 3 1
de.smartics.exceptions.i18n.CauseTrailMessages.toString() 10 4 0
de.smartics.exceptions.i18n.message.DefaultMessageComposer.getFieldValue(Object,Field) 9 4 1
de.smartics.exceptions.i18n.message.Helper.split(String,String) 9 5 1
de.smartics.exceptions.i18n.message.LocalizedInfo.getLocalizedMessage(Object,Locale,ClassLoader) 9 5 1
de.smartics.exceptions.i18n.message.MessageTemplateAnalyser.extractNumber(String) 9 2 1
de.smartics.exceptions.i18n.message.StructuredTextHandler.getMessage(Object,Locale,ClassLoader) 9 1 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.applyOgnl(Object,String,MessageParamInfo,Object) 8 2 1
de.smartics.exceptions.i18n.message.MessageParamParser.fix(String) 7 6 0
de.smartics.exceptions.i18n.message.Messages.toString() 7 3 0
de.smartics.exceptions.i18n.AbstractLocalizedException.createMessages(Locale) 6 2 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,314.00 3.53 1.63 0.69

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