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 12 60 550 59 509 147 735
de.smartics.exceptions.i18n 9 60 204 69 534 215 213
de.smartics.exceptions.i18n.context 3 15 63 9 50 38 138
de.smartics.exceptions.i18n.app 3 21 53 2 9 35 265
de.smartics.exceptions.ognl 1 4 15 5 35 11 40
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
28 160 885 144 1137 446 1391

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
de.smartics.exceptions.i18n.message.DefaultMessageComposer 145 14 0 15
de.smartics.exceptions.i18n.message.MessageType 59 5 0 0
de.smartics.exceptions.i18n.message.MessageParamParser 55 4 1 9
de.smartics.exceptions.i18n.AbstractLocalizedException 47 19 0 20
de.smartics.exceptions.i18n.AbstractLocalizedRuntimeException 43 16 0 17
de.smartics.exceptions.i18n.message.LocalizedInfo 35 8 0 9
de.smartics.exceptions.i18n.message.StructuredTextHandler 33 4 0 3
de.smartics.exceptions.i18n.message.MessageTemplateAnalyser 26 3 0 4
de.smartics.exceptions.i18n.I18nExceptionContextManager 25 6 0 7
de.smartics.exceptions.i18n.message.Helper 25 4 0 5
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.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.AbstractI18nExceptionContext 13 4 0 5
de.smartics.exceptions.i18n.context.SystemDefaultI18nExceptionContext 11 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.LocalizedException 5 4 0 5
de.smartics.exceptions.i18n.message.MessageTemplate 5 2 0 0
de.smartics.exceptions.i18n.I18nExceptionContext 4 3 0 4
de.smartics.exceptions.i18n.app.Constant 3 1 0 2
de.smartics.exceptions.i18n.MessageComposer 2 1 0 2

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
de.smartics.exceptions.i18n.AbstractLocalizedException 47 19 0 20
de.smartics.exceptions.i18n.AbstractLocalizedRuntimeException 43 16 0 17
de.smartics.exceptions.i18n.message.DefaultMessageComposer 145 14 0 15
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.message.LocalizedInfo 35 8 0 9
de.smartics.exceptions.i18n.I18nExceptionContextManager 25 6 0 7
de.smartics.exceptions.i18n.message.ParseException 18 6 0 7
de.smartics.exceptions.i18n.message.AbstractTextHandler 21 5 0 4
de.smartics.exceptions.i18n.message.MessageType 59 5 0 0
de.smartics.exceptions.i18n.ConfigurationException 10 4 0 5
de.smartics.exceptions.i18n.context.AbstractI18nExceptionContext 13 4 0 5
de.smartics.exceptions.i18n.LocalizedException 5 4 0 5
de.smartics.exceptions.i18n.message.Helper 25 4 0 5
de.smartics.exceptions.i18n.message.MessageParamParser 55 4 1 9
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 11 3 0 4
de.smartics.exceptions.i18n.I18nExceptionContext 4 3 0 4
de.smartics.exceptions.i18n.message.MessageParamParser.MessageParamInfo 10 3 0 3
de.smartics.exceptions.i18n.message.MessageTemplateAnalyser 26 3 0 4
de.smartics.exceptions.i18n.MethodAccessConfigurationException 10 3 0 4
de.smartics.exceptions.i18n.message.MessageTemplate 5 2 0 0
de.smartics.exceptions.i18n.message.SingleLineTextHandler 16 2 0 3
de.smartics.exceptions.i18n.app.Constant 3 1 0 2
de.smartics.exceptions.i18n.MessageComposer 2 1 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
25.14 885.00 0.04 5.71 5.25

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.MessageParamParser.parse(String) 20 8 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.composeMessage(Throwable,Locale,ResourceBundle,String,MessageType) 19 8 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.supplyPropertyValues(Throwable,String,ResourceBundle,MessageFormat,MessageType,Object[],Field[]) 17 7 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.supplyParentPropertyValues(Throwable,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(Throwable,Locale,ClassLoader,StringBuilder,ResourceBundle) 15 7 0
de.smartics.exceptions.i18n.message.DefaultMessageComposer.createLimitStrings(Throwable,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 4 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.getProperty(Object,String) 11 8 1
de.smartics.exceptions.i18n.message.SingleLineTextHandler.getMessage(Throwable,Locale,ClassLoader) 11 3 1
de.smartics.exceptions.i18n.message.MessageParamParser.parseParentMessageParam(String) 10 5 1
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(Throwable,Locale,ClassLoader) 9 5 1
de.smartics.exceptions.i18n.message.MessageTemplateAnalyser.extractNumber(String) 9 2 1
de.smartics.exceptions.i18n.message.StructuredTextHandler.getMessage(Throwable,Locale,ClassLoader) 9 1 1
de.smartics.exceptions.i18n.I18nExceptionContextManager.fetchContextFromService(ClassLoader) 8 4 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.applyOgnl(Throwable,String,MessageParamInfo,Object) 8 2 1
de.smartics.exceptions.i18n.message.AbstractTextHandler.fetchLocalizedMessage(Throwable,String,Locale,MessageType,ClassLoader) 6 1 0
de.smartics.exceptions.i18n.message.DefaultMessageComposer.evaluateOgnl(Throwable,String,Object,String) 6 4 1
de.smartics.exceptions.i18n.message.StructuredTextHandler.appendMessage(Throwable,Locale,ClassLoader,StringBuilder,MessageType,String) 6 3 0
de.smartics.exceptions.i18n.AbstractLocalizedException.getMessages(Locale) 5 2 1
de.smartics.exceptions.i18n.AbstractLocalizedRuntimeException.getMessages(Locale) 5 2 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.applyCompoundMessageInfo(Throwable,String,ResourceBundle,MessageFormat,String,int) 5 2 1
de.smartics.exceptions.i18n.message.DefaultMessageComposer.isAllInformationProvided(Object[]) 5 4 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
885.00 3.98 1.83 0.76

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