Parent Project
Foundation

JavaNCSS Metric Results

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

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

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.component 49 326 2632 10 31 181 865
org.apache.myfaces.tobago.util 28 189 1534 8 47 83 574
org.apache.myfaces.tobago.context 22 187 1443 5 22 51 404
org.apache.myfaces.tobago.taglib.component 79 209 1339 6 34 67 2171
org.apache.myfaces.tobago.renderkit 26 111 773 1 4 32 471
org.apache.myfaces.tobago.webapp 10 120 767 17 91 32 184
org.apache.myfaces.tobago.layout.math 14 94 659 10 106 41 231
org.apache.myfaces.tobago.layout 25 162 647 7 21 17 446
org.apache.myfaces.tobago.model 13 115 474 5 22 9 226
org.apache.myfaces.tobago.lifecycle 10 39 447 13 64 32 160
org.apache.myfaces.tobago.config 5 42 352 0 0 9 91
org.apache.myfaces.tobago.taglib.decl 61 103 348 29 97 3 1528
org.apache.myfaces.tobago.renderkit.html 4 33 282 0 0 2 73
org.apache.myfaces.tobago.ajax.api 4 20 232 1 3 9 64
org.apache.myfaces.tobago.servlet 5 17 216 2 30 6 83
org.apache.myfaces.tobago 1 1 213 0 0 4 234
org.apache.myfaces.tobago.internal.taglib 3 30 175 0 0 1 52
org.apache.myfaces.tobago.convert 4 9 155 0 0 0 68
org.apache.myfaces.tobago.validator 3 23 155 0 0 5 69
org.apache.myfaces.tobago.el 3 10 90 0 0 2 55
org.apache.myfaces.tobago.event 4 11 67 2 7 0 90
org.apache.myfaces.tobago.application 1 9 56 0 0 4 16
org.apache.myfaces.tobago.layout.grid 3 19 51 3 14 0 48
org.apache.myfaces.tobago.tool 1 7 50 0 0 4 16
org.apache.myfaces.tobago.bean 1 4 38 0 0 2 20
org.apache.myfaces.tobago.renderkit.css 1 1 7 0 0 1 16
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
380 1891 13202 119 593 597 8255

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.util.ComponentUtil 460 64 0 3
org.apache.myfaces.tobago.context.ResourceManagerImpl 393 19 6 0
org.apache.myfaces.tobago.component.AbstractUIData 286 34 0 0
org.apache.myfaces.tobago.component.AbstractUIGridLayout 256 21 0 2
org.apache.myfaces.tobago.webapp.TobagoResponseWriterImpl 235 40 0 0
org.apache.myfaces.tobago.TobagoConstants 212 1 0 0
org.apache.myfaces.tobago.layout.math.SystemOfEquations 209 23 1 3
org.apache.myfaces.tobago.util.LayoutInfo 202 24 0 0
org.apache.myfaces.tobago.context.ResourceLocator 196 10 0 2
org.apache.myfaces.tobago.component.AbstractUITreeData 169 27 1 0
org.apache.myfaces.tobago.component.AbstractUITreeNode 167 38 0 0
org.apache.myfaces.tobago.component.Attributes 164 0 0 1
org.apache.myfaces.tobago.component.AbstractUIPage 161 26 0 0
org.apache.myfaces.tobago.component.AbstractUITabGroup 156 30 0 3
org.apache.myfaces.tobago.context.UserAgent 139 8 0 1
org.apache.myfaces.tobago.renderkit.html.StyleClasses 129 29 1 0
org.apache.myfaces.tobago.taglib.component.GridLayoutConstraintTag 114 51 0 0
org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer 109 7 0 0
org.apache.myfaces.tobago.config.TobagoConfig 109 20 0 0
org.apache.myfaces.tobago.util.HtmlWriterUtil 109 7 0 1
org.apache.myfaces.tobago.config.ThemeConfig 106 6 1 0
org.apache.myfaces.tobago.internal.taglib.TagUtils 104 20 0 0
org.apache.myfaces.tobago.context.ClientProperties 103 16 0 0
org.apache.myfaces.tobago.component.UIViewRoot 97 15 0 1
org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataRequest 97 9 0 0
org.apache.myfaces.tobago.component.Sorter 94 6 0 0
org.apache.myfaces.tobago.lifecycle.RestoreViewExecutor 94 5 0 2
org.apache.myfaces.tobago.convert.DurationConverter 93 3 0 0
org.apache.myfaces.tobago.model.TreeState 92 28 0 1
org.apache.myfaces.tobago.lifecycle.TobagoLifecycle 85 9 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.myfaces.tobago.util.ComponentUtil 460 64 0 3
org.apache.myfaces.tobago.taglib.component.GridLayoutConstraintTag 114 51 0 0
org.apache.myfaces.tobago.webapp.TobagoResponseWriterImpl 235 40 0 0
org.apache.myfaces.tobago.component.AbstractUITreeNode 167 38 0 0
org.apache.myfaces.tobago.component.AbstractUIData 286 34 0 0
org.apache.myfaces.tobago.component.AbstractUITabGroup 156 30 0 3
org.apache.myfaces.tobago.renderkit.html.StyleClasses 129 29 1 0
org.apache.myfaces.tobago.model.TreeState 92 28 0 1
org.apache.myfaces.tobago.component.AbstractUITreeData 169 27 1 0
org.apache.myfaces.tobago.webapp.TobagoResponseWriter 60 27 0 15
org.apache.myfaces.tobago.component.AbstractUIPage 161 26 0 0
org.apache.myfaces.tobago.util.LayoutInfo 202 24 0 0
org.apache.myfaces.tobago.layout.math.SystemOfEquations 209 23 1 3
org.apache.myfaces.tobago.component.AbstractUIGridLayout 256 21 0 2
org.apache.myfaces.tobago.component.AbstractUIPopup 69 21 0 0
org.apache.myfaces.tobago.context.FacesContextWrapper 44 21 0 0
org.apache.myfaces.tobago.layout.LayoutTokens 85 21 0 0
org.apache.myfaces.tobago.config.TobagoConfig 109 20 0 0
org.apache.myfaces.tobago.webapp.TobagoResponseWriterWrapper 42 20 0 0
org.apache.myfaces.tobago.internal.taglib.TagUtils 104 20 0 0
org.apache.myfaces.tobago.context.ResourceManagerImpl 393 19 6 0
org.apache.myfaces.tobago.context.ThemeImpl 72 19 0 0
org.apache.myfaces.tobago.renderkit.AbstractRendererBaseWrapper 42 19 0 0
org.apache.myfaces.tobago.taglib.decl.IsGridLayoutComponent 20 19 0 0
org.apache.myfaces.tobago.taglib.decl.IsGridLayoutComponentWithDeprecatedDimension 20 19 0 0
org.apache.myfaces.tobago.layout.LayoutObject 19 18 0 1
org.apache.myfaces.tobago.context.TobagoFacesContext 62 17 0 0
org.apache.myfaces.tobago.taglib.component.SheetTagDeclaration 18 17 0 0
org.apache.myfaces.tobago.context.ClientProperties 103 16 0 0
org.apache.myfaces.tobago.model.SheetState 59 16 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
27.75 13,202.00 0.04 4.98 0.31

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.myfaces.tobago.component.Sorter.perform(SortActionEvent) 67 31 0
org.apache.myfaces.tobago.taglib.component.GridLayoutConstraintTag.doStartTag() 62 31 0
org.apache.myfaces.tobago.renderkit.SelectManyRendererBase.getConvertedUISelectManyValue(FacesContext,UISelectMany,String[]) 55 37 0
org.apache.myfaces.tobago.component.AbstractUIData.performPaging(PageActionEvent) 53 18 0
org.apache.myfaces.tobago.webapp.TobagoMultipartFormdataRequest.init(HttpServletRequest,String,long) 50 15 0
org.apache.myfaces.tobago.context.UserAgent.getInstance(String) 49 33 0
org.apache.myfaces.tobago.context.UserAgent.getInstanceForId(String) 48 33 0
org.apache.myfaces.tobago.lifecycle.RestoreViewExecutor.execute(FacesContext) 43 16 0
org.apache.myfaces.tobago.component.AbstractUIGridLayout.mainProcessing(boolean) 40 13 0
org.apache.myfaces.tobago.context.ResourceLocator.addResources(ResourceManagerImpl,URL,String,int) 37 12 0
org.apache.myfaces.tobago.component.AbstractUIGridLayout.preProcessing(boolean) 36 13 0
org.apache.myfaces.tobago.taglib.component.ConverterTag.doStartTag() 36 21 1
org.apache.myfaces.tobago.util.HtmlWriterUtil.writeEncodedValue(char[],int,int,boolean) 36 14 0
org.apache.myfaces.tobago.webapp.TobagoResponseWriterImpl.addLayout(HtmlStyleMap) 36 10 0
org.apache.myfaces.tobago.taglib.component.AttributeTag.doStartTag() 34 16 1
org.apache.myfaces.tobago.ajax.api.AjaxResponseRenderer.writeResponse(FacesContext,RenderKit,boolean) 33 6 0
org.apache.myfaces.tobago.context.ResourceLocator.locateResourcesInWar(ServletContext,ResourceManagerImpl,String) 33 17 0
org.apache.myfaces.tobago.renderkit.TobagoResponseStateManager.writeState(FacesContext,StateManager.SerializedView) 33 7 0
org.apache.myfaces.tobago.convert.DurationConverter.getUnitFactor(UIComponent) 32 10 0
org.apache.myfaces.tobago.util.HtmlWriterUtil.writeDecRef(char) 32 5 0
org.apache.myfaces.tobago.layout.math.SystemOfEquations.round(double[]) 32 9 0
org.apache.myfaces.tobago.component.AbstractUIGridLayout.collect(LayoutContext,LayoutContainer,int,int) 31 7 1
org.apache.myfaces.tobago.component.UIViewRoot.broadcastForPhase(PhaseId) 31 14 0
org.apache.myfaces.tobago.taglib.component.TabChangeListenerTag.doStartTag() 30 20 1
org.apache.myfaces.tobago.util.LayoutInfo.parseColumnLayout(double,int) 30 12 0
org.apache.myfaces.tobago.component.AbstractUITabGroup.broadcast(FacesEvent) 29 17 0
org.apache.myfaces.tobago.config.TobagoConfig.resolveThemes() 29 11 0
org.apache.myfaces.tobago.context.ResourceLocator.addProperties(InputStream,ResourceManagerImpl,String,boolean,int) 29 9 0
org.apache.myfaces.tobago.layout.math.PartitionEquation.toString() 29 8 0
org.apache.myfaces.tobago.component.AbstractUIPage.markSubmittedForm(FacesContext) 28 11 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
13,202.00 4.61 2.23 0.03

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