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.form 7 117 645 97 553 57 138
org.springframework.richclient.beans 4 70 567 30 170 12 60
org.springframework.richclient.table.support 3 61 420 49 342 20 67
org.springframework.richclient.settings 7 124 342 20 131 0 285
org.springframework.richclient.settings.support 8 48 309 6 30 2 60
org.springframework.richclient.settings.xml 6 40 255 18 106 1 93
org.springframework.richclient.preference 5 45 200 8 34 3 75
org.springframework.richclient.core 1 34 184 24 163 0 15
org.springframework.richclient.list 4 38 158 19 70 0 60
org.springframework.richclient.settings.jdbc 4 25 149 5 19 6 60
org.springframework.richclient.settings.j2seprefs 4 33 137 7 32 2 76
org.springframework.richclient.context.support 5 22 117 1 11 0 2
org.springframework.binding.value.support 2 14 115 11 86 9 60
org.springframework.richclient.util 3 12 102 1 5 2 15
org.springframework.binding.support 2 19 61 14 104 0 30
org.springframework.richclient.form.builder 1 3 60 1 3 0 15
org.springframework.rules.metadata 1 5 44 1 5 0 15
org.springframework.rules.constraint.property 1 5 28 2 16 0 15
org.springframework.richclient.application.support 1 3 15 4 41 0 15
org.springframework.richclient.context.test 3 3 14 0 0 0 0
org.springframework.richclient.context 1 0 3 0 0 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
73 721 3925 318 1921 114 1156

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.springframework.richclient.form.AbstractMasterForm 245 38 9 53
org.springframework.richclient.beans.AbstractMemberPropertyAccessor 233 29 0 24
org.springframework.richclient.settings.AbstractSettings 210 56 0 3
org.springframework.richclient.table.support.AbstractObjectTable 189 38 7 32
org.springframework.richclient.beans.DefaultMemberPropertyAccessor 173 19 0 1
org.springframework.richclient.core.GenericCollectionTypeResolver 172 34 0 24
org.springframework.richclient.form.AbstractDetailForm 123 23 1 16
org.springframework.richclient.settings.support.TableMemento 115 13 0 1
org.springframework.richclient.list.TableListCellRenderer 103 24 1 16
org.springframework.richclient.table.support.GlazedTableModel 100 14 2 14
org.springframework.richclient.settings.xml.XmlSettings 95 18 0 1
org.springframework.richclient.settings.jdbc.JdbcSettings 91 15 0 1
org.springframework.richclient.beans.AbstractNestedMemberPropertyAccessor 89 17 1 1
org.springframework.richclient.form.AbstractTableMasterForm 84 21 1 20
org.springframework.binding.value.support.ObservableEventList 70 11 1 7
org.springframework.richclient.table.support.ResizeTableColumnSupport 68 9 2 3
org.springframework.richclient.preference.PreferencePage 64 18 2 6
org.springframework.richclient.settings.support.TreeMemento 63 10 0 2
org.springframework.richclient.settings.j2seprefs.PreferencesSettings 53 14 0 4
org.springframework.richclient.form.GeneratedForm 53 21 0 2
org.springframework.richclient.settings.Settings 47 46 0 5
org.springframework.richclient.settings.support.WindowMemento 44 12 0 1
org.springframework.richclient.settings.xml.FileSystemXmlSettingsReaderWriter 42 6 0 4
org.springframework.richclient.form.builder.HtmlFormBuilder 41 3 2 1
org.springframework.richclient.preference.PreferenceManager 36 7 0 2
org.springframework.richclient.preference.PreferenceDialog 35 9 0 0
org.springframework.richclient.util.FontSizeAdjuster 34 7 1 0
org.springframework.rules.metadata.AttributesRulesSource 33 5 0 1
org.springframework.richclient.util.AdjustFontSizeCommand 30 4 0 0
org.springframework.richclient.settings.j2seprefs.PreferencesSettingsFactory 29 6 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.springframework.richclient.settings.AbstractSettings 210 56 0 3
org.springframework.richclient.settings.Settings 47 46 0 5
org.springframework.richclient.table.support.AbstractObjectTable 189 38 7 32
org.springframework.richclient.form.AbstractMasterForm 245 38 9 53
org.springframework.richclient.core.GenericCollectionTypeResolver 172 34 0 24
org.springframework.richclient.beans.AbstractMemberPropertyAccessor 233 29 0 24
org.springframework.richclient.list.TableListCellRenderer 103 24 1 16
org.springframework.richclient.form.AbstractDetailForm 123 23 1 16
org.springframework.richclient.form.AbstractTableMasterForm 84 21 1 20
org.springframework.richclient.form.GeneratedForm 53 21 0 2
org.springframework.richclient.beans.DefaultMemberPropertyAccessor 173 19 0 1
org.springframework.richclient.settings.xml.XmlSettings 95 18 0 1
org.springframework.richclient.preference.PreferencePage 64 18 2 6
org.springframework.richclient.beans.AbstractNestedMemberPropertyAccessor 89 17 1 1
org.springframework.richclient.settings.jdbc.JdbcSettings 91 15 0 1
org.springframework.richclient.table.support.GlazedTableModel 100 14 2 14
org.springframework.richclient.settings.j2seprefs.PreferencesSettings 53 14 0 4
org.springframework.richclient.settings.support.TableMemento 115 13 0 1
org.springframework.richclient.settings.TransientSettings 23 12 0 1
org.springframework.richclient.settings.support.WindowMemento 44 12 0 1
org.springframework.richclient.settings.j2seprefs.TransientPreferences 27 11 0 1
org.springframework.binding.value.support.ObservableEventList 70 11 1 7
org.springframework.richclient.settings.support.TreeMemento 63 10 0 2
org.springframework.binding.support.ClassPropertyAccessStrategy 25 10 0 7
org.springframework.richclient.table.support.ResizeTableColumnSupport 68 9 2 3
org.springframework.richclient.context.support.DefaultRichClientApplicationContext 21 9 0 0
org.springframework.richclient.preference.PreferenceDialog 35 9 0 0
org.springframework.binding.support.ObjectPropertyAccessStrategy 22 9 0 7
org.springframework.richclient.preference.FormBackedPreferencePage 21 8 0 0
org.springframework.richclient.settings.jdbc.JdbcSettingsFactory 25 7 0 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
45.63 3,925.00 0.41 9.88 4.36

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.springframework.richclient.form.AbstractTableMasterForm.createFormControl() 35 10 0
org.springframework.richclient.beans.AbstractMemberPropertyAccessor.getPropertyType(String) 33 18 1
org.springframework.richclient.beans.DefaultMemberPropertyAccessor.getPropertyValue(Object,Object[],int) 28 16 0
org.springframework.richclient.list.TableListCellRenderer.getListCellRendererComponent(JList,Object,int,boolean,boolean) 27 9 0
org.springframework.richclient.beans.AbstractMemberPropertyAccessor.setAssemblageValue(Class,Object,Object,Object) 27 9 1
org.springframework.richclient.settings.support.TableMemento.restoreSelectedRows(Settings) 26 9 0
org.springframework.richclient.core.GenericCollectionTypeResolver.extractType(Type,Class,int) 25 16 0
org.springframework.richclient.core.GenericCollectionTypeResolver.getActualType(ParameterizedType,Class,int) 22 14 0
org.springframework.richclient.settings.jdbc.JdbcSettings.save() 21 7 0
org.springframework.richclient.beans.DefaultMemberPropertyAccessor.getIndexedPropertyValue(String) 21 13 0
org.springframework.richclient.settings.xml.FileSystemXmlSettingsReaderWriter.read(String) 20 11 0
org.springframework.richclient.form.AbstractDetailForm.updateControlsForState() 20 4 1
org.springframework.richclient.table.support.AbstractObjectTable.createControl() 19 2 0
org.springframework.richclient.beans.AbstractMemberPropertyAccessor.introspectMethods(Class,Set) 19 13 1
org.springframework.richclient.beans.AbstractMemberPropertyAccessor.getIndexedPropertyKeyType(String) 19 11 1
org.springframework.richclient.beans.DefaultMemberPropertyAccessor.setIndexedPropertyValue(String,Object) 19 10 0
org.springframework.richclient.form.AbstractMasterForm.ListSelectionHandler.maybeChangeSelection(int) 19 4 0
org.springframework.binding.value.support.DeepCopyBufferedCollectionValueModel.deepCopy(Object) 18 6 1
org.springframework.richclient.table.support.GlazedTableModel.DefaultAdvancedTableFormat.getColumnClass(int) 17 7 1
org.springframework.richclient.core.GenericCollectionTypeResolver.toClass(Type) 17 11 0
org.springframework.richclient.beans.DefaultMemberPropertyAccessor.getSimplePropertyValue(String) 17 12 0
org.springframework.richclient.beans.DefaultMemberPropertyAccessor.setSimplePropertyValue(String,Object) 17 10 0
org.springframework.richclient.form.AbstractMasterForm.maybeCreateNewObject() 17 4 1
org.springframework.richclient.table.support.AbstractObjectTable.updateStatusBar() 16 6 0
org.springframework.richclient.settings.support.ArrayUtil.asIntervalString(int[]) 16 7 0
org.springframework.richclient.core.GenericCollectionTypeResolver.getGenericIndexedValueType(Type,int) 16 6 0
org.springframework.richclient.settings.xml.XmlSettings.internalCreateChild(String) 15 6 0
org.springframework.richclient.preference.PreferenceManager.showDialog() 15 6 0
org.springframework.richclient.settings.support.TreeMemento.restoreSelectionState(Settings) 14 5 0
org.springframework.richclient.settings.support.TableMemento.restoreColumnWidths(Settings) 14 5 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
3,925.00 3.94 1.88 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).

 
2004-2009 © The Spring Framework