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 22 244 1492 20 192 36 458
com.github.triceo.splitlog.splitters.exceptions 12 44 403 7 41 9 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.conditions 2 6 26 2 6 2 0
com.github.triceo.splitlog.ordering 2 4 24 2 8 2 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
43 314 2084 34 261 54 515

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
com.github.triceo.splitlog.DefaultLogWatch 173 37 0 1
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor 106 11 1 1
com.github.triceo.splitlog.DefaultMessage 105 16 0 4
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser 100 5 1 4
com.github.triceo.splitlog.LogWatchBuilder 98 25 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.DefaultMessageMetric 70 13 0 0
com.github.triceo.splitlog.NonStoringFollower 67 19 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine 65 13 1 0
com.github.triceo.splitlog.AbstractMergingFollower 64 8 0 0
com.github.triceo.splitlog.ConsumerManager 59 11 0 0
com.github.triceo.splitlog.MeasuringConsumerManager 58 11 0 0
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.AbstractLogWatchFollower 51 10 0 1
com.github.triceo.splitlog.MessageMetricExchange 46 5 0 0
com.github.triceo.splitlog.NonStoringMergingFollower 46 9 0 0
com.github.triceo.splitlog.MessageExchange 40 4 0 0
com.github.triceo.splitlog.AbstractFollower 37 15 0 2
com.github.triceo.splitlog.splitters.exceptions.StackTraceParser 31 1 0 0
com.github.triceo.splitlog.LogWatchSweepingManager 25 4 0 1
com.github.triceo.splitlog.DefaultMessageConsumer 21 5 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.LogWatchStorageSweeper 19 2 0 1
com.github.triceo.splitlog.LogWatchTailerListener 16 6 0 0
com.github.triceo.splitlog.ordering.OriginalOrderingMessageComprator 12 2 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceEndParser 11 1 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
com.github.triceo.splitlog.DefaultLogWatch 173 37 0 1
com.github.triceo.splitlog.LogWatchBuilder 98 25 0 2
com.github.triceo.splitlog.NonStoringFollower 67 19 0 1
com.github.triceo.splitlog.DefaultMessage 105 16 0 4
com.github.triceo.splitlog.AbstractFollower 37 15 0 2
com.github.triceo.splitlog.MessageBuilder 53 14 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine 65 13 1 0
com.github.triceo.splitlog.MessageStore 76 13 0 3
com.github.triceo.splitlog.DefaultMessageMetric 70 13 0 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor 106 11 1 1
com.github.triceo.splitlog.MeasuringConsumerManager 58 11 0 0
com.github.triceo.splitlog.ConsumerManager 59 11 0 0
com.github.triceo.splitlog.LogWatchStorageManager 51 10 0 0
com.github.triceo.splitlog.AbstractLogWatchFollower 51 10 0 1
com.github.triceo.splitlog.NonStoringMergingFollower 46 9 0 0
com.github.triceo.splitlog.AbstractMergingFollower 64 8 0 0
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter 70 6 0 1
com.github.triceo.splitlog.LogWatchTailingManager 53 6 0 1
com.github.triceo.splitlog.LogWatchTailerListener 16 6 0 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser 100 5 1 4
com.github.triceo.splitlog.splitters.SimpleTailSplitter 11 5 0 0
com.github.triceo.splitlog.DefaultMessageConsumer 21 5 0 0
com.github.triceo.splitlog.MessageMetricExchange 46 5 0 0
com.github.triceo.splitlog.splitters.exceptions.CauseLine 11 4 0 0
com.github.triceo.splitlog.LogWatchSweepingManager 25 4 0 1
com.github.triceo.splitlog.MessageExchange 40 4 0 0
com.github.triceo.splitlog.splitters.exceptions.StackTraceEndLine 10 3 0 0
com.github.triceo.splitlog.conditions.AllLogWatchMessagesAcceptingCondition 7 3 0 1
com.github.triceo.splitlog.conditions.AllFollowerMessagesAcceptingCondition 7 3 0 1
com.github.triceo.splitlog.splitters.exceptions.ExceptionLineParser 6 2 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
40.60 2,084.00 0.07 7.30 0.79

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.AbstractLogWatchFollower.write(OutputStream,SimpleMessageCondition,MessageComparator,MessageFormatter) 19 11 0
com.github.triceo.splitlog.DefaultMessage.toString() 18 2 0
com.github.triceo.splitlog.formatters.UnifyingMessageFormatter.format(Message,File) 17 2 0
com.github.triceo.splitlog.MeasuringConsumerManager.startMeasuring(MessageMeasure,String) 17 9 0
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine.toString() 16 6 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.parse(Collection) 16 7 0
com.github.triceo.splitlog.MessageExchange.waitForMessage(MidDeliveryMessageCondition,long,TimeUnit) 16 10 0
com.github.triceo.splitlog.MessageMetricExchange.waitForMessage(MessageMetricCondition,long,TimeUnit) 16 10 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.parseLine(LineType,String) 15 13 0
com.github.triceo.splitlog.MessageExchange.messageReceived(Message,MessageDeliveryStatus,S) 15 8 0
com.github.triceo.splitlog.MessageMetricExchange.messageReceived(Message,MessageDeliveryStatus,S) 15 8 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.MessageStore.getFromRange(int,int) 14 11 0
com.github.triceo.splitlog.LogWatchBuilder.getDelay(int,TimeUnit) 14 9 0
com.github.triceo.splitlog.DefaultLogWatch.startHandingDown(MessageMeasure,String) 14 10 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.DefaultLogWatch.startFollowingActually(boolean) 13 4 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor.Builder.addLine(ExceptionLine) 12 3 0
com.github.triceo.splitlog.LogWatchTailingManager.start(boolean) 12 5 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,084.00 4.87 2.43 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).