Fork me on GitHub

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
com.github.triceo.splitlog 20 195 1239 19 192 36 453
com.github.triceo.splitlog.splitters.exceptions 12 44 395 7 44 8 57
com.github.triceo.splitlog.splitters 3 12 102 1 4 3 0
com.github.triceo.splitlog.formatters 2 4 37 2 10 2 0
com.github.triceo.splitlog.ordering 2 4 24 2 8 2 0
com.github.triceo.splitlog.conditions 1 4 16 1 3 1 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
40 263 1813 32 261 52 510

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
com.github.triceo.splitlog.DefaultLogWatch 157 29 0 1
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor 106 11 1 1
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser 104 6 2 4
com.github.triceo.splitlog.DefaultMessage 102 16 0 4
com.github.triceo.splitlog.LogWatchBuilder 92 23 0 2
com.github.triceo.splitlog.MessageStore 76 13 0 3
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter 70 6 0 1
com.github.triceo.splitlog.AbstractMergingFollower 69 8 0 0
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine 65 13 1 0
com.github.triceo.splitlog.AbstractLogWatchFollower 65 13 0 1
com.github.triceo.splitlog.LogWatchTailingManager 53 6 0 1
com.github.triceo.splitlog.MessageBuilder 53 14 0 1
com.github.triceo.splitlog.LogWatchStorageManager 51 10 0 0
com.github.triceo.splitlog.NonStoringFollower 48 13 0 1
com.github.triceo.splitlog.MessageExchange 37 2 0 0
com.github.triceo.splitlog.MessageMetricManager 34 9 0 0
com.github.triceo.splitlog.MessageMetricExchange 33 3 0 0
com.github.triceo.splitlog.splitters.exceptions.StackTraceParser 31 1 0 0
com.github.triceo.splitlog.DefaultMessageMetric 25 7 0 0
com.github.triceo.splitlog.LogWatchSweepingManager 25 4 0 1
com.github.triceo.splitlog.NonStoringMergingFollower 24 5 0 0
com.github.triceo.splitlog.AbstractFollower 24 11 0 1
com.github.triceo.splitlog.formatters.UnifyingMessageFormatter 20 2 0 1
com.github.triceo.splitlog.LogWatchStorageSweeper 19 2 0 1
com.github.triceo.splitlog.LogWatchTailerListener 17 6 0 0
com.github.triceo.splitlog.ordering.OriginalOrderingMessageComprator 12 2 0 1
com.github.triceo.splitlog.splitters.exceptions.CauseLine 11 4 0 0
com.github.triceo.splitlog.splitters.exceptions.StackTraceEndParser 11 1 0 0
com.github.triceo.splitlog.splitters.SimpleTailSplitter 11 5 0 0
com.github.triceo.splitlog.splitters.exceptions.StackTraceEndLine 10 3 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
com.github.triceo.splitlog.DefaultLogWatch 157 29 0 1
com.github.triceo.splitlog.LogWatchBuilder 92 23 0 2
com.github.triceo.splitlog.DefaultMessage 102 16 0 4
com.github.triceo.splitlog.MessageBuilder 53 14 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine 65 13 1 0
com.github.triceo.splitlog.AbstractLogWatchFollower 65 13 0 1
com.github.triceo.splitlog.NonStoringFollower 48 13 0 1
com.github.triceo.splitlog.MessageStore 76 13 0 3
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor 106 11 1 1
com.github.triceo.splitlog.AbstractFollower 24 11 0 1
com.github.triceo.splitlog.LogWatchStorageManager 51 10 0 0
com.github.triceo.splitlog.MessageMetricManager 34 9 0 0
com.github.triceo.splitlog.AbstractMergingFollower 69 8 0 0
com.github.triceo.splitlog.DefaultMessageMetric 25 7 0 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser 104 6 2 4
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter 70 6 0 1
com.github.triceo.splitlog.LogWatchTailerListener 17 6 0 0
com.github.triceo.splitlog.LogWatchTailingManager 53 6 0 1
com.github.triceo.splitlog.splitters.SimpleTailSplitter 11 5 0 0
com.github.triceo.splitlog.NonStoringMergingFollower 24 5 0 0
com.github.triceo.splitlog.splitters.exceptions.CauseLine 11 4 0 0
com.github.triceo.splitlog.conditions.AllMessagesAcceptingCondition 9 4 0 1
com.github.triceo.splitlog.LogWatchSweepingManager 25 4 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceEndLine 10 3 0 0
com.github.triceo.splitlog.MessageMetricExchange 33 3 0 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionLineParser 6 2 0 1
com.github.triceo.splitlog.formatters.NoopMessageFormatter 9 2 0 1
com.github.triceo.splitlog.formatters.UnifyingMessageFormatter 20 2 0 1
com.github.triceo.splitlog.ordering.OriginalOrderingMessageComprator 12 2 0 1
com.github.triceo.splitlog.ordering.TimestampOrderingMessageComparator 6 2 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
37.73 1,813.00 0.10 6.58 0.80

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
com.github.triceo.splitlog.splitters.exceptions.StackTraceParser.parse(String) 30 20 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor.equals(Object) 29 24 0
com.github.triceo.splitlog.AbstractMergingFollower.write(OutputStream,SimpleMessageCondition,MessageComparator,MessageFormatter) 25 13 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.removePrefix(List) 23 7 0
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine.StackTraceLine(String,String,Source,int,String) 22 17 0
com.github.triceo.splitlog.DefaultMessage.DefaultMessage(long,Collection,long,TailSplitter,Message) 21 8 1
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter.determineSeverity(List) 20 11 0
com.github.triceo.splitlog.MessageStore.discardBefore(int) 20 8 0
com.github.triceo.splitlog.MessageExchange.messageReceived(Message,MessageDeliveryStatus,MessageSource) 19 11 0
com.github.triceo.splitlog.AbstractLogWatchFollower.write(OutputStream,SimpleMessageCondition,MessageComparator,MessageFormatter) 19 11 0
com.github.triceo.splitlog.formatters.UnifyingMessageFormatter.format(Message,File) 17 2 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.parse(Collection) 16 7 0
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine.toString() 16 6 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.parseLine(LineType,String) 15 13 0
com.github.triceo.splitlog.DefaultMessage.toString() 15 2 0
com.github.triceo.splitlog.DefaultLogWatch.addLine(String) 15 7 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.LineType.determineParser() 14 13 0
com.github.triceo.splitlog.LogWatchStorageSweeper.run() 14 5 0
com.github.triceo.splitlog.MessageExchange.waitForMessage(MidDeliveryMessageCondition,long,TimeUnit) 14 8 0
com.github.triceo.splitlog.LogWatchBuilder.getDelay(int,TimeUnit) 14 9 0
com.github.triceo.splitlog.MessageMetricExchange.waitForMessage(MessageMetricCondition,long,TimeUnit) 14 8 0
com.github.triceo.splitlog.MessageStore.getFromRange(int,int) 14 11 0
com.github.triceo.splitlog.DefaultLogWatch.startFollowingActually(boolean) 14 5 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor.toString() 13 5 0
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter.determineDate(List) 13 1 0
com.github.triceo.splitlog.AbstractLogWatchFollower.mergeWith(CommonFollower) 13 7 0
com.github.triceo.splitlog.AbstractMergingFollower.mergeWith(CommonFollower) 13 6 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor.Builder.addLine(ExceptionLine) 12 3 0
com.github.triceo.splitlog.LogWatchTailingManager.start(boolean) 12 5 0
com.github.triceo.splitlog.MessageMetricExchange.messageReceived(Message,MessageDeliveryStatus,MessageSource) 12 6 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,813.00 4.95 2.45 0.04

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