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.samples.dataeditor.ui 11 46 444 0 0 7 0
org.springframework.richclient.samples.dataeditor.domain 6 37 141 0 0 0 0
org.springframework.richclient.samples.dataeditor.app 2 3 37 0 0 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
19 86 622 0 0 7 0

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.springframework.richclient.samples.dataeditor.ui.FormTester 123 5 3 0
org.springframework.richclient.samples.dataeditor.ui.DataEditorSplash 78 6 1 0
org.springframework.richclient.samples.dataeditor.domain.Supplier 35 13 0 0
org.springframework.richclient.samples.dataeditor.ui.SupplierDataProvider 27 10 0 0
org.springframework.richclient.samples.dataeditor.ui.ItemDataProvider 25 10 0 0
org.springframework.richclient.samples.dataeditor.domain.Item 23 9 0 0
org.springframework.richclient.samples.dataeditor.domain.SupplierService 22 3 0 0
org.springframework.richclient.samples.dataeditor.domain.ItemService 20 3 0 0
org.springframework.richclient.samples.dataeditor.ui.SupplierFilterForm 17 4 0 0
org.springframework.richclient.samples.dataeditor.ui.ItemFilterForm 16 3 0 0
org.springframework.richclient.samples.dataeditor.domain.SupplierFilter 16 5 0 0
org.springframework.richclient.samples.dataeditor.app.DataEditorApplicationLifecycleAdvisor 15 2 1 0
org.springframework.richclient.samples.dataeditor.ui.SupplierBinder 13 2 1 0
org.springframework.richclient.samples.dataeditor.ui.ItemForm 12 2 0 0
org.springframework.richclient.samples.dataeditor.domain.ItemFilter 11 4 0 0
org.springframework.richclient.samples.dataeditor.app.DataEditorApp 10 1 0 0
org.springframework.richclient.samples.dataeditor.ui.ItemDataEditor 10 1 0 0
org.springframework.richclient.samples.dataeditor.ui.SupplierForm 10 2 0 0
org.springframework.richclient.samples.dataeditor.ui.SupplierDataEditor 8 1 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.springframework.richclient.samples.dataeditor.domain.Supplier 35 13 0 0
org.springframework.richclient.samples.dataeditor.ui.ItemDataProvider 25 10 0 0
org.springframework.richclient.samples.dataeditor.ui.SupplierDataProvider 27 10 0 0
org.springframework.richclient.samples.dataeditor.domain.Item 23 9 0 0
org.springframework.richclient.samples.dataeditor.ui.DataEditorSplash 78 6 1 0
org.springframework.richclient.samples.dataeditor.ui.FormTester 123 5 3 0
org.springframework.richclient.samples.dataeditor.domain.SupplierFilter 16 5 0 0
org.springframework.richclient.samples.dataeditor.ui.SupplierFilterForm 17 4 0 0
org.springframework.richclient.samples.dataeditor.domain.ItemFilter 11 4 0 0
org.springframework.richclient.samples.dataeditor.ui.ItemFilterForm 16 3 0 0
org.springframework.richclient.samples.dataeditor.domain.ItemService 20 3 0 0
org.springframework.richclient.samples.dataeditor.domain.SupplierService 22 3 0 0
org.springframework.richclient.samples.dataeditor.app.DataEditorApplicationLifecycleAdvisor 15 2 1 0
org.springframework.richclient.samples.dataeditor.ui.SupplierBinder 13 2 1 0
org.springframework.richclient.samples.dataeditor.ui.ItemForm 12 2 0 0
org.springframework.richclient.samples.dataeditor.ui.SupplierForm 10 2 0 0
org.springframework.richclient.samples.dataeditor.app.DataEditorApp 10 1 0 0
org.springframework.richclient.samples.dataeditor.ui.ItemDataEditor 10 1 0 0
org.springframework.richclient.samples.dataeditor.ui.SupplierDataEditor 8 1 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
25.84 622.00 0.32 4.53 0.00

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.springframework.richclient.samples.dataeditor.ui.FormTester.showFormDialog(AbstractForm,boolean) 98 1 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.AbstractTitledWidget$1.createWidgetContent() 83 2 0
org.springframework.richclient.samples.dataeditor.ui.DataEditorSplash.getProgressMonitor() 19 1 0
org.springframework.richclient.samples.dataeditor.ui.DataEditorSplash.createContentPane() 16 2 0
org.springframework.richclient.samples.dataeditor.ui.DataEditorSplash.splash() 16 2 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.createJFrame(AbstractForm) 16 1 0
org.springframework.richclient.samples.dataeditor.ui.DataEditorSplash.DataEditorSplash() 14 1 0
org.springframework.richclient.samples.dataeditor.ui.ItemFilterForm.createFormControl() 11 1 0
org.springframework.richclient.samples.dataeditor.app.DataEditorApplicationLifecycleAdvisor.onPreStartup() 10 2 0
org.springframework.richclient.samples.dataeditor.ui.SupplierBinder.getLookupBinding(FormModel,String,Map) 10 1 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.AbstractTitledWidget$1.AbstractProperty$3.getValue() 9 5 0
org.springframework.richclient.samples.dataeditor.ui.ItemDataEditor.ItemDataEditor(ItemDataProvider) 9 1 0
org.springframework.richclient.samples.dataeditor.ui.ItemForm.getTabs() 9 1 0
org.springframework.richclient.samples.dataeditor.app.DataEditorApp.main(String[]) 8 2 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.AbstractTitledWidget$1.Runnable$4.run() 8 3 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.AbstractTitledWidget$1.Runnable$6.run() 8 3 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.AbstractTitledWidget$1.Runnable$9.run() 8 3 0
org.springframework.richclient.samples.dataeditor.ui.SupplierDataProvider.getList(Object) 8 6 0
org.springframework.richclient.samples.dataeditor.domain.SupplierService.checkFilter(Supplier,SupplierFilter) 8 4 0
org.springframework.richclient.samples.dataeditor.ui.SupplierFilterForm.createFormControl() 7 1 0
org.springframework.richclient.samples.dataeditor.ui.SupplierForm.getTabs() 7 1 0
org.springframework.richclient.samples.dataeditor.ui.DataEditorSplash.ProgressMonitor$1.taskStarted(String,int) 6 1 0
org.springframework.richclient.samples.dataeditor.ui.ItemDataProvider.getList(Object) 6 4 0
org.springframework.richclient.samples.dataeditor.domain.ItemService.findItems(ItemFilter) 6 3 0
org.springframework.richclient.samples.dataeditor.domain.ItemService.checkFilter(Item,ItemFilter) 6 3 0
org.springframework.richclient.samples.dataeditor.domain.SupplierService.findSuppliers(SupplierFilter) 6 3 0
org.springframework.richclient.samples.dataeditor.domain.Supplier.Supplier(String,String,String,String,String) 6 1 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.AbstractTitledWidget$1.DefaultCellRenderer$8.convertToString(Object) 5 3 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.AbstractTitledWidget$1.getCommands() 5 1 0
org.springframework.richclient.samples.dataeditor.ui.FormTester.AbstractTitledWidget$12.createWidgetContent() 5 1 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
622.00 5.26 1.32 0.00

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