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.demo 86 592 3284 5 29 21 1522
org.apache.myfaces.tobago.example.test 46 222 1092 1 3 36 847
org.apache.myfaces.tobago.example.demo.sudoku 1 10 140 2 8 7 18
org.apache.myfaces.tobago.example.demo.clientConfig 2 18 114 0 0 7 48
org.apache.myfaces.tobago.example.demo.bestpractice 3 13 105 0 0 1 54
org.apache.myfaces.tobago.example.demo.info 4 22 104 0 0 2 72
org.apache.myfaces.tobago.example.demo.nonfacesrequest 1 7 38 0 0 2 18
org.apache.myfaces.tobago.example.demo.actionlistener 1 5 21 0 0 0 18
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
144 889 4898 8 40 76 2597

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.example.demo.EventController 166 16 2 0
org.apache.myfaces.tobago.example.demo.SheetFilterController 144 23 2 0
org.apache.myfaces.tobago.example.demo.sudoku.Sudoku 132 10 2 2
org.apache.myfaces.tobago.example.demo.DemoController 125 39 0 0
org.apache.myfaces.tobago.example.demo.TreeEditorController 118 17 0 0
org.apache.myfaces.tobago.example.demo.UniversalLoggingInfo 112 9 1 1
org.apache.myfaces.tobago.example.demo.SheetConfig 102 32 0 0
org.apache.myfaces.tobago.example.demo.InputSuggestController 98 14 0 0
org.apache.myfaces.tobago.example.demo.clientConfig.ClientConfigController 82 15 0 0
org.apache.myfaces.tobago.example.demo.SheetController 79 17 1 0
org.apache.myfaces.tobago.example.demo.GroupController 66 16 0 0
org.apache.myfaces.tobago.example.demo.NavigationTree 66 7 0 1
org.apache.myfaces.tobago.example.test.ClientConfigController 65 14 0 0
org.apache.myfaces.tobago.example.demo.NavigationState 64 13 0 0
org.apache.myfaces.tobago.example.demo.PartialReloadController 64 10 0 0
org.apache.myfaces.tobago.example.test.SheetSortController 64 3 1 0
org.apache.myfaces.tobago.example.demo.TestController 57 6 1 0
org.apache.myfaces.tobago.example.demo.NavigationNode 48 12 0 0
org.apache.myfaces.tobago.example.demo.UploadController 48 14 0 0
org.apache.myfaces.tobago.example.demo.ForEachController 47 11 1 0
org.apache.myfaces.tobago.example.test.SelectManyListboxBean 46 18 0 0
org.apache.myfaces.tobago.example.demo.ExecuteController 43 12 0 0
org.apache.myfaces.tobago.example.test.PopupReferenceController 43 6 1 0
org.apache.myfaces.tobago.example.demo.ServerInfo 42 9 0 1
org.apache.myfaces.tobago.example.test.DirectoryBrowser 41 5 0 0
org.apache.myfaces.tobago.example.demo.SuggestController 40 9 0 0
org.apache.myfaces.tobago.example.demo.TabController 37 11 0 0
org.apache.myfaces.tobago.example.demo.Login 36 7 0 0
org.apache.myfaces.tobago.example.demo.bestpractice.ToolBarCustomizer 36 5 1 0
org.apache.myfaces.tobago.example.test.PageItem 36 9 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.example.demo.DemoController 125 39 0 0
org.apache.myfaces.tobago.example.demo.SheetConfig 102 32 0 0
org.apache.myfaces.tobago.example.demo.SheetFilterController 144 23 2 0
org.apache.myfaces.tobago.example.test.SelectManyListboxBean 46 18 0 0
org.apache.myfaces.tobago.example.demo.SheetController 79 17 1 0
org.apache.myfaces.tobago.example.demo.TreeEditorController 118 17 0 0
org.apache.myfaces.tobago.example.demo.EventController 166 16 2 0
org.apache.myfaces.tobago.example.demo.GroupController 66 16 0 0
org.apache.myfaces.tobago.example.demo.clientConfig.ClientConfigController 82 15 0 0
org.apache.myfaces.tobago.example.demo.InputSuggestController 98 14 0 0
org.apache.myfaces.tobago.example.demo.UploadController 48 14 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.demo.NavigationState 64 13 0 0
org.apache.myfaces.tobago.example.demo.SelectBooleanCheckboxController 33 13 0 0
org.apache.myfaces.tobago.example.demo.SelectItemModel 35 13 0 0
org.apache.myfaces.tobago.example.demo.ExecuteController 43 12 0 0
org.apache.myfaces.tobago.example.demo.NavigationNode 48 12 0 0
org.apache.myfaces.tobago.example.test.SelectBooleanCheckboxBean 31 12 0 0
org.apache.myfaces.tobago.example.demo.ForEachController 47 11 1 0
org.apache.myfaces.tobago.example.demo.TabController 37 11 0 0
org.apache.myfaces.tobago.example.demo.info.Activity 28 11 0 0
org.apache.myfaces.tobago.example.test.ResourceEntry 35 11 0 0
org.apache.myfaces.tobago.example.demo.PartialReloadController 64 10 0 0
org.apache.myfaces.tobago.example.demo.TreeController 26 10 0 0
org.apache.myfaces.tobago.example.demo.sudoku.Sudoku 132 10 2 2
org.apache.myfaces.tobago.example.demo.MessagesController 25 9 0 0
org.apache.myfaces.tobago.example.demo.SelectManyShuttleController 23 9 0 0
org.apache.myfaces.tobago.example.demo.ServerInfo 42 9 0 1
org.apache.myfaces.tobago.example.demo.SuggestController 40 9 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
27.06 4,898.00 0.12 6.17 0.06

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.myfaces.tobago.example.demo.EventController.EventController() 64 1 0
org.apache.myfaces.tobago.example.demo.PartialReloadController.navigateAction(AjaxBehaviorEvent) 38 9 0
org.apache.myfaces.tobago.example.demo.sudoku.Sudoku.solve() 29 11 0
org.apache.myfaces.tobago.example.demo.InputSuggestController.getSuggestItems(String,boolean) 26 7 0
org.apache.myfaces.tobago.example.test.DirectoryBrowser.locateResourcesInWar(PageItem,ServletContext) 26 15 0
org.apache.myfaces.tobago.example.demo.SheetSortingController.sheetSorter(SheetState,SolarObject) 25 5 0
org.apache.myfaces.tobago.example.demo.TestExceptionHandler.handle() 24 6 0
org.apache.myfaces.tobago.example.demo.NavigationTree.postConstruct() 22 7 0
org.apache.myfaces.tobago.example.demo.InputSuggestController.getRegionItems() 21 2 0
org.apache.myfaces.tobago.example.demo.SheetFilterController.filter() 21 16 0
org.apache.myfaces.tobago.example.demo.SheetConfig.SheetConfig() 19 3 0
org.apache.myfaces.tobago.example.demo.UniversalLoggingInfo.LoggingInfo.reset(String) 19 6 0
org.apache.myfaces.tobago.example.demo.bestpractice.BestPracticeController.viewFile(boolean,boolean) 19 9 0
org.apache.myfaces.tobago.example.test.Tobago1041.getHackFacesMessages() 19 1 0
org.apache.myfaces.tobago.example.demo.ManifestReader.ManifestReader() 18 4 0
org.apache.myfaces.tobago.example.demo.SheetFilterController.SheetFilterController() 18 4 0
org.apache.myfaces.tobago.example.test.SheetSortController.Entry.Entry(int) 18 2 0
org.apache.myfaces.tobago.example.test.ScriptEventServlet.doGet(HttpServletRequest,HttpServletResponse) 17 6 0
org.apache.myfaces.tobago.example.demo.NavigationNode.NavigationNode(String,NavigationTree) 16 2 0
org.apache.myfaces.tobago.example.demo.GroupController.compute() 15 5 0
org.apache.myfaces.tobago.example.demo.clientConfig.ClientConfigController.ClientConfigController() 15 3 0
org.apache.myfaces.tobago.example.demo.clientConfig.ClientConfigController.getLocaleItems() 15 5 0
org.apache.myfaces.tobago.example.test.ClientConfigController.getLocaleItems() 15 5 0
org.apache.myfaces.tobago.example.demo.SheetController.getYearConverter() 14 1 0
org.apache.myfaces.tobago.example.demo.TreeEditorController.paste() 14 4 0
org.apache.myfaces.tobago.example.demo.UniversalLoggingInfo.LoggingInfo.checkLevel(String,String) 14 11 0
org.apache.myfaces.tobago.example.test.DynamicBean.addPanel() 14 4 0
org.apache.myfaces.tobago.example.demo.SourceFileReader.getSource(String) 13 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

Averages.

Program NCSS NCSS average CCN average Javadocs average
4,898.00 3.43 1.43 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).