Fork me on GitHub

JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 33.54.
JavaNCSS web site.

Packages

Packages

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

Packages sorted by NCSS.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
com.github.triceo.splitlog 16 216 1423 52 391 24 58
com.github.triceo.splitlog.splitters.exceptions 12 44 403 9 80 9 18
org.apache.commons.io.input 3 34 198 30 427 34 68
com.github.triceo.splitlog.expectations 6 20 172 7 53 5 3
com.github.triceo.splitlog.splitters 3 15 114 1 4 3 0
com.github.triceo.splitlog.util 3 8 67 1 4 0 0
com.github.triceo.splitlog.conditions 3 8 39 3 14 3 0
com.github.triceo.splitlog.formatters 2 4 37 2 10 2 0
com.github.triceo.splitlog.ordering 2 4 18 2 8 2 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
50 353 2471 107 991 82 147

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
com.github.triceo.splitlog.DefaultLogWatch 148 34 0 7
com.github.triceo.splitlog.DefaultMessage 125 18 1 4
com.github.triceo.splitlog.DefaultMergingFollower 110 13 0 1
com.github.triceo.splitlog.ConsumerManager 107 19 0 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor 106 11 1 2
org.apache.commons.io.input.TailerRun 102 6 0 1
com.github.triceo.splitlog.LogWatchTailingManager 100 10 0 3
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser 100 5 1 5
com.github.triceo.splitlog.DefaultFollower 96 14 0 1
com.github.triceo.splitlog.LogWatchStorageManager 92 13 0 8
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter 80 8 0 1
com.github.triceo.splitlog.MessageStore 77 13 0 14
com.github.triceo.splitlog.DefaultMessageMetric 72 13 0 0
org.apache.commons.io.input.Tailer 68 20 0 20
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine 65 13 1 0
com.github.triceo.splitlog.AbstractCommonFollower 62 29 0 2
com.github.triceo.splitlog.expectations.AbstractExpectation 58 6 1 3
com.github.triceo.splitlog.MessageBuilder 52 14 0 6
com.github.triceo.splitlog.DefaultMessageConsumer 50 7 0 0
com.github.triceo.splitlog.LogWatchStorageSweeper 38 4 0 3
com.github.triceo.splitlog.expectations.AbstractExpectationManager 37 7 0 4
com.github.triceo.splitlog.splitters.exceptions.StackTraceParser 31 1 0 0
com.github.triceo.splitlog.util.LogUtil 27 3 1 0
com.github.triceo.splitlog.DefaultLogWatchBuilder 26 5 0 1
com.github.triceo.splitlog.LogWatchTailerListener 22 9 0 0
com.github.triceo.splitlog.formatters.UnifyingMessageFormatter 20 2 0 1
com.github.triceo.splitlog.splitters.exceptions.CauseParser 19 2 0 0
com.github.triceo.splitlog.util.SplitlogThreadFactory 14 3 0 0
com.github.triceo.splitlog.splitters.SimpleTailSplitter 13 6 0 0
com.github.triceo.splitlog.splitters.exceptions.CauseLine 11 4 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
com.github.triceo.splitlog.DefaultLogWatch 148 34 0 7
com.github.triceo.splitlog.AbstractCommonFollower 62 29 0 2
org.apache.commons.io.input.Tailer 68 20 0 20
com.github.triceo.splitlog.ConsumerManager 107 19 0 0
com.github.triceo.splitlog.DefaultMessage 125 18 1 4
com.github.triceo.splitlog.DefaultFollower 96 14 0 1
com.github.triceo.splitlog.MessageBuilder 52 14 0 6
com.github.triceo.splitlog.DefaultMergingFollower 110 13 0 1
com.github.triceo.splitlog.DefaultMessageMetric 72 13 0 0
com.github.triceo.splitlog.LogWatchStorageManager 92 13 0 8
com.github.triceo.splitlog.MessageStore 77 13 0 14
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine 65 13 1 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor 106 11 1 2
com.github.triceo.splitlog.LogWatchTailingManager 100 10 0 3
com.github.triceo.splitlog.LogWatchTailerListener 22 9 0 0
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter 80 8 0 1
org.apache.commons.io.input.TailerListener 9 8 0 9
com.github.triceo.splitlog.DefaultMessageConsumer 50 7 0 0
com.github.triceo.splitlog.expectations.AbstractExpectationManager 37 7 0 4
com.github.triceo.splitlog.expectations.AbstractExpectation 58 6 1 3
com.github.triceo.splitlog.splitters.SimpleTailSplitter 13 6 0 0
org.apache.commons.io.input.TailerRun 102 6 0 1
com.github.triceo.splitlog.DefaultLogWatchBuilder 26 5 0 1
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser 100 5 1 5
com.github.triceo.splitlog.LogWatchStorageSweeper 38 4 0 3
com.github.triceo.splitlog.splitters.exceptions.CauseLine 11 4 0 0
com.github.triceo.splitlog.conditions.AllFollowerMessagesAcceptingCondition 7 3 0 1
com.github.triceo.splitlog.conditions.AllLogWatchMessagesAcceptingCondition 7 3 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceEndLine 10 3 0 0
com.github.triceo.splitlog.util.LogUtil 27 3 1 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
41.08 2,471.00 0.12 7.06 2.14

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.commons.io.input.TailerRun.run() 42 12 0
org.apache.commons.io.input.TailerRun.readLines(RandomAccessFile) 32 7 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceParser.parse(String) 30 20 0
com.github.triceo.splitlog.LogWatchTailingManager.readLine(String) 29 10 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor.equals(Object) 29 24 0
com.github.triceo.splitlog.DefaultMergingFollower.write(OutputStream,SimpleMessageCondition,MessageComparator,MessageFormatter) 25 13 0
com.github.triceo.splitlog.DefaultMessage.DefaultMessage(long,String,long,TailSplitter,Message) 23 9 1
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.removePrefix(String) 23 7 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine.StackTraceLine(String,String,Source,int,String) 22 17 0
com.github.triceo.splitlog.DefaultMessage.toString() 21 2 0
com.github.triceo.splitlog.DefaultMessageConsumer.equals(Object) 21 17 0
com.github.triceo.splitlog.MessageStore.discardBefore(int) 20 8 1
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter.determineSeverity(String) 20 11 0
com.github.triceo.splitlog.DefaultFollower.write(OutputStream,SimpleMessageCondition,MessageComparator,MessageFormatter) 19 11 0
com.github.triceo.splitlog.ConsumerManager.startMeasuring(P,String) 17 9 0
com.github.triceo.splitlog.expectations.AbstractExpectation.messageReceived(Message,MessageDeliveryStatus,S) 17 6 0
com.github.triceo.splitlog.formatters.UnifyingMessageFormatter.format(Message,File) 17 2 0
com.github.triceo.splitlog.util.LogUtil.notify(Logger,Level,String,Object) 17 6 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.parse(String) 16 7 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine.toString() 16 6 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.parseLine(LineType,String) 15 13 1
com.github.triceo.splitlog.DefaultLogWatch.startHandingDown(Follower,String) 14 10 0
com.github.triceo.splitlog.LogWatchStorageSweeper.run() 14 5 0
com.github.triceo.splitlog.LogWatchTailingManager.start() 14 4 1
com.github.triceo.splitlog.MessageStore.getFromRange(int,int) 14 11 1
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.LineType.determineParser() 14 13 0
com.github.triceo.splitlog.DefaultLogWatch.stop() 13 5 1
com.github.triceo.splitlog.expectations.AbstractExpectation.call() 13 3 1
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter.determineDate(String) 13 1 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor.toString() 13 5 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,471.00 5.07 2.47 0.22

Explanations

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