Apache Commons logo Commons Lang

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
org.apache.commons.lang3 38 869 6427 881 14105 634 2241
org.apache.commons.lang3.builder 37 428 2190 409 4697 206 405
org.apache.commons.lang3.text 19 362 2102 381 3504 206 256
org.apache.commons.lang3.time 39 305 1913 313 2813 231 470
org.apache.commons.lang3.reflect 13 148 1087 155 1609 204 200
org.apache.commons.lang3.math 3 94 867 97 981 227 195
org.apache.commons.lang3.concurrent 18 103 473 118 1504 28 682
org.apache.commons.lang3.mutable 9 163 407 172 1040 66 208
org.apache.commons.lang3.exception 6 70 354 76 786 30 137
org.apache.commons.lang3.text.translate 12 51 328 63 412 309 216
org.apache.commons.lang3.tuple 6 46 145 52 391 11 129
org.apache.commons.lang3.event 4 20 108 23 209 8 67
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
204 2659 16401 2740 32051 2160 5206

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.commons.lang3.StringUtils 1667 196 0 197
org.apache.commons.lang3.ArrayUtils 1558 233 0 234
org.apache.commons.lang3.text.StrBuilder 914 145 3 169
org.apache.commons.lang3.Conversion 698 42 0 43
org.apache.commons.lang3.reflect.TypeUtils 598 53 5 80
org.apache.commons.lang3.builder.ToStringStyle 596 112 5 128
org.apache.commons.lang3.time.FastDatePrinter 456 24 16 83
org.apache.commons.lang3.math.NumberUtils 454 48 0 49
org.apache.commons.lang3.time.DateUtils 425 58 1 64
org.apache.commons.lang3.ClassUtils 371 41 3 42
org.apache.commons.lang3.math.Fraction 323 34 0 35
org.apache.commons.lang3.time.FastDateParser 321 23 9 40
org.apache.commons.lang3.text.StrSubstitutor 306 53 0 54
org.apache.commons.lang3.text.StrTokenizer 302 64 0 65
org.apache.commons.lang3.builder.EqualsBuilder 299 34 0 35
org.apache.commons.lang3.builder.CompareToBuilder 292 30 0 31
org.apache.commons.lang3.time.DurationFormatUtils 287 12 1 22
org.apache.commons.lang3.builder.DiffBuilder 272 20 18 21
org.apache.commons.lang3.BooleanUtils 250 40 0 41
org.apache.commons.lang3.text.ExtendedMessageFormat 221 21 0 22
org.apache.commons.lang3.builder.ToStringBuilder 195 63 0 64
org.apache.commons.lang3.builder.HashCodeBuilder 194 35 0 36
org.apache.commons.lang3.Validate 179 47 0 48
org.apache.commons.lang3.ObjectUtils 178 35 1 38
org.apache.commons.lang3.exception.ExceptionUtils 163 25 0 26
org.apache.commons.lang3.reflect.FieldUtils 154 33 0 34
org.apache.commons.lang3.AnnotationUtils 141 10 1 13
org.apache.commons.lang3.text.WordUtils 135 13 0 14
org.apache.commons.lang3.Range 125 24 1 25
org.apache.commons.lang3.reflect.MethodUtils 124 15 0 16

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.commons.lang3.ArrayUtils 1558 233 0 234
org.apache.commons.lang3.StringUtils 1667 196 0 197
org.apache.commons.lang3.text.StrBuilder 914 145 3 169
org.apache.commons.lang3.builder.ToStringStyle 596 112 5 128
org.apache.commons.lang3.text.StrTokenizer 302 64 0 65
org.apache.commons.lang3.builder.ToStringBuilder 195 63 0 64
org.apache.commons.lang3.time.DateUtils 425 58 1 64
org.apache.commons.lang3.reflect.TypeUtils 598 53 5 80
org.apache.commons.lang3.text.StrSubstitutor 306 53 0 54
org.apache.commons.lang3.math.NumberUtils 454 48 0 49
org.apache.commons.lang3.Validate 179 47 0 48
org.apache.commons.lang3.Conversion 698 42 0 43
org.apache.commons.lang3.builder.StandardToStringStyle 84 41 0 42
org.apache.commons.lang3.ClassUtils 371 41 3 42
org.apache.commons.lang3.BooleanUtils 250 40 0 41
org.apache.commons.lang3.time.FastDateFormat 89 37 1 35
org.apache.commons.lang3.builder.HashCodeBuilder 194 35 0 36
org.apache.commons.lang3.ObjectUtils 178 35 1 38
org.apache.commons.lang3.builder.EqualsBuilder 299 34 0 35
org.apache.commons.lang3.math.Fraction 323 34 0 35
org.apache.commons.lang3.reflect.FieldUtils 154 33 0 34
org.apache.commons.lang3.builder.CompareToBuilder 292 30 0 31
org.apache.commons.lang3.builder.ReflectionToStringBuilder 102 26 0 27
org.apache.commons.lang3.exception.ExceptionUtils 163 25 0 26
org.apache.commons.lang3.mutable.MutableDouble 56 24 0 25
org.apache.commons.lang3.mutable.MutableFloat 55 24 0 25
org.apache.commons.lang3.Range 125 24 1 25
org.apache.commons.lang3.time.FastDatePrinter 456 24 16 83
org.apache.commons.lang3.CharUtils 85 23 0 24
org.apache.commons.lang3.mutable.MutableByte 55 23 0 24

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
82.54 16,401.00 0.44 13.03 14.36

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.commons.lang3.time.FastDatePrinter.parsePattern() 107 33 1
org.apache.commons.lang3.math.NumberUtils.createNumber(String) 102 82 1
org.apache.commons.lang3.text.StrSubstitutor.substitute(StrBuilder,int,int,String) 83 22 1
org.apache.commons.lang3.builder.ToStringStyle.appendInternal(StringBuffer,String,Object,boolean) 77 29 1
org.apache.commons.lang3.time.DateUtils.modify(Calendar,int,int) 74 36 1
org.apache.commons.lang3.time.DurationFormatUtils.formatPeriod(long,long,String,boolean,TimeZone) 70 23 1
org.apache.commons.lang3.math.NumberUtils.isNumber(String) 69 71 1
org.apache.commons.lang3.StringUtils.splitWorker(String,String,int,boolean) 61 25 1
org.apache.commons.lang3.StringUtils.replaceEach(String,String[],String[],boolean,int) 60 39 1
org.apache.commons.lang3.time.DurationFormatUtils.lexx(String) 58 19 1
org.apache.commons.lang3.time.DateUtils.iterator(Calendar,int) 57 21 1
org.apache.commons.lang3.Conversion.binaryBeMsb0ToHexDigit(char[],int) 55 47 1
org.apache.commons.lang3.RandomStringUtils.random(int,int,int,boolean,boolean,boolean[],Random) 52 31 1
org.apache.commons.lang3.Conversion.binaryToHexDigitMsb0_4bits(char[],int) 51 35 1
org.apache.commons.lang3.BooleanUtils.toBooleanObject(String) 50 64 1
org.apache.commons.lang3.Conversion.binaryToHexDigit(char[],int) 49 40 1
org.apache.commons.lang3.text.ExtendedMessageFormat.applyPattern(String) 49 14 1
org.apache.commons.lang3.StringUtils.getLevenshteinDistance(CharSequence,CharSequence,int) 46 23 1
org.apache.commons.lang3.builder.CompareToBuilder.append(Object,Object,Comparator) 45 19 1
org.apache.commons.lang3.time.FastDateParser.getStrategy(String,Calendar) 44 43 1
org.apache.commons.lang3.LocaleUtils.toLocale(String) 43 46 1
org.apache.commons.lang3.time.DurationFormatUtils.format(Token[],long,long,long,long,long,long,long,boolean) 43 12 1
org.apache.commons.lang3.Conversion.hexDigitMsb0ToInt(char) 42 40 1
org.apache.commons.lang3.Conversion.hexDigitToBinary(char) 42 40 1
org.apache.commons.lang3.Conversion.hexDigitMsb0ToBinary(char) 42 40 1
org.apache.commons.lang3.math.Fraction.getFraction(double) 42 11 1
org.apache.commons.lang3.builder.EqualsBuilder.append(Object,Object) 41 18 1
org.apache.commons.lang3.ClassUtils.hierarchy(Class,Interfaces) 40 3 1
org.apache.commons.lang3.text.StrTokenizer.readWithQuotes(int[],int,int,StrBuilder,String,int,int) 40 11 1
org.apache.commons.lang3.ClassUtils.isAssignable(Class,Class,boolean) 37 49 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
16,401.00 5.63 3.29 0.96

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