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.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
gboat2.base.core.web 17 188 1561 111 963 132 109
gboat2.base.core.util 9 54 739 32 207 58 51
gboat2.base.core.web.md 12 37 423 16 113 19 48
gboat2.base.core.service 7 60 378 26 149 122 60
gboat2.base.core.model 6 72 296 15 155 9 24
gboat2.base.core 5 20 205 6 36 9 21
gboat2.base.core.annotation 2 0 158 1 7 1 479
gboat2.base.core.dao 4 49 131 46 249 10 11
gboat2.base.core.util.json 5 15 108 9 54 1 20
gboat2.base.core.validate 5 19 93 9 65 0 18
gboat2.base.core.logging 4 33 89 10 70 0 30
gboat2.base.core.exception 2 2 12 2 16 0 9
gboat2.base.core.cache 1 3 5 4 24 0 4
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
79 552 4198 287 2108 361 884

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
gboat2.base.core.web.BaseActionSupport 637 81 0 26
gboat2.base.core.web.MetadataSupportStrategy 332 16 0 11
gboat2.base.core.service.ModuleService 238 27 0 10
gboat2.base.core.util.JsonUtil 147 11 0 9
gboat2.base.core.web.JsonResultSupport 137 40 0 39
gboat2.base.core.util.SpringContextUtil 133 11 0 3
gboat2.base.core.web.md.MetadataHandler 123 8 0 3
gboat2.base.core.Activator 99 6 1 3
gboat2.base.core.util.ActionUtil 90 11 0 8
gboat2.base.core.util.EscapeJavaScriptReference 79 5 0 3
gboat2.base.core.model.Module 78 14 0 4
gboat2.base.core.validate.PrivilegeCheckServiceFactory 68 11 2 3
gboat2.base.core.model.Opera 59 11 0 4
gboat2.base.core.util.JsonVelocityUtil 57 4 0 3
gboat2.base.core.logging.BusinessLogEntry 51 20 0 1
gboat2.base.core.web.md.MetadataHandlerChain 49 12 0 1
gboat2.base.core.model.ContentMetadata 46 18 0 1
gboat2.base.core.dao.PageBean 45 17 0 16
gboat2.base.core.dao.Page 39 8 0 9
gboat2.base.core.util.EnumTypeUtils 39 3 0 2
gboat2.base.core.util.EnumTypeWrapper 39 4 0 1
gboat2.base.core.web.SplitMetadataStrategy 39 4 0 4
gboat2.base.core.GBoatClassLoader 37 8 0 1
gboat2.base.core.service.ParameterServiceImpl 36 4 0 0
gboat2.base.core.web.md.IFrameHandler 34 4 0 1
gboat2.base.core.model.PreferenceDefinition 33 11 0 4
gboat2.base.core.web.ObtainMetadata 32 3 0 1
gboat2.base.core.model.Parameter 31 12 0 1
gboat2.base.core.util.JsonConfigUtil 31 4 0 1
gboat2.base.core.web.BundleVelocityResourceLoader 28 3 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
gboat2.base.core.web.BaseActionSupport 637 81 0 26
gboat2.base.core.web.JsonResultSupport 137 40 0 39
gboat2.base.core.service.ModuleService 238 27 0 10
gboat2.base.core.dao.IBaseDAO 25 24 0 20
gboat2.base.core.logging.BusinessLogEntry 51 20 0 1
gboat2.base.core.model.ContentMetadata 46 18 0 1
gboat2.base.core.dao.PageBean 45 17 0 16
gboat2.base.core.web.MetadataSupportStrategy 332 16 0 11
gboat2.base.core.model.Module 78 14 0 4
gboat2.base.core.model.Parameter 31 12 0 1
gboat2.base.core.web.md.MetadataHandlerChain 49 12 0 1
gboat2.base.core.model.Opera 59 11 0 4
gboat2.base.core.model.PreferenceDefinition 33 11 0 4
gboat2.base.core.util.ActionUtil 90 11 0 8
gboat2.base.core.util.JsonUtil 147 11 0 9
gboat2.base.core.util.SpringContextUtil 133 11 0 3
gboat2.base.core.validate.PrivilegeCheckServiceFactory 68 11 2 3
gboat2.base.core.dao.Page 39 8 0 9
gboat2.base.core.GBoatClassLoader 37 8 0 1
gboat2.base.core.service.BaseService 21 8 0 1
gboat2.base.core.service.IBaseService 9 8 0 1
gboat2.base.core.service.IModuleService 9 8 0 8
gboat2.base.core.web.md.MetadataHandler 123 8 0 3
gboat2.base.core.logging.IBusinessLogService 8 7 0 8
gboat2.base.core.web.MetadataException 16 7 0 8
gboat2.base.core.Activator 99 6 1 3
gboat2.base.core.model.ModuleAttach 16 6 0 1
gboat2.base.core.web.IBaseActionSupport 7 6 0 7
gboat2.base.core.web.JsonResult 16 6 0 1
gboat2.base.core.util.EscapeJavaScriptReference 79 5 0 3

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
43.48 4,198.00 0.04 6.99 3.63

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
gboat2.base.core.web.MetadataSupportStrategy.decorateWithData(boolean,JSONObject,String,BaseActionSupport,JSONObject) 98 29 1
gboat2.base.core.util.EscapeJavaScriptReference.escapeJavaStyleString(Writer,String,boolean,boolean) 64 20 0
gboat2.base.core.web.BaseActionSupport.saveModel() 47 17 0
gboat2.base.core.web.BaseActionSupport.getDomainClassAnnotationed() 41 22 1
gboat2.base.core.util.JsonUtil.parseJSONArray(String,Class) 36 19 0
gboat2.base.core.web.md.MetadataHandler.parseGetterOfObject(Object,Object,String) 35 16 0
gboat2.base.core.web.MetadataSupportStrategy.parseGetterOfObject(Object,Object,String) 35 16 0
gboat2.base.core.util.JsonVelocityUtil.fillJsonByVelocityfromMdStr(String,Object) 32 5 0
gboat2.base.core.web.BaseActionSupport.setValue(Field,Bundle) 31 13 0
gboat2.base.core.web.md.MetadataHandler.getActionPropertiesValues(BaseActionSupport,Object,boolean) 31 14 1
gboat2.base.core.Activator.getPkgForBundle(Bundle) 30 7 1
gboat2.base.core.web.BaseActionSupport.setAutowiredBeans(Field[],Bundle) 29 11 0
gboat2.base.core.web.MetadataSupportStrategy.getActionPropertiesValues(BaseActionSupport,Object,boolean) 29 13 1
gboat2.base.core.util.JsonUtil.translateJSONOjbject(String,JSONObject) 27 9 0
gboat2.base.core.util.SpringContextUtil.getBeansOfType(Class,Bundle) 27 10 1
gboat2.base.core.web.MetadataSupportStrategy.callInitInvokedMethod(String,BaseActionSupport) 27 15 1
gboat2.base.core.Activator.parseActionPackages(InputStream,String) 26 9 0
gboat2.base.core.service.ModuleService.processOperationAnnotationsOfAction(Class) 26 11 1
gboat2.base.core.validate.PrivilegeCheckServiceFactory.PrivilegeCheckServiceFactory() 26 3 0
gboat2.base.core.web.BaseActionSupport.priorityCheck() 26 12 0
gboat2.base.core.web.BaseActionSupport.setAutowiredBeans(Field[],Class) 26 17 1
gboat2.base.core.web.ObtainMetadata.getMetadata(String,String,BaseActionSupport) 26 7 0
gboat2.base.core.util.EnumTypeUtils.getEnumClassInDomain(Class) 25 9 0
gboat2.base.core.web.BaseActionSupport.priorityDataCheck() 24 10 0
gboat2.base.core.util.SpringContextUtil.getBeanOfId(String) 23 11 0
gboat2.base.core.web.BaseActionSupport.deleteModel() 23 12 0
gboat2.base.core.web.BaseActionSupport.forward() 23 8 1
gboat2.base.core.service.ModuleService.processAttachAnnotation(Class) 22 7 0
gboat2.base.core.util.JsonUtil.parse(JSONObject,Class) 22 12 0
gboat2.base.core.web.BaseActionSupport.getDomainClassAnnotationedForList() 22 12 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
4,198.00 5.75 2.55 0.39

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