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.jmonit.support.jdbc 7 484 1234 164 858 3 114
org.jmonit.web 8 46 485 30 173 12 113
org.jmonit.features 7 65 411 46 215 5 106
org.jmonit.log 6 57 180 62 315 7 100
org.jmonit 5 51 152 46 304 3 88
org.jmonit.monitors 3 36 136 28 147 6 54
org.jmonit.reporting 5 17 113 14 68 7 75
org.jmonit.events 7 20 74 14 70 4 149
org.jmonit.repositories 2 11 74 12 51 0 31
org.jmonit.support.jaxrpc 1 6 57 4 64 5 16
org.jmonit.support.java13.java.lang 11 11 52 12 40 0 165
org.jmonit.support.aop 1 7 44 8 47 0 15
org.jmonit.spi 5 10 24 14 84 0 75
org.jmonit.util 1 1 8 1 6 0 15
org.jmonit.support.java13.java.sql 2 0 4 2 8 0 30
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
71 822 3048 457 2450 52 1146

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.jmonit.support.jdbc.MonitoredResultSet 387 190 0 2
org.jmonit.support.jdbc.MonitoredCallableStatement 231 113 0 2
org.jmonit.support.jdbc.MonitoredStatement 148 45 0 40
org.jmonit.support.jdbc.MonitoredConnection 137 55 0 42
org.jmonit.support.jdbc.MonitoredPreparedStatement 136 58 0 58
org.jmonit.features.DefaultPluginManager 98 9 0 6
org.jmonit.web.RestServlet 93 5 0 4
org.jmonit.web.JMonitFilter 87 12 0 12
org.jmonit.web.RestServlet2 87 10 0 4
org.jmonit.Stopwatch 74 16 0 16
org.jmonit.log.ConsoleLogger 72 13 0 14
org.jmonit.features.Statistics 71 13 1 12
org.jmonit.reporting.JSonRenderer 69 7 0 6
org.jmonit.features.Concurrency 61 10 1 8
org.jmonit.monitors.AbstractMonitor 56 19 0 12
org.jmonit.support.jdbc.JdbcMonitor 49 8 0 6
org.jmonit.features.HttpStatus 45 7 1 5
org.jmonit.support.jaxrpc.JaxRpcMonitoringHandler 44 6 0 4
org.jmonit.repositories.AbstractRepository 43 9 0 9
org.jmonit.support.jdbc.MonitoredDataSource 39 15 0 14
org.jmonit.support.aop.PerformanceInterceptor 37 7 0 8
org.jmonit.web.JMonitFilterWithWebUI 34 3 0 3
org.jmonit.features.LocalStopwatch 32 13 1 4
org.jmonit.web.MimeUtils 32 2 0 1
org.jmonit.features.LastValues 29 9 0 8
org.jmonit.monitors.DefaultMonitor 27 4 0 3
org.jmonit.monitors.NullMonitor 27 13 0 13
org.jmonit.Monitoring 25 8 0 9
org.jmonit.web.MonitorsIterator 24 5 0 1
org.jmonit.log.Log 22 9 0 9

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.jmonit.support.jdbc.MonitoredResultSet 387 190 0 2
org.jmonit.support.jdbc.MonitoredCallableStatement 231 113 0 2
org.jmonit.support.jdbc.MonitoredPreparedStatement 136 58 0 58
org.jmonit.support.jdbc.MonitoredConnection 137 55 0 42
org.jmonit.support.jdbc.MonitoredStatement 148 45 0 40
org.jmonit.monitors.AbstractMonitor 56 19 0 12
org.jmonit.Stopwatch 74 16 0 16
org.jmonit.support.jdbc.MonitoredDataSource 39 15 0 14
org.jmonit.features.LocalStopwatch 32 13 1 4
org.jmonit.features.Statistics 71 13 1 12
org.jmonit.log.ConsoleLogger 72 13 0 14
org.jmonit.monitors.NullMonitor 27 13 0 13
org.jmonit.web.JMonitFilter 87 12 0 12
org.jmonit.Monitor 12 11 0 11
org.jmonit.features.Concurrency 61 10 1 8
org.jmonit.web.RestServlet2 87 10 0 4
org.jmonit.features.DefaultPluginManager 98 9 0 6
org.jmonit.features.LastValues 29 9 0 8
org.jmonit.log.CommonsLoggingLogger 21 9 0 10
org.jmonit.log.Java14Logger 21 9 0 10
org.jmonit.log.Log 22 9 0 9
org.jmonit.log.Log4jLogger 22 9 0 10
org.jmonit.repositories.AbstractRepository 43 9 0 9
org.jmonit.log.NullLogger 10 8 0 9
org.jmonit.Monitoring 25 8 0 9
org.jmonit.Probe 13 8 0 1
org.jmonit.Repository 9 8 0 9
org.jmonit.support.jdbc.JdbcMonitor 49 8 0 6
org.jmonit.features.HttpStatus 45 7 1 5
org.jmonit.reporting.JSonRenderer 69 7 0 6

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
37.06 3,048.00 0.06 11.58 6.44

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.jmonit.web.RestServlet.getRestResource(StringBuffer) 32 8 1
org.jmonit.support.jdbc.JdbcMonitor.generalizeSql(String) 30 14 1
org.jmonit.features.DefaultPluginManager.registerFeatures(Properties) 29 7 0
org.jmonit.log.ConsoleLogger.log(int,String,Throwable) 28 6 1
org.jmonit.web.RestServlet.restService(String,List,HttpServletResponse) 25 10 0
org.jmonit.reporting.JSonRenderer.visit(Map) 24 7 1
org.jmonit.web.JMonitFilter.initMapping(FilterConfig) 21 4 1
org.jmonit.web.RestServlet2.findResource(List,Object) 21 9 0
org.jmonit.web.JMonitFilterWithWebUI.doFilter(HttpServletRequest,HttpServletResponse,FilterChain) 18 6 0
org.jmonit.features.DefaultPluginManager.readFeatureGroupsConfiguration(Properties) 16 5 0
org.jmonit.reporting.JSonRenderer.sanitize(String) 16 4 1
org.jmonit.features.DefaultPluginManager.readConfiguration() 15 4 0
org.jmonit.support.jaxrpc.JaxRpcMonitoringHandler.stopMonitoring(MessageContext,boolean) 15 5 1
org.jmonit.features.Concurrency.onMonitoringEvent(MonitoringEvent) 14 5 1
org.jmonit.support.jaxrpc.JaxRpcMonitoringHandler.getAction(MessageContext) 14 6 1
org.jmonit.web.JMonitFilter.doFilter(HttpServletRequest,HttpServletResponse,FilterChain) 14 3 1
org.jmonit.monitors.DefaultMonitor.getFeature(Class) 13 7 0
org.jmonit.support.aop.PerformanceInterceptor.invoke(MethodInvocation) 13 6 1
org.jmonit.features.HttpStatus.HttpStatus() 12 3 1
org.jmonit.web.MimeUtils.getMimeTypes(HttpServletRequest) 12 4 0
org.jmonit.web.RestServlet2.convert(String,Class) 12 8 1
org.jmonit.web.VisitableMonitor.accept(Visitor) 12 4 0
org.jmonit.features.Statistics.toString() 11 1 1
org.jmonit.web.RestServlet.getFeatures(String) 11 4 0
org.jmonit.web.RestServlet.getRenderer(List,HttpServletResponse) 11 5 1
org.jmonit.log.Log.getLog(Class) 10 9 0
org.jmonit.Stopwatch.stop() 10 4 1
org.jmonit.features.Statistics.accept(Visitor) 9 1 1
org.jmonit.repositories.AbstractRepository.getMonitor(String) 9 5 1
org.jmonit.web.RestServlet2.service(HttpServletRequest,HttpServletResponse) 9 3 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
3,048.00 2.90 1.35 0.47

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