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.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
org.apache.commons.lang3317265184744116115771947
org.apache.commons.lang3.text1934319993623199198225
org.apache.commons.lang3.builder1435518283694113202272
org.apache.commons.lang3.time2621414412362276177241
org.apache.commons.lang3.math39386196966200162
org.apache.commons.lang3.reflect585724901016199121
org.apache.commons.lang3.concurrent18103472118149817243
org.apache.commons.lang3.mutable9161403170102966184
org.apache.commons.lang3.exception6703537678030111
org.apache.commons.lang3.text.translate104129851313308160
org.apache.commons.lang3.event42010823205546
org.apache.commons.lang3.tuple3237226200553
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
14822341374323612720619843765

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.apache.commons.lang3.ArrayUtils15052230224
org.apache.commons.lang3.StringUtils14951661167
org.apache.commons.lang3.text.StrBuilder8821373161
org.apache.commons.lang3.builder.ToStringStyle5961125128
org.apache.commons.lang3.time.FastDateFormat4874017108
org.apache.commons.lang3.math.NumberUtils45047048
org.apache.commons.lang3.time.DateUtils43357163
org.apache.commons.lang3.ClassUtils32640041
org.apache.commons.lang3.math.Fraction32334035
org.apache.commons.lang3.reflect.TypeUtils30527028
org.apache.commons.lang3.text.StrTokenizer30264065
org.apache.commons.lang3.builder.EqualsBuilder29634035
org.apache.commons.lang3.builder.CompareToBuilder29230031
org.apache.commons.lang3.time.DurationFormatUtils28711122
org.apache.commons.lang3.BooleanUtils25240041
org.apache.commons.lang3.text.StrSubstitutor24242043
org.apache.commons.lang3.text.ExtendedMessageFormat21921022
org.apache.commons.lang3.builder.HashCodeBuilder19835036
org.apache.commons.lang3.builder.ToStringBuilder19563064
org.apache.commons.lang3.exception.ExceptionUtils16325026
org.apache.commons.lang3.Validate15539040
org.apache.commons.lang3.reflect.FieldUtils14929030
org.apache.commons.lang3.AnnotationUtils14110113
org.apache.commons.lang3.ObjectUtils13720124
org.apache.commons.lang3.text.WordUtils13513014
org.apache.commons.lang3.reflect.MethodUtils12614015
org.apache.commons.lang3.Range12424125
org.apache.commons.lang3.SystemUtils11714015
org.apache.commons.lang3.CharRange10714121
org.apache.commons.lang3.builder.ReflectionToStringBuilder10226027

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.apache.commons.lang3.ArrayUtils15052230224
org.apache.commons.lang3.StringUtils14951661167
org.apache.commons.lang3.text.StrBuilder8821373161
org.apache.commons.lang3.builder.ToStringStyle5961125128
org.apache.commons.lang3.text.StrTokenizer30264065
org.apache.commons.lang3.builder.ToStringBuilder19563064
org.apache.commons.lang3.time.DateUtils43357163
org.apache.commons.lang3.math.NumberUtils45047048
org.apache.commons.lang3.text.StrSubstitutor24242043
org.apache.commons.lang3.builder.StandardToStringStyle8441042
org.apache.commons.lang3.BooleanUtils25240041
org.apache.commons.lang3.ClassUtils32640041
org.apache.commons.lang3.time.FastDateFormat4874017108
org.apache.commons.lang3.Validate15539040
org.apache.commons.lang3.builder.HashCodeBuilder19835036
org.apache.commons.lang3.builder.EqualsBuilder29634035
org.apache.commons.lang3.math.Fraction32334035
org.apache.commons.lang3.builder.CompareToBuilder29230031
org.apache.commons.lang3.reflect.FieldUtils14929030
org.apache.commons.lang3.reflect.TypeUtils30527028
org.apache.commons.lang3.builder.ReflectionToStringBuilder10226027
org.apache.commons.lang3.exception.ExceptionUtils16325026
org.apache.commons.lang3.mutable.MutableDouble5624025
org.apache.commons.lang3.mutable.MutableFloat5524025
org.apache.commons.lang3.Range12424125
org.apache.commons.lang3.CharUtils8523024
org.apache.commons.lang3.mutable.MutableByte5523024
org.apache.commons.lang3.mutable.MutableShort5523024
org.apache.commons.lang3.mutable.MutableInt5322023
org.apache.commons.lang3.mutable.MutableLong5322023

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
94.5313,743.000.3415.0916.96

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.apache.commons.lang3.time.FastDateFormat.parsePattern()107331
org.apache.commons.lang3.math.NumberUtils.createNumber(String)84731
org.apache.commons.lang3.builder.ToStringStyle.appendInternal(StringBuffer,String,Object,boolean)77291
org.apache.commons.lang3.time.DateUtils.modify(Calendar,int,int)72361
org.apache.commons.lang3.time.DurationFormatUtils.formatPeriod(long,long,String,boolean,TimeZone)70231
org.apache.commons.lang3.text.StrSubstitutor.substitute(StrBuilder,int,int,String)67161
org.apache.commons.lang3.math.NumberUtils.isNumber(String)61641
org.apache.commons.lang3.StringUtils.splitWorker(String,String,int,boolean)61251
org.apache.commons.lang3.StringUtils.replaceEach(String,String[],String[],boolean,int)60391
org.apache.commons.lang3.time.DurationFormatUtils.lexx(String)58171
org.apache.commons.lang3.time.DateUtils.iterator(Calendar,int)55211
org.apache.commons.lang3.text.ExtendedMessageFormat.applyPattern(String)49141
org.apache.commons.lang3.BooleanUtils.toBooleanObject(String)48641
org.apache.commons.lang3.StringUtils.getLevenshteinDistance(CharSequence,CharSequence,int)47221
org.apache.commons.lang3.builder.CompareToBuilder.append(Object,Object,Comparator)45191
org.apache.commons.lang3.RandomStringUtils.random(int,int,int,boolean,boolean,boolean[],Random)44251
org.apache.commons.lang3.time.DurationFormatUtils.format(Token[],int,int,int,int,int,int,int,boolean)44191
org.apache.commons.lang3.math.Fraction.getFraction(double)42111
org.apache.commons.lang3.builder.EqualsBuilder.append(Object,Object)41181
org.apache.commons.lang3.text.StrTokenizer.readWithQuotes(int[],int,int,StrBuilder,String,int,int)40111
org.apache.commons.lang3.ClassUtils.isAssignable(Class,Class,boolean)37491
org.apache.commons.lang3.StringUtils.splitByWholeSeparatorWorker(String,String,int,boolean)37141
org.apache.commons.lang3.text.translate.NumericEntityUnescaper.translate(CharSequence,int,Writer)36281
org.apache.commons.lang3.StringUtils.getLevenshteinDistance(CharSequence,CharSequence)35131
org.apache.commons.lang3.text.WordUtils.wrap(String,int,String,boolean)35101
org.apache.commons.lang3.builder.HashCodeBuilder.append(Object)33111
org.apache.commons.lang3.time.FastDateFormat.parseToken(String,String[])33161
org.apache.commons.lang3.StringUtils.indexOfDifference(CharSequence)32191
org.apache.commons.lang3.time.DurationFormatUtils.formatDurationWords(long,boolean,boolean)32101
org.apache.commons.lang3.reflect.TypeUtils.isAssignable(Type,WildcardType,Type)31231

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
13,743.005.593.321.00

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 declarationpackage java.lang;
Import declarationimport java.awt.*;
Class declaration
  • public class Foo {
  • public class Foo extends Bla {
Interface declarationpublic interface Able ; {
Field declaration
  • int a;
  • int a, b, c = 5, d = 6;
Method declaration
  • public void cry();
  • public void gib() throws DeadException {
Constructor declarationpublic Foo() {
Constructor invocation
  • this();
  • super();
Statement declaration
  • i = 0;
  • if (ok)
  • if (exit) {
  • if (3 == 4);
  • if (4 == 4) { ;
  • } else {
Label declarationfine :

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