JavaNCSS Metric Results

[ package ] [ object ] [ function ] [ explanation ]

The following document contains the results of a JavaNCSS metric analysis.
JavaNCSS web site.

Packages

[ package ] [ object ] [ function ] [ explanation ]

Packages sorted by NCSS.

PackageClassesFunctionsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
net.sf.brico.forms.view.action149039614420210
net.sf.brico.forms.view98833992713135
net.sf.brico.forms.view.support.propertyeditor9222449270135
net.sf.brico.forms.view.resources32820039045
net.sf.brico.forms.model22215826230
net.sf.brico.forms.view.support.spring1157913015
net.sf.brico.forms.view.components184613015
net.sf.brico.forms.model.support.spring152713015
Classes totalFunctions totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
4027814894012015600

Objects

[ package ] [ object ] [ function ] [ explanation ]

TOP 30 classes containing the most NCSS.

ObjectNCSSFunctionsClassesJavadocs
net.sf.brico.forms.view.resources.UIResourceManager1422301
net.sf.brico.forms.model.Model1372121
net.sf.brico.forms.view.AbstractViewForm1193001
net.sf.brico.forms.view.AbstractDialog891901
net.sf.brico.forms.view.support.propertyeditor.ColorEditor76301
net.sf.brico.forms.view.support.spring.CommandAwareActionBinderFactoryBean631501
net.sf.brico.forms.view.support.propertyeditor.FontEditor43501
net.sf.brico.forms.view.components.OrderedFocusTraversalPolicy38801
net.sf.brico.forms.view.action.AbstractViewFormAction371111
net.sf.brico.forms.view.action.AbstractLockingStatefulCommandAction35901
net.sf.brico.forms.view.action.AbstractStatefulCommandAction35901
net.sf.brico.forms.view.action.AbstractLockingCommandAction34801
net.sf.brico.forms.view.action.AbstractViewFormActionWrapper341501
net.sf.brico.forms.view.action.CommandAction34801
net.sf.brico.forms.model.support.spring.ModelAttributeBinder23501
net.sf.brico.forms.view.AbstractWindow22801
net.sf.brico.forms.view.action.AbstractLockingStatefulAction22701
net.sf.brico.forms.view.action.AbstractStatefulAction22701
net.sf.brico.forms.view.support.propertyeditor.DimensionEditor17201
net.sf.brico.forms.view.support.propertyeditor.PointEditor17201
net.sf.brico.forms.view.support.propertyeditor.RectangleEditor17201
net.sf.brico.forms.view.EventType16501
net.sf.brico.forms.view.support.propertyeditor.InsetsEditor16201
net.sf.brico.forms.view.ViewForm161501
net.sf.brico.forms.view.ViewFormEvent16401
net.sf.brico.forms.view.action.AbstractLockingAction14401
net.sf.brico.forms.view.resources.UIResourceManagerFactoryBean14501
net.sf.brico.forms.view.support.propertyeditor.AbstractPropertyEditor13201
net.sf.brico.forms.view.action.ViewFormActionListenerActionAdapter10301
net.sf.brico.forms.view.resources.UIResourceConstants10001

TOP 30 classes containing the most functions.

ObjectNCSSFunctionsClassesJavadocs
net.sf.brico.forms.view.AbstractViewForm1193001
net.sf.brico.forms.view.resources.UIResourceManager1422301
net.sf.brico.forms.model.Model1372121
net.sf.brico.forms.view.AbstractDialog891901
net.sf.brico.forms.view.action.AbstractViewFormActionWrapper341501
net.sf.brico.forms.view.support.spring.CommandAwareActionBinderFactoryBean631501
net.sf.brico.forms.view.ViewForm161501
net.sf.brico.forms.view.action.AbstractViewFormAction371111
net.sf.brico.forms.view.action.AbstractLockingStatefulCommandAction35901
net.sf.brico.forms.view.action.AbstractStatefulCommandAction35901
net.sf.brico.forms.view.AbstractWindow22801
net.sf.brico.forms.view.action.AbstractLockingCommandAction34801
net.sf.brico.forms.view.action.CommandAction34801
net.sf.brico.forms.view.components.OrderedFocusTraversalPolicy38801
net.sf.brico.forms.view.action.AbstractLockingStatefulAction22701
net.sf.brico.forms.view.action.AbstractStatefulAction22701
net.sf.brico.forms.model.support.spring.ModelAttributeBinder23501
net.sf.brico.forms.view.EventType16501
net.sf.brico.forms.view.resources.UIResourceManagerFactoryBean14501
net.sf.brico.forms.view.support.propertyeditor.FontEditor43501
net.sf.brico.forms.view.ViewFormAction6501
net.sf.brico.forms.view.action.AbstractLockingAction14401
net.sf.brico.forms.view.action.CommandAwareAction5401
net.sf.brico.forms.view.ViewFormEvent16401
net.sf.brico.forms.view.action.ViewFormActionListenerActionAdapter10301
net.sf.brico.forms.view.support.propertyeditor.ColorEditor76301
net.sf.brico.forms.view.action.AbstractViewFormActionListener6201
net.sf.brico.forms.view.action.KeyAwareAction3201
net.sf.brico.forms.view.support.propertyeditor.AbstractPropertyEditor13201
net.sf.brico.forms.view.support.propertyeditor.ColumnSpecEditor8201
Averages.
NCSS averageProgram NCSSClasses averageFunctions averageJavadocs average
30.631,489.000.086.951.00

