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.springframework.richclient.exceptionhandling 10 37 308 26 160 4 11
org.springframework.richclient.exceptionhandling.delegation 7 37 195 19 139 35 7
org.springframework.binding.validation.support 2 14 105 13 67 3 50
org.springframework.binding.support 3 8 69 4 97 6 79
org.springframework.richclient.form.binding.swing 1 3 59 1 25 0 0
org.springframework.richclient.jnlp 1 6 42 6 78 1 3
org.springframework.richclient.util 1 1 16 2 19 7 15
org.springframework.richclient.table.renderer 1 2 14 2 11 0 3
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
26 108 808 73 596 56 168

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.springframework.richclient.exceptionhandling.delegation.ChainInspectingExceptionHandlerDelegate 67 6 1 1
org.springframework.richclient.exceptionhandling.JXErrorDialogExceptionHandler 59 6 0 7
org.springframework.binding.validation.support.HibernateRulesValidator 56 11 0 9
org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler 51 9 0 3
org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder 50 3 2 1
org.springframework.richclient.exceptionhandling.delegation.DefaultExceptionPurger 40 9 0 5
org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler 39 7 0 4
org.springframework.richclient.exceptionhandling.EmailNotifierErrorReporter 38 6 0 1
org.springframework.richclient.exceptionhandling.AbstractLoggingExceptionHandler 37 5 0 6
org.springframework.richclient.jnlp.JnlpPropertyPlaceholderConfigurer 36 6 0 6
org.springframework.richclient.exceptionhandling.delegation.AbstractExceptionHandlerDelegate 27 10 0 4
org.springframework.richclient.exceptionhandling.HibernateValidatorDialogExceptionHandler 27 2 0 1
org.springframework.binding.support.AnnotationAwareBeanPropertyAccessStrategy 22 6 0 1
org.springframework.binding.support.ReflectionAnnotationTranslator 21 1 0 1
org.springframework.binding.validation.support.HibernateRulesMessageInterpolator 20 3 0 4
org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler 18 4 0 4
org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate 17 6 0 1
org.springframework.richclient.util.AnnotationUtils 10 1 0 2
org.springframework.richclient.table.renderer.TigerEnumTableCellRenderer 9 2 0 2
org.springframework.richclient.exceptionhandling.AbstractRegisterableExceptionHandler 4 1 0 2
org.springframework.binding.support.AnnotationTranslator 2 1 0 2
org.springframework.richclient.exceptionhandling.delegation.ExceptionHandlerDelegate 2 1 0 2
org.springframework.richclient.exceptionhandling.delegation.ExceptionPurger 2 1 0 2
org.springframework.richclient.exceptionhandling.SilentExceptionHandler 2 1 0 2
org.springframework.richclient.exceptionhandling.LogLevel 1 0 0 0
org.springframework.richclient.exceptionhandling.ShutdownPolicy 1 0 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.springframework.binding.validation.support.HibernateRulesValidator 56 11 0 9
org.springframework.richclient.exceptionhandling.delegation.AbstractExceptionHandlerDelegate 27 10 0 4
org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler 51 9 0 3
org.springframework.richclient.exceptionhandling.delegation.DefaultExceptionPurger 40 9 0 5
org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler 39 7 0 4
org.springframework.binding.support.AnnotationAwareBeanPropertyAccessStrategy 22 6 0 1
org.springframework.richclient.jnlp.JnlpPropertyPlaceholderConfigurer 36 6 0 6
org.springframework.richclient.exceptionhandling.JXErrorDialogExceptionHandler 59 6 0 7
org.springframework.richclient.exceptionhandling.delegation.ChainInspectingExceptionHandlerDelegate 67 6 1 1
org.springframework.richclient.exceptionhandling.delegation.SimpleExceptionHandlerDelegate 17 6 0 1
org.springframework.richclient.exceptionhandling.EmailNotifierErrorReporter 38 6 0 1
org.springframework.richclient.exceptionhandling.AbstractLoggingExceptionHandler 37 5 0 6
org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler 18 4 0 4
org.springframework.binding.validation.support.HibernateRulesMessageInterpolator 20 3 0 4
org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder 50 3 2 1
org.springframework.richclient.table.renderer.TigerEnumTableCellRenderer 9 2 0 2
org.springframework.richclient.exceptionhandling.HibernateValidatorDialogExceptionHandler 27 2 0 1
org.springframework.binding.support.ReflectionAnnotationTranslator 21 1 0 1
org.springframework.binding.support.AnnotationTranslator 2 1 0 2
org.springframework.richclient.util.AnnotationUtils 10 1 0 2
org.springframework.richclient.exceptionhandling.delegation.ExceptionHandlerDelegate 2 1 0 2
org.springframework.richclient.exceptionhandling.delegation.ExceptionPurger 2 1 0 2
org.springframework.richclient.exceptionhandling.AbstractRegisterableExceptionHandler 4 1 0 2
org.springframework.richclient.exceptionhandling.SilentExceptionHandler 2 1 0 2
org.springframework.richclient.exceptionhandling.LogLevel 1 0 0 0
org.springframework.richclient.exceptionhandling.ShutdownPolicy 1 0 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
25.31 808.00 0.12 4.15 2.81

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.springframework.richclient.exceptionhandling.JXErrorDialogExceptionHandler.getDetailsAsHTML(String,Level,Throwable) 30 6 1
org.springframework.richclient.exceptionhandling.HibernateValidatorDialogExceptionHandler.createExceptionContent(Throwable) 22 4 0
org.springframework.richclient.exceptionhandling.AbstractLoggingExceptionHandler.logException(Thread,Throwable) 22 7 1
org.springframework.binding.validation.support.HibernateRulesValidator.doHibernateValidate(Object,String) 20 13 1
org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.notifyUserAboutException(Thread,Throwable) 20 8 0
org.springframework.binding.support.ReflectionAnnotationTranslator.translate(Annotation,Map) 19 10 0
org.springframework.richclient.exceptionhandling.EmailNotifierErrorReporter.reportError(ErrorInfo) 16 5 0
org.springframework.richclient.exceptionhandling.delegation.ChainInspectingExceptionHandlerDelegate.findChainPartThrowable(ChainPart,Throwable) 15 9 0
org.springframework.richclient.exceptionhandling.JXErrorDialogExceptionHandler.resolveMessageType() 14 11 1
org.springframework.richclient.exceptionhandling.delegation.ChainInspectingExceptionHandlerDelegate.hasAppropriateHandlerPurged(Throwable) 14 7 0
org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler.formatMessage(String) 13 5 0
org.springframework.richclient.exceptionhandling.delegation.DefaultExceptionPurger.purge(Throwable) 13 8 0
org.springframework.richclient.exceptionhandling.AbstractDialogExceptionHandler.resolveMessageType() 12 9 0
org.springframework.binding.validation.support.HibernateRulesMessageInterpolator.interpolate(String,Validator,MessageInterpolator) 11 7 1
org.springframework.richclient.jnlp.JnlpPropertyPlaceholderConfigurer.getWebAppContextUrl() 11 3 1
org.springframework.richclient.util.AnnotationUtils.getAnnotationsFor(PropertyDescriptor) 9 5 1
org.springframework.richclient.jnlp.JnlpPropertyPlaceholderConfigurer.resolvePlaceholder(String,Properties) 9 4 0
org.springframework.richclient.exceptionhandling.MessagesDialogExceptionHandler.getMessagesKeys(Throwable,String) 9 4 0
org.springframework.binding.support.AnnotationAwareBeanPropertyAccessStrategy.getAllUserMetadataFor(String) 8 2 0
org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder.TigerEnumComboBoxEditor.setItem(Object) 8 2 0
org.springframework.richclient.exceptionhandling.delegation.DelegatingExceptionHandler.uncaughtException(Thread,Throwable) 8 5 1
org.springframework.binding.validation.support.HibernateRulesValidator.validate(Object,String) 7 2 1
org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder.createListBinding(JComponent,FormModel,String) 7 1 0
org.springframework.richclient.exceptionhandling.JXErrorDialogExceptionHandler.notifyUserAboutException(Thread,Throwable) 7 2 1
org.springframework.richclient.exceptionhandling.EmailNotifierErrorReporter.getStackTraceString(Throwable) 7 1 0
org.springframework.richclient.form.binding.swing.TigerEnumComboBoxBinder.TigerEnumListRenderer.getTextValue(Object) 6 3 0
org.springframework.richclient.jnlp.JnlpPropertyPlaceholderConfigurer.resolvePlaceholder(String) 5 2 1
org.springframework.richclient.exceptionhandling.delegation.DefaultExceptionPurger.DefaultExceptionPurger(Class,Class) 5 3 0
org.springframework.richclient.exceptionhandling.delegation.DefaultExceptionPurger.DefaultExceptionPurger(List,List) 5 3 0
org.springframework.richclient.exceptionhandling.delegation.DefaultExceptionPurger.containedIn(Throwable,List) 5 4 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
808.00 4.52 2.13 0.39

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