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.plugin.servlet.filter 8 31 396 8 148 39 29
gboat2.base.plugin.struts.interceptor 5 19 384 11 141 47 27
gboat2.base.plugin.struts.convention 4 20 263 11 89 27 26
gboat2.base.plugin.struts.dispatcher 2 11 135 7 88 25 16
gboat2.base.plugin.struts.freemarker 3 9 122 3 30 9 12
gboat2.base.plugin.struts.velocity 3 6 80 3 40 2 12
gboat2.base.plugin.servlet.listener 2 9 73 3 38 8 8
gboat2.base.plugin.struts 2 2 14 2 37 1 0
gboat2.base.plugin.exception 1 1 6 1 6 0 4
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
30 108 1473 49 617 158 134

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
gboat2.base.plugin.struts.interceptor.GboatFileUploadInterceptor 169 10 0 2
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter 127 4 1 2
gboat2.base.plugin.struts.convention.GboatPackageBasedActionConfigBuilder 98 10 1 9
gboat2.base.plugin.struts.convention.GboatConventionUnknownHandler 81 6 0 1
gboat2.base.plugin.struts.dispatcher.GboatDispatcherResult 79 10 0 6
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter.RequestWrapper 75 8 0 1
gboat2.base.plugin.struts.interceptor.DestopMetadataInterceptor 65 2 0 2
gboat2.base.plugin.servlet.filter.GboatUserSessionFilter 59 4 0 1
gboat2.base.plugin.struts.interceptor.RequestIntervalCheckInterceptor 51 4 0 4
gboat2.base.plugin.struts.freemarker.GboatThemeTemplateLoader 49 5 0 1
gboat2.base.plugin.servlet.filter.StaticFileDebugFilter 35 4 0 2
gboat2.base.plugin.servlet.listener.SessionListener 32 7 0 2
gboat2.base.plugin.servlet.filter.GboatCSSFilter 28 3 0 1
gboat2.base.plugin.struts.freemarker.GboatFreemarkerManager 27 3 0 1
gboat2.base.plugin.servlet.filter.GboatEncodingFilter 24 1 0 1
gboat2.base.plugin.struts.convention.GboatConventionsServiceImpl 23 3 0 1
gboat2.base.plugin.servlet.filter.DisableUrlSessionFilter 22 3 1 1
gboat2.base.plugin.struts.velocity.GboatVelocityManager 22 3 0 1
gboat2.base.plugin.servlet.listener.JDKLoggerConfigListener 21 2 0 1
gboat2.base.plugin.struts.dispatcher.GboatStaticContentLoader 20 1 0 1
gboat2.base.plugin.struts.velocity.DebugVelocityResourceLoader 20 1 0 1
gboat2.base.plugin.struts.interceptor.ExceptionHandlerInterceptor 16 2 0 2
gboat2.base.plugin.struts.interceptor.CallActionLogStackHandlerInterceptor 15 1 0 1
gboat2.base.plugin.struts.velocity.GboatVelocityContext 14 2 0 1
gboat2.base.plugin.servlet.filter.DisableUrlSessionFilter.HttpServletResponseWrapper 8 4 0 0
gboat2.base.plugin.struts.freemarker.GboatClassTemplateLoader 6 1 0 1
gboat2.base.plugin.struts.GboatFileManagerFactory 6 1 0 1
gboat2.base.plugin.exception.InternalInvalidException 4 1 0 1
gboat2.base.plugin.struts.GboatFileManager 3 1 0 1
gboat2.base.plugin.struts.convention.GboatPackageBasedActionConfigBuilder.UrlSet.FileProtocolNormalizer 2 1 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
gboat2.base.plugin.struts.convention.GboatPackageBasedActionConfigBuilder 98 10 1 9
gboat2.base.plugin.struts.dispatcher.GboatDispatcherResult 79 10 0 6
gboat2.base.plugin.struts.interceptor.GboatFileUploadInterceptor 169 10 0 2
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter.RequestWrapper 75 8 0 1
gboat2.base.plugin.servlet.listener.SessionListener 32 7 0 2
gboat2.base.plugin.struts.convention.GboatConventionUnknownHandler 81 6 0 1
gboat2.base.plugin.struts.freemarker.GboatThemeTemplateLoader 49 5 0 1
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter 127 4 1 2
gboat2.base.plugin.servlet.filter.DisableUrlSessionFilter.HttpServletResponseWrapper 8 4 0 0
gboat2.base.plugin.servlet.filter.GboatUserSessionFilter 59 4 0 1
gboat2.base.plugin.servlet.filter.StaticFileDebugFilter 35 4 0 2
gboat2.base.plugin.struts.interceptor.RequestIntervalCheckInterceptor 51 4 0 4
gboat2.base.plugin.servlet.filter.DisableUrlSessionFilter 22 3 1 1
gboat2.base.plugin.servlet.filter.GboatCSSFilter 28 3 0 1
gboat2.base.plugin.struts.convention.GboatConventionsServiceImpl 23 3 0 1
gboat2.base.plugin.struts.freemarker.GboatFreemarkerManager 27 3 0 1
gboat2.base.plugin.struts.velocity.GboatVelocityManager 22 3 0 1
gboat2.base.plugin.servlet.listener.JDKLoggerConfigListener 21 2 0 1
gboat2.base.plugin.struts.interceptor.DestopMetadataInterceptor 65 2 0 2
gboat2.base.plugin.struts.interceptor.ExceptionHandlerInterceptor 16 2 0 2
gboat2.base.plugin.struts.velocity.GboatVelocityContext 14 2 0 1
gboat2.base.plugin.exception.InternalInvalidException 4 1 0 1
gboat2.base.plugin.servlet.filter.GboatEncodingFilter 24 1 0 1
gboat2.base.plugin.struts.convention.GboatPackageBasedActionConfigBuilder.UrlSet.FileProtocolNormalizer 2 1 0 0
gboat2.base.plugin.struts.dispatcher.GboatStaticContentLoader 20 1 0 1
gboat2.base.plugin.struts.freemarker.GboatClassTemplateLoader 6 1 0 1
gboat2.base.plugin.struts.GboatFileManager 3 1 0 1
gboat2.base.plugin.struts.GboatFileManagerFactory 6 1 0 1
gboat2.base.plugin.struts.interceptor.CallActionLogStackHandlerInterceptor 15 1 0 1
gboat2.base.plugin.struts.velocity.DebugVelocityResourceLoader 20 1 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
40.03 1,473.00 0.10 3.60 1.67

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
gboat2.base.plugin.struts.interceptor.GboatFileUploadInterceptor.intercept(ActionInvocation) 96 36 0
gboat2.base.plugin.struts.convention.GboatPackageBasedActionConfigBuilder.buildUrlSet() 53 20 1
gboat2.base.plugin.struts.interceptor.DestopMetadataInterceptor.intercept(ActionInvocation) 47 20 0
gboat2.base.plugin.struts.convention.GboatConventionUnknownHandler.findResource(ResultTypeConfig,String) 31 17 0
gboat2.base.plugin.servlet.filter.GboatUserSessionFilter.doFilter(ServletRequest,ServletResponse,FilterChain) 29 10 0
gboat2.base.plugin.struts.interceptor.GboatFileUploadInterceptor.getTempDir(ServletContext) 27 10 1
gboat2.base.plugin.struts.interceptor.RequestIntervalCheckInterceptor.intercept(ActionInvocation) 26 11 0
gboat2.base.plugin.struts.convention.GboatConventionUnknownHandler.findResult(String,String,String,ActionContext,ResultTypeConfig) 25 13 0
gboat2.base.plugin.struts.dispatcher.GboatDispatcherResult.extractBundleJsp(String,Bundle) 25 15 1
gboat2.base.plugin.servlet.filter.GboatCSSFilter.doFilter(ServletRequest,ServletResponse,FilterChain) 24 5 0
gboat2.base.plugin.servlet.filter.GboatEncodingFilter.doFilterInternal(HttpServletRequest,HttpServletResponse,FilterChain) 22 8 0
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter.RequestWrapper.escapeHtml(String) 21 7 0
gboat2.base.plugin.struts.freemarker.GboatThemeTemplateLoader.findTemplateSource(String) 21 13 0
gboat2.base.plugin.servlet.filter.DisableUrlSessionFilter.doFilter(ServletRequest,ServletResponse,FilterChain) 19 5 0
gboat2.base.plugin.struts.freemarker.GboatFreemarkerManager.createTemplateLoader(ServletContext,String) 19 10 0
gboat2.base.plugin.struts.dispatcher.GboatStaticContentLoader.findResource(String) 18 7 0
gboat2.base.plugin.struts.velocity.DebugVelocityResourceLoader.getResourceStream(String) 18 11 0
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter.doFilter(ServletRequest,ServletResponse,FilterChain) 16 7 0
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter.isMatched(String,String,String) 16 9 0
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter.RequestWrapper.getParameterMap() 16 8 0
gboat2.base.plugin.servlet.filter.StaticFileDebugFilter.hook(HttpServletRequest,HttpServletResponse,String,String) 16 3 0
gboat2.base.plugin.servlet.listener.JDKLoggerConfigListener.setJdkLogConfigPathSystemProperty(ServletContext) 16 3 0
gboat2.base.plugin.servlet.filter.GboatUserSessionFilter.init(FilterConfig) 15 5 0
gboat2.base.plugin.struts.dispatcher.GboatDispatcherResult.doExecute(String,ActionInvocation) 15 4 1
gboat2.base.plugin.struts.interceptor.DestopMetadataInterceptor.getMethodName(Object,String) 15 5 1
gboat2.base.plugin.struts.velocity.GboatVelocityManager.debugIntercept(Properties) 14 6 0
gboat2.base.plugin.servlet.filter.AntiXssSqlInjectFilter.init(FilterConfig) 13 5 0
gboat2.base.plugin.struts.dispatcher.GboatDispatcherResult.extractBundleJsp(String) 13 5 1
gboat2.base.plugin.servlet.filter.StaticFileDebugFilter.doFilter(ServletRequest,ServletResponse,FilterChain) 12 5 1
gboat2.base.plugin.struts.interceptor.CallActionLogStackHandlerInterceptor.intercept(ActionInvocation) 12 3 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,473.00 9.41 4.19 0.20

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