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
gnu.hylafax 6 195 819 124 1195 107 400
gnu.hylafax.job 3 57 349 26 224 9 87
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
9 252 1168 150 1419 116 487

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
gnu.hylafax.HylaFAXClientProtocol 395 47 0 3
gnu.hylafax.job.TimeParser 177 5 1 7
gnu.hylafax.HylaFAXClient 170 31 0 30
gnu.hylafax.job.Job 127 48 0 14
gnu.hylafax.Pagesize 64 5 0 6
gnu.hylafax.Job 55 44 0 15
gnu.hylafax.ClientProtocol 55 48 0 49
gnu.hylafax.Client 21 20 0 21
gnu.hylafax.job.ThreadSafeJob 18 4 0 5

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
gnu.hylafax.job.Job 127 48 0 14
gnu.hylafax.ClientProtocol 55 48 0 49
gnu.hylafax.HylaFAXClientProtocol 395 47 0 3
gnu.hylafax.Job 55 44 0 15
gnu.hylafax.HylaFAXClient 170 31 0 30
gnu.hylafax.Client 21 20 0 21
gnu.hylafax.job.TimeParser 177 5 1 7
gnu.hylafax.Pagesize 64 5 0 6
gnu.hylafax.job.ThreadSafeJob 18 4 0 5

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
120.22 1,168.00 0.11 28.00 16.67

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
gnu.hylafax.job.TimeParser.parse(String) 74 36 1
gnu.hylafax.HylaFAXClient.get(String,OutputStream,int) 35 13 0
gnu.hylafax.HylaFAXClient.put(InputStream,String,boolean) 29 11 1
gnu.hylafax.job.TimeParser.getKillTime(String) 24 6 1
gnu.hylafax.HylaFAXClientProtocol.stot(InputStream) 20 5 0
gnu.hylafax.HylaFAXClient.getList(String,boolean) 19 6 0
gnu.hylafax.HylaFAXClientProtocol.jsubm(long) 18 6 0
gnu.hylafax.HylaFAXClientProtocol.job() 16 5 0
gnu.hylafax.HylaFAXClientProtocol.jparm(String) 16 8 0
gnu.hylafax.HylaFAXClient.retry(long,String) 14 4 1
gnu.hylafax.HylaFAXClientProtocol.config(String,String) 13 4 0
gnu.hylafax.HylaFAXClientProtocol.size(String) 13 5 0
gnu.hylafax.HylaFAXClientProtocol.getServerVersion() 12 6 1
gnu.hylafax.HylaFAXClientProtocol.jparm(String,String) 12 4 0
gnu.hylafax.HylaFAXClientProtocol.site(String,String) 12 5 0
gnu.hylafax.HylaFAXClientProtocol.idle() 11 3 0
gnu.hylafax.HylaFAXClientProtocol.jnew(boolean) 11 4 0
gnu.hylafax.HylaFAXClientProtocol.jobfmt() 11 3 0
gnu.hylafax.HylaFAXClientProtocol.jsubm() 11 3 0
gnu.hylafax.HylaFAXClientProtocol.job(long) 10 4 0
gnu.hylafax.HylaFAXClientProtocol.jobfmt(String) 10 3 0
gnu.hylafax.HylaFAXClientProtocol.tzone(String) 10 3 0
gnu.hylafax.HylaFAXClientProtocol.vrfy(String) 10 3 0
gnu.hylafax.HylaFAXClientProtocol.admin(String) 9 3 0
gnu.hylafax.HylaFAXClientProtocol.answer(String) 9 3 0
gnu.hylafax.HylaFAXClientProtocol.filefmt() 9 3 0
gnu.hylafax.HylaFAXClientProtocol.form(String) 9 3 0
gnu.hylafax.HylaFAXClientProtocol.idle(long) 9 3 0
gnu.hylafax.HylaFAXClientProtocol.jdele(long) 9 3 0
gnu.hylafax.HylaFAXClientProtocol.jintr(long) 9 3 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,168.00 3.60 1.66 0.55

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