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 33.54.
JavaNCSS web site.

Packages

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 29 1022 7720 1055 17231 681 2468
org.apache.commons.lang3.builder 16 417 2496 436 5178 213 541
org.apache.commons.lang3.text 10 338 2208 391 3697 177 265
org.apache.commons.lang3.time 10 232 2151 330 3022 257 555
org.apache.commons.lang3.reflect 8 147 1311 174 1863 219 199
org.apache.commons.lang3.math 3 103 887 105 1101 216 194
org.apache.commons.lang3.concurrent 20 132 710 193 2152 29 836
org.apache.commons.lang3.mutable 9 211 573 220 1403 66 207
org.apache.commons.lang3.exception 6 74 367 80 880 25 136
org.apache.commons.lang3.text.translate 12 51 332 63 435 312 218
org.apache.commons.lang3.tuple 6 48 151 54 402 11 134
org.apache.commons.lang3.event 2 17 113 24 218 8 66
org.apache.commons.lang3.arch 1 8 24 9 51 0 78
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
132 2800 19043 3134 37633 2214 5897

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.commons.lang3.ArrayUtils 2384 319 1 320
org.apache.commons.lang3.StringUtils 1970 229 0 228
org.apache.commons.lang3.text.StrBuilder 991 149 3 173
org.apache.commons.lang3.builder.ToStringStyle 713 112 7 135
org.apache.commons.lang3.reflect.TypeUtils 602 53 5 80
org.apache.commons.lang3.Conversion 593 42 0 43
org.apache.commons.lang3.time.FastDatePrinter 579 31 19 94
org.apache.commons.lang3.math.NumberUtils 490 57 0 57
org.apache.commons.lang3.time.FastDateParser 418 22 15 38
org.apache.commons.lang3.time.DateUtils 415 60 2 65
org.apache.commons.lang3.ClassUtils 405 43 3 44
org.apache.commons.lang3.builder.EqualsBuilder 330 41 0 42
org.apache.commons.lang3.math.Fraction 315 34 0 35
org.apache.commons.lang3.text.StrSubstitutor 313 55 0 56
org.apache.commons.lang3.text.StrTokenizer 302 64 0 65
org.apache.commons.lang3.builder.CompareToBuilder 294 31 0 31
org.apache.commons.lang3.time.DurationFormatUtils 286 12 1 23
org.apache.commons.lang3.builder.DiffBuilder 270 23 18 23
org.apache.commons.lang3.reflect.MethodUtils 267 30 0 30
org.apache.commons.lang3.BooleanUtils 254 41 0 42
org.apache.commons.lang3.text.ExtendedMessageFormat 214 21 0 22
org.apache.commons.lang3.builder.HashCodeBuilder 194 36 0 37
org.apache.commons.lang3.builder.ToStringBuilder 194 63 0 64
org.apache.commons.lang3.Validate 191 51 0 52
org.apache.commons.lang3.ObjectUtils 181 36 1 40
org.apache.commons.lang3.exception.ExceptionUtils 175 29 0 30
org.apache.commons.lang3.reflect.FieldUtils 165 35 0 36
org.apache.commons.lang3.text.WordUtils 159 15 0 16
org.apache.commons.lang3.SystemUtils 148 16 0 17
org.apache.commons.lang3.AnnotationUtils 139 10 1 13

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.commons.lang3.ArrayUtils 2384 319 1 320
org.apache.commons.lang3.StringUtils 1970 229 0 228
org.apache.commons.lang3.text.StrBuilder 991 149 3 173
org.apache.commons.lang3.builder.ToStringStyle 713 112 7 135
org.apache.commons.lang3.text.StrTokenizer 302 64 0 65
org.apache.commons.lang3.builder.ToStringBuilder 194 63 0 64
org.apache.commons.lang3.time.DateUtils 415 60 2 65
org.apache.commons.lang3.math.NumberUtils 490 57 0 57
org.apache.commons.lang3.text.StrSubstitutor 313 55 0 56
org.apache.commons.lang3.reflect.TypeUtils 602 53 5 80
org.apache.commons.lang3.Validate 191 51 0 52
org.apache.commons.lang3.ClassUtils 405 43 3 44
org.apache.commons.lang3.Conversion 593 42 0 43
org.apache.commons.lang3.BooleanUtils 254 41 0 42
org.apache.commons.lang3.builder.EqualsBuilder 330 41 0 42
org.apache.commons.lang3.builder.StandardToStringStyle 84 41 0 42
org.apache.commons.lang3.time.FastDateFormat 97 41 1 38
org.apache.commons.lang3.builder.HashCodeBuilder 194 36 0 37
org.apache.commons.lang3.ObjectUtils 181 36 1 40
org.apache.commons.lang3.reflect.FieldUtils 165 35 0 36
org.apache.commons.lang3.math.Fraction 315 34 0 35
org.apache.commons.lang3.mutable.MutableDouble 83 32 0 33
org.apache.commons.lang3.mutable.MutableFloat 82 32 0 33
org.apache.commons.lang3.builder.CompareToBuilder 294 31 0 31
org.apache.commons.lang3.builder.ReflectionToStringBuilder 119 31 0 31
org.apache.commons.lang3.mutable.MutableByte 82 31 0 32
org.apache.commons.lang3.mutable.MutableShort 82 31 0 32
org.apache.commons.lang3.time.FastDatePrinter 579 31 19 94
org.apache.commons.lang3.mutable.MutableInt 80 30 0 31
org.apache.commons.lang3.mutable.MutableLong 80 30 0 31

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
138.91 19,043.00 0.87 21.21 23.74

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.commons.lang3.time.FastDatePrinter.parsePattern() 119 38 1
org.apache.commons.lang3.math.NumberUtils.createNumber(String) 100 82 1
org.apache.commons.lang3.text.StrSubstitutor.substitute(StrBuilder,int,int,String) 85 23 1
org.apache.commons.lang3.builder.ToStringStyle.appendInternal(StringBuffer,String,Object,boolean) 77 29 1
org.apache.commons.lang3.time.DateUtils.modify(Calendar,int,ModifyType) 74 36 1
org.apache.commons.lang3.math.NumberUtils.isCreatable(String) 72 77 1
org.apache.commons.lang3.time.DurationFormatUtils.formatPeriod(long,long,String,boolean,TimeZone) 71 23 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.BooleanUtils.toBooleanObject(String) 50 64 1
org.apache.commons.lang3.RandomStringUtils.random(int,int,int,boolean,boolean,boolean[],Random) 49 35 1
org.apache.commons.lang3.StringUtils.getLevenshteinDistance(CharSequence,CharSequence,int) 49 25 1
org.apache.commons.lang3.text.ExtendedMessageFormat.applyPattern(String) 49 14 1
org.apache.commons.lang3.time.FastDateParser.getStrategy(char,int,Calendar) 48 47 1
org.apache.commons.lang3.text.WordUtils.wrap(String,int,String,boolean,String) 47 15 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.StringUtils.matches(CharSequence,CharSequence) 42 14 0
org.apache.commons.lang3.time.DurationFormatUtils.format(Token[],long,long,long,long,long,long,long,boolean) 41 12 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.time.FastDatePrinter.appendFullDigits(Appendable,int,int) 40 15 1
org.apache.commons.lang3.JavaVersion.get(String) 39 26 0
org.apache.commons.lang3.builder.DiffBuilder.append(String,Object,Object) 38 27 1
org.apache.commons.lang3.ClassUtils.isAssignable(Class,Class,boolean) 37 49 1
org.apache.commons.lang3.StringUtils.splitByWholeSeparatorWorker(String,String,int,boolean) 37 14 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
19,043.00 5.56 3.19 0.94

Explanations

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