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.binding.value.support 23 196 1101 97 626 22 319
org.springframework.binding.support 3 31 228 30 213 3 52
org.springframework.binding.form 9 64 109 73 473 0 144
org.springframework.binding.format.support 2 24 71 2 19 2 0
org.springframework.binding.validation 7 21 59 26 132 0 118
org.springframework.binding.value 7 22 49 29 190 0 111
org.springframework.binding 3 12 24 15 116 0 48
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
54 370 1641 272 1769 27 792

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.springframework.binding.value.support.ListListModel 141 36 1 6
org.springframework.binding.support.AbstractPropertyAccessStrategy 136 18 4 18
org.springframework.binding.value.support.BufferedCollectionValueModel 132 14 1 5
org.springframework.binding.value.support.AbstractPropertyChangePublisher 116 31 0 1
org.springframework.binding.value.support.PropertyChangeSupport 100 12 0 11
org.springframework.binding.value.support.BufferedValueModel 88 15 2 17
org.springframework.binding.value.support.GrowableIndexAdapter 82 9 0 1
org.springframework.binding.format.support.StrictNumberFormat 54 23 0 1
org.springframework.binding.value.support.AbstractValueModel 47 13 0 11
org.springframework.binding.support.PropertyChangeSupportUtils 42 5 0 6
org.springframework.binding.value.support.TypeConverter 31 8 1 4
org.springframework.binding.value.support.MethodInvokingDerivedValueModel 28 4 0 1
org.springframework.binding.form.FormModel 26 21 0 22
org.springframework.binding.value.support.AbstractValueModelWrapper 24 9 0 1
org.springframework.binding.value.support.RefreshableValueHolder 22 5 0 6
org.springframework.binding.value.support.MessageFormatValueModel 22 5 0 3
org.springframework.binding.value.support.AbstractDerivedValueModel 22 6 1 6
org.springframework.binding.support.BeanPropertyAccessStrategy 21 8 0 6
org.springframework.binding.value.support.MapKeyAdapter 19 4 0 1
org.springframework.binding.value.support.AbstractValueModelAdapter 18 5 1 4
org.springframework.binding.value.support.ValueHolder 17 5 0 3
org.springframework.binding.validation.ValidationMessageComparator 16 2 0 1
org.springframework.binding.value.CommitTrigger 13 5 0 6
org.springframework.binding.form.FieldMetadata 12 8 0 9
org.springframework.binding.form.ValidatingFormModel 11 9 0 10
org.springframework.binding.value.support.DefaultValueChangeDetector 11 3 0 4
org.springframework.binding.value.support.PropertyAdapter 10 3 0 1
org.springframework.binding.validation.ValidationResults 10 9 0 10
org.springframework.binding.validation.ValidationResultsModel 10 6 0 7
org.springframework.binding.form.ConfigurableFormModel 9 8 0 9

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.springframework.binding.value.support.ListListModel 141 36 1 6
org.springframework.binding.value.support.AbstractPropertyChangePublisher 116 31 0 1
org.springframework.binding.format.support.StrictNumberFormat 54 23 0 1
org.springframework.binding.form.FormModel 26 21 0 22
org.springframework.binding.support.AbstractPropertyAccessStrategy 136 18 4 18
org.springframework.binding.value.support.BufferedValueModel 88 15 2 17
org.springframework.binding.value.support.BufferedCollectionValueModel 132 14 1 5
org.springframework.binding.value.support.AbstractValueModel 47 13 0 11
org.springframework.binding.value.support.PropertyChangeSupport 100 12 0 11
org.springframework.binding.form.ValidatingFormModel 11 9 0 10
org.springframework.binding.value.support.AbstractValueModelWrapper 24 9 0 1
org.springframework.binding.value.support.GrowableIndexAdapter 82 9 0 1
org.springframework.binding.validation.ValidationResults 10 9 0 10
org.springframework.binding.form.FieldMetadata 12 8 0 9
org.springframework.binding.form.ConfigurableFormModel 9 8 0 9
org.springframework.binding.value.support.TypeConverter 31 8 1 4
org.springframework.binding.support.BeanPropertyAccessStrategy 21 8 0 6
org.springframework.binding.form.FieldFace 8 7 0 8
org.springframework.binding.form.HierarchicalFormModel 7 6 0 7
org.springframework.binding.value.support.AbstractDerivedValueModel 22 6 1 6
org.springframework.binding.validation.ValidationResultsModel 10 6 0 7
org.springframework.binding.PropertyMetadataAccessStrategy 6 5 0 6
org.springframework.binding.value.support.AbstractValueModelAdapter 18 5 1 4
org.springframework.binding.value.support.RefreshableValueHolder 22 5 0 6
org.springframework.binding.value.support.MessageFormatValueModel 22 5 0 3
org.springframework.binding.value.support.ValueHolder 17 5 0 3
org.springframework.binding.value.ValueModel 7 5 0 6
org.springframework.binding.value.CommitTrigger 13 5 0 6
org.springframework.binding.support.PropertyChangeSupportUtils 42 5 0 6
org.springframework.binding.MutablePropertyAccessStrategy 5 4 0 5

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
25.72 1,641.00 0.20 6.85 5.04

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.springframework.binding.value.support.BufferedCollectionValueModel.getConcreteCollectionType(Class) 26 12 0
org.springframework.binding.value.support.GrowableIndexAdapter.setCollectionValue(int,Object) 26 10 0
org.springframework.binding.value.support.GrowableIndexAdapter.getCollectionValue(int) 21 11 0
org.springframework.binding.value.support.BufferedCollectionValueModel.updateBufferedListModel(Object) 20 6 1
org.springframework.binding.value.support.BufferedCollectionValueModel.hasSameStructure() 19 14 1
org.springframework.binding.value.support.PropertyChangeSupport.firePropertyChange(PropertyChangeEvent) 17 10 1
org.springframework.binding.support.PropertyChangeSupportUtils.addPropertyChangeListener(Object,String,PropertyChangeListener) 15 8 1
org.springframework.binding.support.PropertyChangeSupportUtils.removePropertyChangeListener(Object,String,PropertyChangeListener) 15 8 1
org.springframework.binding.support.AbstractPropertyAccessStrategy.getLastPropertySeparatorIndex(String) 14 8 1
org.springframework.binding.value.support.PropertyChangeSupport.getPropertyChangeListeners() 13 5 1
org.springframework.binding.value.support.GrowableIndexAdapter.growCollectionIfNeccessary(int) 13 7 0
org.springframework.binding.validation.ValidationMessageComparator.compare(Object,Object) 13 5 0
org.springframework.binding.value.support.BufferedCollectionValueModel.createNewCollection(Object) 12 8 0
org.springframework.binding.support.AbstractPropertyAccessStrategy.PropertyValueModel.updateBeanPropertyChangeListener() 12 5 1
org.springframework.binding.value.support.AbstractValueModel.fireValueChangeEvent(Object,Object) 11 5 1
org.springframework.binding.value.support.BufferedValueModel.setCommitTrigger(CommitTrigger) 11 6 1
org.springframework.binding.value.support.BufferedCollectionValueModel.populateFromListModel(Object) 10 3 0
org.springframework.binding.value.support.MethodInvokingDerivedValueModel.getPropertyMethod(Object,String,int) 10 6 0
org.springframework.binding.value.support.ListListModel.replaceWith(Collection) 10 5 1
org.springframework.binding.support.AbstractPropertyAccessStrategy.PropertyValueModel.PropertyValueModel(ValueModel,String) 10 2 0
org.springframework.binding.value.support.BufferedValueModel.commit() 9 4 1
org.springframework.binding.value.support.BufferedCollectionValueModel.BufferedCollectionValueModel(ValueModel,Class) 8 2 1
org.springframework.binding.value.support.PropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener) 8 3 1
org.springframework.binding.value.support.PropertyChangeSupport.removePropertyChangeListener(PropertyChangeListener) 8 4 1
org.springframework.binding.value.support.PropertyChangeSupport.addPropertyChangeListener(String,PropertyChangeListener) 8 3 1
org.springframework.binding.value.support.PropertyChangeSupport.hasListeners(String) 8 7 1
org.springframework.binding.value.support.PropertyChangeSupport.writeObject(ObjectOutputStream) 8 5 0
org.springframework.binding.value.support.BufferedValueModel.revert() 8 4 1
org.springframework.binding.value.support.GrowableIndexAdapter.growArrayIfNeccessary(int) 8 3 0
org.springframework.binding.support.AbstractPropertyAccessStrategy.getFullPropertyPath(String) 8 5 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,641.00 3.14 1.72 0.53

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