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 17 220 1399 18 160 27 265
com.github.triceo.splitlog.splitters.exceptions 12 44 403 7 41 9 57
com.github.triceo.splitlog.expectations 6 20 167 2 16 4 40
com.github.triceo.splitlog.splitters 3 15 114 1 4 3 0
com.github.triceo.splitlog.conditions 3 8 39 3 14 3 0
com.github.triceo.splitlog.util 2 6 38 1 4 0 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
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
47 321 2221 36 257 50 362

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
com.github.triceo.splitlog.DefaultLogWatch 213 41 0 1
com.github.triceo.splitlog.DefaultMergingFollower 116 14 0 1
com.github.triceo.splitlog.DefaultMessage 114 17 0 4
com.github.triceo.splitlog.ConsumerManager 108 19 0 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor 106 11 1 1
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser 100 5 1 4
com.github.triceo.splitlog.DefaultFollower 90 15 0 1
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter 80 8 0 1
com.github.triceo.splitlog.DefaultMessageMetric 80 15 0 0
com.github.triceo.splitlog.MessageStore 77 13 0 3
com.github.triceo.splitlog.AbstractCommonFollower 74 32 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine 65 13 1 0
com.github.triceo.splitlog.LogWatchStorageManager 59 10 0 0
com.github.triceo.splitlog.expectations.AbstractExpectation 58 6 1 1
com.github.triceo.splitlog.MessageBuilder 53 14 0 1
com.github.triceo.splitlog.DefaultMessageConsumer 50 7 0 0
com.github.triceo.splitlog.LogWatchTailingManager 47 5 0 1
com.github.triceo.splitlog.expectations.AbstractExpectationManager 37 7 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceParser 31 1 0 0
com.github.triceo.splitlog.DefaultLogWatchBuilder 26 5 0 1
com.github.triceo.splitlog.LogWatchSweepingManager 25 4 0 1
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.util.SplitlogTailer 14 3 0 1
com.github.triceo.splitlog.util.SplitlogThreadFactory 14 3 0 0
com.github.triceo.splitlog.splitters.SimpleTailSplitter 13 6 0 0
com.github.triceo.splitlog.ordering.OriginalOrderingMessageComprator 12 2 0 1
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 213 41 0 1
com.github.triceo.splitlog.AbstractCommonFollower 74 32 0 1
com.github.triceo.splitlog.ConsumerManager 108 19 0 0
com.github.triceo.splitlog.DefaultMessage 114 17 0 4
com.github.triceo.splitlog.DefaultFollower 90 15 0 1
com.github.triceo.splitlog.DefaultMessageMetric 80 15 0 0
com.github.triceo.splitlog.MessageBuilder 53 14 0 1
com.github.triceo.splitlog.DefaultMergingFollower 116 14 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceLine 65 13 1 0
com.github.triceo.splitlog.MessageStore 77 13 0 3
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor 106 11 1 1
com.github.triceo.splitlog.LogWatchStorageManager 59 10 0 0
com.github.triceo.splitlog.splitters.JBossServerLogTailSplitter 80 8 0 1
com.github.triceo.splitlog.expectations.AbstractExpectationManager 37 7 0 1
com.github.triceo.splitlog.DefaultMessageConsumer 50 7 0 0
com.github.triceo.splitlog.splitters.SimpleTailSplitter 13 6 0 0
com.github.triceo.splitlog.expectations.AbstractExpectation 58 6 1 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.DefaultLogWatchBuilder 26 5 0 1
com.github.triceo.splitlog.LogWatchTailingManager 47 5 0 1
com.github.triceo.splitlog.splitters.exceptions.CauseLine 11 4 0 0
com.github.triceo.splitlog.LogWatchSweepingManager 25 4 0 1
com.github.triceo.splitlog.splitters.exceptions.StackTraceEndLine 10 3 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.util.SplitlogTailer 14 3 0 1
com.github.triceo.splitlog.util.SplitlogThreadFactory 14 3 0 0
com.github.triceo.splitlog.splitters.exceptions.CauseParser 19 2 0 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionLineParser 6 2 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
39.32 2,221.00 0.09 6.83 0.77

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.DefaultLogWatch.addLine(String) 29 10 0
com.github.triceo.splitlog.DefaultMergingFollower.write(OutputStream,SimpleMessageCondition,MessageComparator,MessageFormatter) 25 13 0
com.github.triceo.splitlog.splitters.exceptions.ExceptionParser.removePrefix(List) 23 7 0
com.github.triceo.splitlog.DefaultMessage.DefaultMessage(long,Collection,long,TailSplitter,Message) 23 9 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.splitters.JBossServerLogTailSplitter.determineSeverity(List) 20 11 0
com.github.triceo.splitlog.MessageStore.discardBefore(int) 20 8 0
com.github.triceo.splitlog.DefaultFollower.write(OutputStream,SimpleMessageCondition,MessageComparator,MessageFormatter) 19 11 0
com.github.triceo.splitlog.formatters.UnifyingMessageFormatter.format(Message,File) 17 2 0
com.github.triceo.splitlog.expectations.AbstractExpectation.messageReceived(Message,MessageDeliveryStatus,S) 17 6 0
com.github.triceo.splitlog.ConsumerManager.startMeasuring(MessageMeasure,String) 17 9 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.DefaultLogWatch.stop() 15 5 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.LogWatchTailingManager.start() 14 4 0
com.github.triceo.splitlog.MessageStore.getFromRange(int,int) 14 11 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.expectations.AbstractExpectation.call() 13 3 0
com.github.triceo.splitlog.splitters.exceptions.DefaultExceptionDescriptor.Builder.addLine(ExceptionLine) 12 3 0
com.github.triceo.splitlog.ConsumerManager.startConsuming(MessageListener) 12 9 0
com.github.triceo.splitlog.DefaultLogWatchBuilder.buildWith(TailSplitter) 12 6 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,221.00 5.05 2.51 0.03

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