JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis, using JavaNCSS version 32.53.
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
joptsimple 32 258 1070 122 1242 0 675
joptsimple.internal 12 61 353 29 196 0 288
joptsimple.util 4 21 105 9 61 0 96
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
48 340 1528 160 1499 0 1059

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
joptsimple.OptionParser 181 43 0 8
joptsimple.BuiltinHelpFormatter 127 28 1 29
joptsimple.OptionSet 103 20 0 13
joptsimple.ArgumentAcceptingOptionSpec 91 25 0 9
joptsimple.internal.AbbreviationMap 86 12 0 7
joptsimple.AbstractOptionSpec 61 17 0 1
joptsimple.OptionSpecTokenizer 54 7 0 1
joptsimple.internal.Reflection 44 9 0 4
joptsimple.OptionSpecBuilder 44 9 0 7
joptsimple.internal.Columns 41 6 0 1
joptsimple.OptionException 41 14 0 2
joptsimple.internal.Rows 40 9 0 1
joptsimple.NonOptionArgumentSpec 37 14 0 4
joptsimple.util.DateConverter 30 6 0 3
joptsimple.ParserRules 28 8 0 1
joptsimple.OptionParserState 27 3 2 1
joptsimple.internal.Strings 23 6 0 6
joptsimple.OptionalArgumentOptionSpec 23 4 0 1
joptsimple.util.KeyValuePair 22 5 0 2
joptsimple.NoArgumentOptionSpec 21 10 0 1
joptsimple.OptionParserState.OptionParserState 19 1 0 0
joptsimple.internal.Classes 18 3 0 3
joptsimple.util.RegexMatcher 17 6 0 3
joptsimple.internal.Row 15 3 0 1
joptsimple.ArgumentList 14 5 0 1
joptsimple.internal.MethodInvokingValueConverter 12 4 0 1
joptsimple.util.InetAddressConverter 11 4 0 1
joptsimple.internal.ConstructorInvokingValueConverter 10 4 0 1
joptsimple.OptionDeclarer 10 9 0 10
joptsimple.OptionDescriptor 10 9 0 10

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
joptsimple.OptionParser 181 43 0 8
joptsimple.BuiltinHelpFormatter 127 28 1 29
joptsimple.ArgumentAcceptingOptionSpec 91 25 0 9
joptsimple.OptionSet 103 20 0 13
joptsimple.AbstractOptionSpec 61 17 0 1
joptsimple.NonOptionArgumentSpec 37 14 0 4
joptsimple.OptionException 41 14 0 2
joptsimple.internal.AbbreviationMap 86 12 0 7
joptsimple.NoArgumentOptionSpec 21 10 0 1
joptsimple.internal.Reflection 44 9 0 4
joptsimple.internal.Rows 40 9 0 1
joptsimple.OptionDeclarer 10 9 0 10
joptsimple.OptionDescriptor 10 9 0 10
joptsimple.OptionSpecBuilder 44 9 0 7
joptsimple.ParserRules 28 8 0 1
joptsimple.OptionSpecTokenizer 54 7 0 1
joptsimple.internal.Columns 41 6 0 1
joptsimple.internal.Strings 23 6 0 6
joptsimple.util.DateConverter 30 6 0 3
joptsimple.util.RegexMatcher 17 6 0 3
joptsimple.ArgumentList 14 5 0 1
joptsimple.util.KeyValuePair 22 5 0 2
joptsimple.internal.ConstructorInvokingValueConverter 10 4 0 1
joptsimple.internal.MethodInvokingValueConverter 12 4 0 1
joptsimple.OptionalArgumentOptionSpec 23 4 0 1
joptsimple.OptionSpec 5 4 0 5
joptsimple.util.InetAddressConverter 11 4 0 1
joptsimple.internal.Classes 18 3 0 3
joptsimple.internal.Row 15 3 0 1
joptsimple.OptionParserState 27 3 2 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
28.40 1,528.00 0.06 7.08 3.33

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
joptsimple.OptionSpecTokenizer.next() 22 11 0
joptsimple.OptionParserState.moreOptions(boolean) 21 1 0
joptsimple.OptionParserState.OptionParserState.handleArgument(OptionParser,ArgumentList,OptionSet) 19 11 0
joptsimple.internal.AbbreviationMap.add(boolean[],V,int,int) 17 7 0
joptsimple.AbstractOptionSpec.arrangeOptions(String) 15 5 0
joptsimple.OptionParser.missingRequiredOptions(OptionSet) 14 10 0
joptsimple.internal.AbbreviationMap.remove(boolean[],int,int) 13 9 0
joptsimple.OptionalArgumentOptionSpec.detectOptionArgument(OptionParser,ArgumentList,OptionSet) 12 6 0
joptsimple.internal.Columns.piecesOfEmbeddedLine(String,int) 11 3 0
joptsimple.BuiltinHelpFormatter.createOptionDisplay(OptionDescriptor) 10 4 1
joptsimple.OptionParser.handleShortOptionCluster(String,ArgumentList,OptionSet) 10 4 0
joptsimple.OptionParser.putRequiredOption(String,OptionSpec,OptionSpec) 10 5 0
joptsimple.OptionSet.valueOf(V) 10 6 1
joptsimple.OptionSet.valuesOf(V) 10 5 1
joptsimple.OptionSet.addWithArgument(AbstractOptionSpec,String) 10 4 0
joptsimple.util.DateConverter.message(String) 10 2 0
joptsimple.BuiltinHelpFormatter.appendTypeIndicator(StringBuilder,String,String,char,char) 9 4 1
joptsimple.internal.AbbreviationMap.removeAtEndOfKey() 9 4 0
joptsimple.internal.Columns.processNextWord(String,StringBuilder,int,int,int,String) 9 2 0
joptsimple.internal.Reflection.findConverter(V) 9 6 1
joptsimple.OptionException.multipleOptionString() 9 3 0
joptsimple.OptionParser.parse(String) 9 2 1
joptsimple.OptionSet.equals(Object) 9 7 0
joptsimple.BuiltinHelpFormatter.format(OptionDescriptor) 8 1 1
joptsimple.BuiltinHelpFormatter.addRows(OptionDescriptor) 8 2 1
joptsimple.internal.AbbreviationMap.get(String) 8 4 1
joptsimple.internal.Reflection.reflectionException(Exception) 8 7 0
joptsimple.internal.Rows.fitToWidth() 8 3 0
joptsimple.OptionSpecBuilder.validatedDependents(String,String) 8 4 0
joptsimple.ArgumentAcceptingOptionSpec.addArguments(OptionSet,String) 7 3 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
1,528.00 3.62 1.88 0.34

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