JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 33.54.
JavaNCSS web site.

Packages

Packages

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

Packages sorted by NCSS.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
org.apache.myfaces.tobago.example.test 48 227 1134 1 3 36 883
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
48 227 1134 1 3 36 883

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.example.test.ClientConfigController 65 14 0 0
org.apache.myfaces.tobago.example.test.SheetSortController 63 3 1 0
org.apache.myfaces.tobago.example.test.SelectManyListboxBean 46 18 0 0
org.apache.myfaces.tobago.example.test.PopupReferenceController 43 6 1 0
org.apache.myfaces.tobago.example.test.DirectoryBrowser 41 5 0 0
org.apache.myfaces.tobago.example.test.PageItem 36 9 0 0
org.apache.myfaces.tobago.example.test.MeasureBean 35 14 1 0
org.apache.myfaces.tobago.example.test.ResourceEntry 35 11 0 0
org.apache.myfaces.tobago.example.test.SelectBooleanCheckboxBean 31 12 0 0
org.apache.myfaces.tobago.example.test.Partially 28 7 0 0
org.apache.myfaces.tobago.example.test.TestPageFilter 28 3 0 0
org.apache.myfaces.tobago.example.test.Immediate 25 8 0 0
org.apache.myfaces.tobago.example.test.Tobago1041 25 2 0 0
org.apache.myfaces.tobago.example.test.TreeController 24 8 0 0
org.apache.myfaces.tobago.example.test.DynamicBean 21 3 0 0
org.apache.myfaces.tobago.example.test.TestExceptionHandler 21 3 0 0
org.apache.myfaces.tobago.example.test.SheetController 20 6 0 0
org.apache.myfaces.tobago.example.test.ScriptEventServlet 19 1 0 0
org.apache.myfaces.tobago.example.test.Version 19 9 0 0
org.apache.myfaces.tobago.example.test.Attribute 17 7 0 0
org.apache.myfaces.tobago.example.test.Hidden 17 6 0 0
org.apache.myfaces.tobago.example.test.Upload 17 3 0 0
org.apache.myfaces.tobago.example.test.Bootstrap 16 6 0 0
org.apache.myfaces.tobago.example.test.Reload 16 5 0 0
org.apache.myfaces.tobago.example.test.ResourceBean 14 3 0 0
org.apache.myfaces.tobago.example.test.InputSuggestController 13 1 0 0
org.apache.myfaces.tobago.example.test.ScriptEvent 13 5 0 0
org.apache.myfaces.tobago.example.test.ScriptEventItem 12 3 0 0
org.apache.myfaces.tobago.example.test.DateController 11 3 0 0
org.apache.myfaces.tobago.example.test.DynamicPanel2 11 4 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.example.test.SelectManyListboxBean 46 18 0 0
org.apache.myfaces.tobago.example.test.ClientConfigController 65 14 0 0
org.apache.myfaces.tobago.example.test.MeasureBean 35 14 1 0
org.apache.myfaces.tobago.example.test.SelectBooleanCheckboxBean 31 12 0 0
org.apache.myfaces.tobago.example.test.ResourceEntry 35 11 0 0
org.apache.myfaces.tobago.example.test.PageItem 36 9 0 0
org.apache.myfaces.tobago.example.test.Version 19 9 0 0
org.apache.myfaces.tobago.example.test.Immediate 25 8 0 0
org.apache.myfaces.tobago.example.test.TreeController 24 8 0 0
org.apache.myfaces.tobago.example.test.Attribute 17 7 0 0
org.apache.myfaces.tobago.example.test.Partially 28 7 0 0
org.apache.myfaces.tobago.example.test.Bootstrap 16 6 0 0
org.apache.myfaces.tobago.example.test.Hidden 17 6 0 0
org.apache.myfaces.tobago.example.test.PopupReferenceController 43 6 1 0
org.apache.myfaces.tobago.example.test.SheetController 20 6 0 0
org.apache.myfaces.tobago.example.test.DirectoryBrowser 41 5 0 0
org.apache.myfaces.tobago.example.test.Reload 16 5 0 0
org.apache.myfaces.tobago.example.test.ScriptEvent 13 5 0 0
org.apache.myfaces.tobago.example.test.DynamicPanel2 11 4 0 0
org.apache.myfaces.tobago.example.test.DynamicPanel3 11 4 0 0
org.apache.myfaces.tobago.example.test.InBean 11 4 0 0
org.apache.myfaces.tobago.example.test.Shuttle 10 4 0 0
org.apache.myfaces.tobago.example.test.ZIndexController 11 4 0 0
org.apache.myfaces.tobago.example.test.DateController 11 3 0 0
org.apache.myfaces.tobago.example.test.DynamicBean 21 3 0 0
org.apache.myfaces.tobago.example.test.Progress 10 3 0 0
org.apache.myfaces.tobago.example.test.ResourceBean 14 3 0 0
org.apache.myfaces.tobago.example.test.ScriptEventItem 12 3 0 0
org.apache.myfaces.tobago.example.test.SheetSortController 63 3 1 0
org.apache.myfaces.tobago.example.test.TestExceptionHandler 21 3 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
19.00 1,134.00 0.06 4.73 0.02

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.myfaces.tobago.example.test.DirectoryBrowser.locateResourcesInWar(PageItem,ServletContext) 26 15 0
org.apache.myfaces.tobago.example.test.Tobago1041.getHackFacesMessages() 19 1 0
org.apache.myfaces.tobago.example.test.ScriptEventServlet.doGet(HttpServletRequest,HttpServletResponse) 17 6 0
org.apache.myfaces.tobago.example.test.SheetSortController.Entry.Entry(int) 17 2 0
org.apache.myfaces.tobago.example.test.ClientConfigController.getLocaleItems() 15 5 0
org.apache.myfaces.tobago.example.test.TestExceptionHandler.handle() 15 3 0
org.apache.myfaces.tobago.example.test.DynamicBean.addPanel() 14 4 0
org.apache.myfaces.tobago.example.test.Partially.Partially() 13 7 0
org.apache.myfaces.tobago.example.test.TestPageFilter.isValid(String) 13 10 0
org.apache.myfaces.tobago.example.test.ClientConfigController.ClientConfigController() 11 2 0
org.apache.myfaces.tobago.example.test.InputSuggestController.inputSuggestItems(UIInput) 11 1 0
org.apache.myfaces.tobago.example.test.Upload.upload() 10 3 0
org.apache.myfaces.tobago.example.test.PageItem.PageItem(String,boolean,boolean) 9 3 0
org.apache.myfaces.tobago.example.test.Messages.createMessages() 8 1 0
org.apache.myfaces.tobago.example.test.PopupReferenceController.PopupReferenceController() 8 2 0
org.apache.myfaces.tobago.example.test.PopupReferenceController.selectEntry(ActionEvent) 7 2 0
org.apache.myfaces.tobago.example.test.ResourceBean.ResourceBean() 7 4 0
org.apache.myfaces.tobago.example.test.WaitFilter.doFilter(ServletRequest,ServletResponse,FilterChain) 7 2 0
org.apache.myfaces.tobago.example.test.ClientConfigController.getLocalizedTheme() 6 4 0
org.apache.myfaces.tobago.example.test.ResourceEntry.ResourceEntry(String,String,ResourceType,String) 6 1 0
org.apache.myfaces.tobago.example.test.ClientConfigController.createLocaleItem(Locale) 5 3 0
org.apache.myfaces.tobago.example.test.ClientConfigController.getLocalizedLocale() 5 3 0
org.apache.myfaces.tobago.example.test.DirectoryBrowser.DirectoryBrowser() 5 1 0
org.apache.myfaces.tobago.example.test.Immediate.test() 5 1 0
org.apache.myfaces.tobago.example.test.KillSession.doGet(HttpServletRequest,HttpServletResponse) 5 2 0
org.apache.myfaces.tobago.example.test.PageItem.getMarkup() 5 3 0
org.apache.myfaces.tobago.example.test.ResourceEntry.ResourceEntry(String,ResourceType,String) 5 1 0
org.apache.myfaces.tobago.example.test.SheetController.init3() 5 2 0
org.apache.myfaces.tobago.example.test.TestPageFilter.isDisabled(String) 5 4 0
org.apache.myfaces.tobago.example.test.TestPageFilter.isTodo(String) 5 4 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,134.00 3.02 1.32 0.00

Explanations

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