Functions

[ package ] [ object ] [ function ] [ explanation ]

TOP 30 functions containing the most NCSS.

FunctionsNCSSCCNJavadocs
net.sf.brico.forms.view.support.propertyeditor.ColorEditor.setAsText(String)62220
net.sf.brico.forms.view.resources.UIResourceManager.loadImage(String)2690
net.sf.brico.forms.view.AbstractViewForm.buildUI()2490
net.sf.brico.forms.view.support.spring.CommandAwareActionBinderFactoryBean.afterPropertiesSet()23140
net.sf.brico.forms.model.Model.bindAttribute(String,Object,String,Transformer)1360
net.sf.brico.forms.view.AbstractDialog.assemble()1350
net.sf.brico.forms.view.support.propertyeditor.FontEditor.getStyle(String)1390
net.sf.brico.forms.model.Model.set(String,Object)1250
net.sf.brico.forms.view.AbstractDialog.doAssemble(JPanel,JPanel,JPanel)1230
net.sf.brico.forms.model.Model.bindAttribute(String,Closure)1140
net.sf.brico.forms.view.support.propertyeditor.DimensionEditor.setAsText(String)1140
net.sf.brico.forms.view.support.propertyeditor.PointEditor.setAsText(String)1140
net.sf.brico.forms.view.support.propertyeditor.RectangleEditor.setAsText(String)1140
net.sf.brico.forms.model.support.spring.ModelAttributeBinder.afterPropertiesSet()1090
net.sf.brico.forms.view.support.propertyeditor.FontEditor.setAsText(String)1040
net.sf.brico.forms.view.support.propertyeditor.InsetsEditor.setAsText(String)1040
net.sf.brico.forms.view.AbstractViewForm.setActions(Map)940
net.sf.brico.forms.view.action.AbstractLockingCommandAction.doInLock(ActionEvent)920
net.sf.brico.forms.view.action.AbstractLockingStatefulAction.doInLock(ActionEvent)930
net.sf.brico.forms.view.action.AbstractLockingStatefulCommandAction.doWhenEnabled(ActionEvent)920
net.sf.brico.forms.view.action.AbstractStatefulAction.processActionEvent(ActionEvent)930
net.sf.brico.forms.view.action.AbstractStatefulCommandAction.doWhenEnabled(ActionEvent)920
net.sf.brico.forms.view.action.CommandAction.processActionEvent(ActionEvent)920
net.sf.brico.forms.view.resources.UIResourceManager.loadSound(String)930
net.sf.brico.forms.view.support.propertyeditor.FontEditor.getStyle(int)970
net.sf.brico.forms.view.AbstractDialog.preProcessAssemble()830
net.sf.brico.forms.model.Model.bindAttribute(String,Object,Object[][])780
net.sf.brico.forms.model.Model.BeanPropertySpec.equals(Object)750
net.sf.brico.forms.model.Model.BeanPropertySpec.setValue(Object)750
net.sf.brico.forms.view.AbstractDialog.setOwner(Dialog)730

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,489.003.731.800.00

Explanations

[ package ] [ object ] [ function ] [ 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.

ExamplesComments
Package declarationpackage java.lang;
Import declarationimport java.awt.*;
Class declaration
  • public class Foo {
  • public class Foo extends Bla {
Interface declarationpublic interface Able ; {
Field declaration
  • int a;
  • int a, b, c = 5, d = 6;
Method declaration
  • public void cry();
  • public void gib() throws DeadException {
Constructor declarationpublic Foo() {
Constructor invocation
  • this();
  • super();
Statement declaration
  • i = 0;
  • if (ok)
  • if (exit) {
  • if (3 == 4);
  • if (4 == 4) { ;
  • } else {
expression, if, else, while, do, for, switch, break, continue, return, throw, synchronized, catch, finally
Label declarationfine :normal, case, default
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 (no matter if it's a function or a procedure) will not be counted.Note that else, default, and finallydon't increment the CCN value any further. On the other hand, a simple method with a switchstatement and a huge block of casestatements can have a surprisingly high CCN value (still it has the same value when converting a switchblock to an equivalent sequence of ifstatements).The first article about this trivial software metric is one of the most cited papers in computer science. Sometimes you just must be the first to point out some basic shit and you are history. It seems just like a wonder that nobody was able to package Lines of Code in a more scientific manner. Now it's too late to label someone's name on it :).