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.logging.action 3 27 281 14 76 43 31
gboat2.base.logging.service.impl 2 11 104 7 36 3 1
gboat2.base.logging.util 1 9 48 10 38 2 3
gboat2.base.logging.aspectj 2 4 23 1 9 3 0
gboat2.base.logging.layout 2 1 6 1 7 1 4
gboat2.base.logging.service 1 2 5 2 11 0 0
gboat2.base.logging 1 0 3 0 0 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
12 54 470 35 177 52 39

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
gboat2.base.logging.action.LogConfigAction 191 21 0 12
gboat2.base.logging.service.impl.BusinessLogServiceImpl 59 9 0 6
gboat2.base.logging.util.Priority 38 9 0 10
gboat2.base.logging.action.SystemLogAction 37 6 0 1
gboat2.base.logging.service.impl.SystemLogServiceImpl 22 2 0 1
gboat2.base.logging.aspectj.LogServiceAspectJ 15 3 0 1
gboat2.base.logging.layout.Gboat2HTMLLayout 4 0 1 1
gboat2.base.logging.layout.Gboat2HTMLLayout.DefineLayOut 3 1 0 0
gboat2.base.logging.service.ISystemLogService 3 2 0 2
gboat2.base.logging.action.BusinessLogAction 2 0 0 1
gboat2.base.logging.aspectj.ILogServiceAspectJ 2 1 0 0
gboat2.base.logging.Constants 2 0 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
gboat2.base.logging.action.LogConfigAction 191 21 0 12
gboat2.base.logging.service.impl.BusinessLogServiceImpl 59 9 0 6
gboat2.base.logging.util.Priority 38 9 0 10
gboat2.base.logging.action.SystemLogAction 37 6 0 1
gboat2.base.logging.aspectj.LogServiceAspectJ 15 3 0 1
gboat2.base.logging.service.impl.SystemLogServiceImpl 22 2 0 1
gboat2.base.logging.service.ISystemLogService 3 2 0 2
gboat2.base.logging.aspectj.ILogServiceAspectJ 2 1 0 0
gboat2.base.logging.layout.Gboat2HTMLLayout.DefineLayOut 3 1 0 0
gboat2.base.logging.action.BusinessLogAction 2 0 0 1
gboat2.base.logging.Constants 2 0 0 0
gboat2.base.logging.layout.Gboat2HTMLLayout 4 0 1 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
31.50 470.00 0.08 4.50 2.92

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
gboat2.base.logging.action.LogConfigAction.writeToFile(String) 48 22 1
gboat2.base.logging.action.LogConfigAction.setDefaultRootLevel() 27 7 1
gboat2.base.logging.service.impl.BusinessLogServiceImpl.log(Level,String,String,String,String) 27 7 0
gboat2.base.logging.action.LogConfigAction.apply() 23 7 1
gboat2.base.logging.action.SystemLogAction.systemLogRead() 22 6 0
gboat2.base.logging.action.LogConfigAction.readFromFile(String) 15 6 1
gboat2.base.logging.service.impl.SystemLogServiceImpl.getTotalLineNumber(File) 13 3 0
gboat2.base.logging.util.Priority.Priority() 11 3 1
gboat2.base.logging.action.LogConfigAction.reRuntimeEnvConfigLog4jProperties() 9 1 1
gboat2.base.logging.aspectj.LogServiceAspectJ.invoke(ProceedingJoinPoint) 9 1 0
gboat2.base.logging.action.LogConfigAction.reBundleConfigLog4jProperies(Properties) 8 1 1
gboat2.base.logging.service.impl.BusinessLogServiceImpl.insertBusinessLogEntry(BusinessLogEntry) 8 3 1
gboat2.base.logging.service.impl.SystemLogServiceImpl.getTotalPage(int) 8 5 0
gboat2.base.logging.action.LogConfigAction.loadProperties(String) 7 1 1
gboat2.base.logging.action.LogConfigAction.storeProperties(Properties,String) 6 1 1
gboat2.base.logging.util.Priority.getLogRealPath() 6 3 1
gboat2.base.logging.action.LogConfigAction.execute() 4 1 0
gboat2.base.logging.action.LogConfigAction.saveLog4jConfig() 4 1 1
gboat2.base.logging.action.LogConfigAction.checkWebAppRootKeyExist() 4 2 0
gboat2.base.logging.service.impl.BusinessLogServiceImpl.debug(BusinessLogEntry) 4 2 1
gboat2.base.logging.service.impl.BusinessLogServiceImpl.info(BusinessLogEntry) 4 2 1
gboat2.base.logging.service.impl.BusinessLogServiceImpl.warn(BusinessLogEntry) 4 2 1
gboat2.base.logging.service.impl.BusinessLogServiceImpl.error(BusinessLogEntry) 4 2 1
gboat2.base.logging.action.LogConfigAction.properties() 3 1 1
gboat2.base.logging.action.LogConfigAction.getBusinessLogRealPath() 3 1 0
gboat2.base.logging.action.LogConfigAction.getSystemLogRealPath() 3 1 0
gboat2.base.logging.util.Priority.setDefaultLevel(Level) 3 2 1
gboat2.base.logging.action.LogConfigAction.getProperties() 2 1 0
gboat2.base.logging.action.LogConfigAction.setProperties(String) 2 1 0
gboat2.base.logging.action.LogConfigAction.getBusinessLevel() 2 1 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
470.00 6.22 2.24 0.48

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