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.cmd22864744219814332
net.sf.brico.util637272151192075
net.sf.brico.cmd.base7572077220105
net.sf.brico.cmd.base.form639190618090
net.sf.brico.cmd.support.spring9351779280135
net.sf.brico.cmd.base.filter424125412060
net.sf.brico.test22311326030
net.sf.brico.cmd.base.command521101516075
net.sf.brico.util.regexp52395515075
net.sf.brico.cmd.impl42073412060
net.sf.brico.cmd.support22826030
Classes totalFunctions totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
723671835101452341067

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSFunctionsClassesJavadocs
net.sf.brico.cmd.RequestHandler2982021
net.sf.brico.util.PropertiesBasedMessageManager1151006
net.sf.brico.util.ExceptionBuilder1021601
net.sf.brico.cmd.base.AbstractController852701
net.sf.brico.cmd.base.form.DynamicForm631201
net.sf.brico.test.OneTimeTestDecorator611411
net.sf.brico.cmd.support.spring.ApplicationContextAwareController471321
net.sf.brico.test.TestMethodCounter38901
net.sf.brico.cmd.impl.MapBackedController361401
net.sf.brico.cmd.base.filter.RegexpFilterInjector341201
net.sf.brico.cmd.ControllerConstants33001
net.sf.brico.util.regexp.RegexpMatcherHelper31701
net.sf.brico.cmd.base.filter.AbstractFilterRegistry29401
net.sf.brico.cmd.base.form.BeanFormWrapper281101
net.sf.brico.cmd.base.command.CommandForwarder27501
net.sf.brico.cmd.base.form.DynamicFormFactory24601
net.sf.brico.cmd.base.form.ClassNameFormFactory22501
net.sf.brico.cmd.base.DefaultContext20801
net.sf.brico.cmd.base.DefaultRequest20801
net.sf.brico.cmd.base.DefaultResponse20801
net.sf.brico.cmd.base.filter.DefaultFilterChain20501
net.sf.brico.cmd.base.form.PrototypeFormFactory20501
net.sf.brico.cmd.support.spring.SpringEnabledMessageManager18501
net.sf.brico.util.regexp.Perl5RegexpNameMatcher18401
net.sf.brico.cmd.support.spring.MorpherRegistryFactory17501
net.sf.brico.cmd.base.command.DefaultChain15501
net.sf.brico.cmd.Controller151401
net.sf.brico.cmd.support.spring.SpringEnabledDefaultChain15501
net.sf.brico.util.regexp.AbstractRegexpNameMatcher14501
net.sf.brico.util.regexp.JdkRegexpNameMatcher14401

TOP 30 classes containing the most functions.

ObjectNCSSFunctionsClassesJavadocs
net.sf.brico.cmd.base.AbstractController852701
net.sf.brico.cmd.RequestHandler2982021
net.sf.brico.util.ExceptionBuilder1021601
net.sf.brico.cmd.Controller151401
net.sf.brico.cmd.impl.MapBackedController361401
net.sf.brico.test.OneTimeTestDecorator611411
net.sf.brico.cmd.support.spring.ApplicationContextAwareController471321
net.sf.brico.cmd.base.filter.RegexpFilterInjector341201
net.sf.brico.cmd.base.form.DynamicForm631201
net.sf.brico.cmd.base.form.BeanFormWrapper281101
net.sf.brico.util.PropertiesBasedMessageManager1151006
net.sf.brico.test.TestMethodCounter38901
net.sf.brico.cmd.base.DefaultContext20801
net.sf.brico.cmd.base.DefaultRequest20801
net.sf.brico.cmd.base.DefaultResponse20801
net.sf.brico.util.regexp.RegexpMatcherHelper31701
net.sf.brico.cmd.base.command.DefaultChainHandler8601
net.sf.brico.cmd.base.form.DynamicFormFactory24601
net.sf.brico.cmd.ChainHandler7601
net.sf.brico.cmd.Context7607
net.sf.brico.cmd.Request7607
net.sf.brico.cmd.Response7607
net.sf.brico.cmd.base.command.CommandForwarder27501
net.sf.brico.cmd.base.command.DefaultChain15501
net.sf.brico.cmd.base.filter.DefaultFilterChain20501
net.sf.brico.cmd.base.form.ClassNameFormFactory22501
net.sf.brico.cmd.base.form.PrototypeFormFactory20501
net.sf.brico.cmd.support.spring.MorpherRegistryFactory17501
net.sf.brico.cmd.support.spring.SpringEnabledDefaultChain15501
net.sf.brico.cmd.support.spring.SpringEnabledMessageManager18501
Averages.
NCSS averageProgram NCSSClasses averageFunctions averageJavadocs average
20.681,835.000.075.101.40

Functions

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

TOP 30 functions containing the most NCSS.

FunctionsNCSSCCNJavadocs
net.sf.brico.cmd.RequestHandler.executeChainAsync(Chain,Request,Response)5850
net.sf.brico.util.PropertiesBasedMessageManager.getMessage(Locale,String)39111
net.sf.brico.cmd.RequestHandler.processRequest(Request,Response)38140
net.sf.brico.util.PropertiesBasedMessageManager.loadLocale(String)38151
net.sf.brico.cmd.RequestHandler.Runnable$1.run()3790
net.sf.brico.cmd.RequestHandler.executeChain(Chain,Request,Response)35110
net.sf.brico.util.ExceptionBuilder.createException(String,Object[],Throwable)2480
net.sf.brico.cmd.RequestHandler.processCommand(Request,Response)2240
net.sf.brico.cmd.RequestHandler.populateForm(Form,Map)20100
net.sf.brico.test.OneTimeTestDecorator.run(TestResult)2010
net.sf.brico.util.ExceptionBuilder.findExceptionClass(String)2070
net.sf.brico.cmd.base.AbstractController.init()1860
net.sf.brico.cmd.RequestHandler.executeCommandAsync(Command,Request,Form,Response)1820
net.sf.brico.cmd.RequestHandler.processFormFactory(Request,Response,Command)1840
net.sf.brico.cmd.RequestHandler.processCommandForm(Command,Request,Response)1770
net.sf.brico.test.OneTimeTestDecorator.Protectable$1.protect()1640
net.sf.brico.util.PropertiesBasedMessageManager.getMessage(String,Object[],Locale)1550
net.sf.brico.cmd.RequestHandler.processFormProperties(Request,Response,FormFactory,Form)1460
net.sf.brico.cmd.base.command.CommandForwarder.execute(Context,Request,Form,Response)1350
net.sf.brico.util.ExceptionBuilder.createException(String,Object[],Throwable,Map)1360
net.sf.brico.cmd.base.filter.AbstractFilterRegistry.getFilterChain(Command)1250
net.sf.brico.cmd.base.form.ClassNameFormFactory.createForm()1140
net.sf.brico.test.TestMethodCounter.TestMethodCounter(Class)1050
net.sf.brico.util.ExceptionBuilder.getMessage(String,Object[])1040
net.sf.brico.cmd.RequestHandler.Runnable$2.run()930
net.sf.brico.cmd.base.form.DynamicForm.contains(String,String)830
net.sf.brico.cmd.base.form.DynamicForm.get(String,int)830
net.sf.brico.cmd.base.form.DynamicForm.get(String,String)830
net.sf.brico.cmd.base.form.DynamicFormFactory.createForm()830
net.sf.brico.cmd.RequestHandler.getContext(Request)820

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,835.003.601.580.08

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