JavaNCSS Metric Results

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

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

Packages

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

Packages sorted by NCSS.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
org.apache.myfaces.tobago.event2512253561810435
org.apache.myfaces.tobago.util74636163110151
org.apache.myfaces.tobago.compat445323001268
org.apache.myfaces.tobago.component9361835191100
org.apache.myfaces.tobago.application31610500352
org.apache.myfaces.tobago.internal.taglib153528116
org.apache.myfaces.tobago.portlet1732420620
org.apache.myfaces.tobago.internal.util112200616
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
512781596239649858

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.apache.myfaces.tobago.compat.FacesUtils1522200
org.apache.myfaces.tobago.component.MethodBindingToMethodExpression1101834
org.apache.myfaces.tobago.compat.FacesUtilsEL902000
org.apache.myfaces.tobago.util.MessageUtils71901
org.apache.myfaces.tobago.util.ValueExpressionComparator58701
org.apache.myfaces.tobago.util.ValueBindingComparator58701
org.apache.myfaces.tobago.util.ComparatorBase46800
org.apache.myfaces.tobago.event.ValueBindingTabChangeListener43900
org.apache.myfaces.tobago.event.ValueExpressionTabChangeListener43900
org.apache.myfaces.tobago.util.BeanComparator37803
org.apache.myfaces.tobago.application.ActionListenerImpl32400
org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding32901
org.apache.myfaces.tobago.util.FacesVersion31600
org.apache.myfaces.tobago.application.LabelValueBindingFacesMessage31600
org.apache.myfaces.tobago.event.ValueBindingResetInputActionListener30600
org.apache.myfaces.tobago.event.ValueExpressionResetInputActionListener30600
org.apache.myfaces.tobago.event.TabChangeEvent291005
org.apache.myfaces.tobago.internal.taglib.TobagoELTag28502
org.apache.myfaces.tobago.event.TreeExpansionEvent24600
org.apache.myfaces.tobago.event.TreeMarkedEvent24600
org.apache.myfaces.tobago.portlet.PortletUtils24704
org.apache.myfaces.tobago.compat.FacesInvokeOnComponent1221200
org.apache.myfaces.tobago.event.ValueExpressionPopupActionListener21600
org.apache.myfaces.tobago.event.ValueBindingPopupActionListener21600
org.apache.myfaces.tobago.internal.util.FindComponentUtils19100
org.apache.myfaces.tobago.event.MethodExpressionTreeExpansionListener18800
org.apache.myfaces.tobago.event.MethodExpressionTreeMarkedListener18800
org.apache.myfaces.tobago.application.LabelValueExpressionFacesMessage17600
org.apache.myfaces.tobago.event.MethodExpressionTabChangeListener16700
org.apache.myfaces.tobago.event.MethodExpressionStateChangeListener16700

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.apache.myfaces.tobago.compat.FacesUtils1522200
org.apache.myfaces.tobago.compat.FacesUtilsEL902000
org.apache.myfaces.tobago.component.MethodBindingToMethodExpression1101834
org.apache.myfaces.tobago.event.TabChangeEvent291005
org.apache.myfaces.tobago.util.MessageUtils71901
org.apache.myfaces.tobago.event.ValueBindingTabChangeListener43900
org.apache.myfaces.tobago.event.ValueExpressionTabChangeListener43900
org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding32901
org.apache.myfaces.tobago.util.BeanComparator37803
org.apache.myfaces.tobago.util.ComparatorBase46800
org.apache.myfaces.tobago.event.MethodExpressionTreeExpansionListener18800
org.apache.myfaces.tobago.event.MethodExpressionTreeMarkedListener18800
org.apache.myfaces.tobago.util.ValueExpressionComparator58701
org.apache.myfaces.tobago.util.ValueBindingComparator58701
org.apache.myfaces.tobago.event.MethodExpressionTabChangeListener16700
org.apache.myfaces.tobago.event.MethodExpressionStateChangeListener16700
org.apache.myfaces.tobago.portlet.PortletUtils24704
org.apache.myfaces.tobago.util.FacesVersion31600
org.apache.myfaces.tobago.event.TreeExpansionEvent24600
org.apache.myfaces.tobago.event.ValueExpressionPopupActionListener21600
org.apache.myfaces.tobago.event.TreeMarkedEvent24600
org.apache.myfaces.tobago.event.ValueBindingResetInputActionListener30600
org.apache.myfaces.tobago.event.ValueExpressionResetInputActionListener30600
org.apache.myfaces.tobago.event.ValueBindingPopupActionListener21600
org.apache.myfaces.tobago.application.LabelValueBindingFacesMessage31600
org.apache.myfaces.tobago.application.LabelValueExpressionFacesMessage17600
org.apache.myfaces.tobago.event.TabChangeSource6500
org.apache.myfaces.tobago.event.SheetStateChangeSource6500
org.apache.myfaces.tobago.internal.taglib.TobagoELTag28502
org.apache.myfaces.tobago.application.ActionListenerImpl32400

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
25.391,596.000.065.450.45

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.apache.myfaces.tobago.util.MessageUtils.getMessage(FacesContext,Locale,FacesMessage.Severity,String,Object)31180
org.apache.myfaces.tobago.util.ComparatorBase.internalCompare(Object,Object)27180
org.apache.myfaces.tobago.application.ActionListenerImpl.processAction(ActionEvent)2280
org.apache.myfaces.tobago.internal.util.FindComponentUtils.findComponent(UIComponent,String)18110
org.apache.myfaces.tobago.compat.FacesUtils.invokeOnComponent(FacesContext,UIComponent,String,ContextCallback)17120
org.apache.myfaces.tobago.util.ValueExpressionComparator.equals(Object)15170
org.apache.myfaces.tobago.util.ValueBindingComparator.equals(Object)15170
org.apache.myfaces.tobago.event.ValueBindingResetInputActionListener.processAction(ActionEvent)1560
org.apache.myfaces.tobago.event.ValueExpressionResetInputActionListener.processAction(ActionEvent)1560
org.apache.myfaces.tobago.component.MethodBindingToMethodExpression.equals(Object)15120
org.apache.myfaces.tobago.compat.FacesInvokeOnComponent12.invokeOnComponent(FacesContext,UIComponent,String,ContextCallback)14100
org.apache.myfaces.tobago.compat.FacesUtils.setConverter(ValueHolder,Object)1460
org.apache.myfaces.tobago.compat.FacesUtilsEL.invokeOnComponent(FacesContext,UIComponent,String,ContextCallback)14100
org.apache.myfaces.tobago.component.MethodBindingToMethodExpression.newInstance(String)14140
org.apache.myfaces.tobago.compat.FacesUtils.invokeOnComponentFacetsAndChildren(FacesContext,UIComponent,String,ContextCallback)1280
org.apache.myfaces.tobago.util.ValueExpressionComparator.compare(Object,Object)1231
org.apache.myfaces.tobago.util.ValueBindingComparator.compare(Object,Object)1231
org.apache.myfaces.tobago.util.RequestUtils.ensureEncoding(FacesContext)1150
org.apache.myfaces.tobago.event.ValueBindingTabChangeListener.getTabChangeListener()1180
org.apache.myfaces.tobago.event.ValueExpressionTabChangeListener.getTabChangeListener()1180
org.apache.myfaces.tobago.event.AbstractPopupActionListener.processAction(ActionEvent)1050
org.apache.myfaces.tobago.component.MethodBindingToMethodExpression.getMethodInfo(ELContext)1031
org.apache.myfaces.tobago.component.MethodBindingToMethodExpression.saveState(FacesContext)1050
org.apache.myfaces.tobago.component.MethodBindingToMethodExpression.restoreState(FacesContext,Object)1030
org.apache.myfaces.tobago.compat.FacesUtils.invokeMethodBinding(FacesContext,MethodBinding,FacesEvent)970
org.apache.myfaces.tobago.compat.FacesUtilsEL.invokeMethodBinding(FacesContext,MethodBinding,FacesEvent)970
org.apache.myfaces.tobago.util.BeanComparator.compare(Object,Object)931
org.apache.myfaces.tobago.util.FacesVersion.isAvailable(String)960
org.apache.myfaces.tobago.application.LabelValueBindingFacesMessage.getDetail()970
org.apache.myfaces.tobago.application.LabelValueBindingFacesMessage.getSummary()970

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
1,596.004.192.340.07

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 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 {
Label declarationfine :

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