Modified: websites/production/commons/content/proper/commons-lang/javancss.html ============================================================================== --- websites/production/commons/content/proper/commons-lang/javancss.html (original) +++ websites/production/commons/content/proper/commons-lang/javancss.html Fri Mar 1 10:30:33 2013 @@ -1,5 +1,5 @@ - + @@ -11,7 +11,7 @@ @import url("./css/site.css"); - + @@ -40,7 +40,7 @@
- Last Published: 28 February 2013 + Last Published: 01 March 2013  | Version: 3.2-SNAPSHOT
ApacheCon @@ -232,7 +232,7 @@
-

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.lang3 317976070816130206071989
org.apache.commons.lang3.text1935120363703267199225
org.apache.commons.lang3.time3929718593032734222394
org.apache.commons.lang3.builder1435518283694113202281
org.apache.commons.lang3.math39484997974209162
org.apache.commons.lang3.reflect586716901016199121
org.apache.commons.lang3.concurrent18103472118149827243
org.apache.commons.la ng3.mutable9161403170102966184
org.apache.commons.lang3.exception6703537678030111
org.apache.commons.lang3.text.translate114831559387306160
org.apache.commons.lang3.tuple646144523889107
org.apache.commons.lang3.event42010723205845
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
16524281515225432941120844022

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.apache.commons.lang3.StringUtils15671800181
org.apache.commons.lang3.ArrayUtils15182230224
org.apache.commons.lang3.text.StrBuilder9161453169
org.apache.commons.lang3.Conversion69842043
org.apache.commons.lang3.builder.ToStringStyle5961125128
org.apache.commons.lang3.time.FastDatePrinter455241681
org.apache.commons.lang3.time.DateUtils44159165
org.apache.commons.lang3.math.NumberUtils43748049
org.apache.commons.lang3.Cla ssUtils32440041
org.apache.commons.lang3.math.Fraction32334035
org.apache.commons.lang3.reflect.TypeUtils31428028
org.apache.commons.lang3.text.StrTokenizer30264065
org.apache.commons.lang3.time.FastDateParser29622938
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.ObjectUtils16331135
org.apache.commons.lang3.Validate15539040
org.apache.commons.la ng3.reflect.FieldUtils14929030
org.apache.commons.lang3.AnnotationUtils14110113
org.apache.commons.lang3.text.WordUtils13513014
org.apache.commons.lang3.Range12424125
org.apache.commons.lang3.SystemUtils11814015
org.apache.commons.lang3.reflect.MethodUtils11414015

TOP 30 classes contain ing the most methods.

< td>org.apache.commons.lang3.mutable.MutableFloat
ObjectNCSSMethodsClassesJavadocs
org.apache.commons.lang3.ArrayUtils15182230224
org.apache.commons.lang3.StringUtils15671800181
org.apache.commons.lang3.text.StrBuilder9161453169
org.apache.commons.lang3.builder.ToStringStyle5961125128
org.apache.commons.lang3. text.StrTokenizer30264065
org.apache.commons.lang3.builder.ToStringBuilder19563064
org.apache.commons.lang3.time.DateUtils44159165
org.apache.commons.lang3.math.NumberUtils43748049
org.apache.commons.lang3.Conversion69842043
org.apache.commons.lang3.text.StrSubstitutor24242043
org.apache.commons.lang3.builder.StandardToStringStyle8441042
org.apache.commons.lang3.BooleanUtils25240041
org.apache.commons.lang3.ClassUtils32440041
org.apache.commons.lang3.Validate15539040
org.apache.commons.lang3.time.FastDateFormat8736134
org.ap ache.commons.lang3.builder.HashCodeBuilder19835036
org.apache.commons.lang3.builder.EqualsBuilder29634035
org.apache.commons.lang3.math.Fraction32334035
org.apache.commons.lang3.ObjectUtils16331135
org.apache.commons.lang3.builder.CompareToBuilder29230031
org.apache.commons.lang3.reflect.FieldUtils14929< /td>030
org.apache.commons.lang3.reflect.TypeUtils31428028
org.apache.commons.lang3.builder.ReflectionToStringBuilder10226027
org.apache.commons.lang3.exception.ExceptionUtils16325026
org.apache.commons.lang3.time.FastDatePrinter455241681
org.apache.commons.lang3.Range12424125
5524025
org.apache.commons.lang3.mutable.MutableDouble5624025
org.apache.commons.lang3.CharUtils8523024
org.apache.commons.lang3.mutable.MutableByte5523024

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
93.5115,152.000.3614.72 16.42

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.apache.commons.lang3.time.FastDatePrinter.parsePattern()107331
org.apache.commons.lang3.math.NumberUtils.createNumber(String)93741
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.StringUtils.splitWorker(String,String,int,boolean)61251
org.apache.c ommons.lang3.math.NumberUtils.isNumber(String)61641
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.Conversion.binaryBeMsb0ToHexDigit(char[],int)55471
org.apache.commons.lang3.Ra ndomStringUtils.random(int,int,int,boolean,boolean,boolean[],Random)52311
org.apache.commons.lang3.Conversion.binaryToHexDigitMsb0_4bits(char[],int)51351
org.apache.commons.lang3.Conversion.binaryToHexDigit(char[],int)49401
org.apache.commons.lang3.text.ExtendedMessageFormat.applyPattern(String)49141
org.apache.commons.lang3.BooleanUtils.toBooleanObject(String)48641
org.apache.commons.la ng3.StringUtils.getLevenshteinDistance(CharSequence,CharSequence,int)47221
org.apache.commons.lang3.builder.CompareToBuilder.append(Object,Object,Comparator)45191
org.apache.commons.lang3.time.DurationFormatUtils.format(Token[],int,int,int,int,int,int,int,boolean)44191
org.apache.commons.lang3.time.FastDateParser.getStrategy(String,Calendar)44421
org.apache.commons.lang3.LocaleUtils.toLocale(String)44381
org.apache.commons.lang3.Conversion.hexDigitMsb0ToInt(char)42401
org.apache.commons.lang3.Conversion.hexDigitToBinary(char)42401
org.apache.commons.lang3.Conversion.hexDigitMsb0ToBinary(char)42401
org.apache.commons.lang3.math.Fraction.getFraction(double)42111
org.apache.commons.lang3.builder.EqualsBuilder.append(Object,Object)41181
org.apache.commo ns.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

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
15,152.005.693.380.99

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 {
Interf ace 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 JavaN CSS 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 C CN 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).

+

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.lang3 317976070816130206071989
org.apache.commons.lang3.text1935120363703267199225
org.apache.commons.lang3.time3929718593032734222394
org.apache.commons.lang3.builder1435518283694113202281
org.apache.commons.lang3.math39484997974209162
org.apache.commons.lang3.reflect586716901016199121
org.apache.commons.lang3.concurrent18103472118149827243
org.apache.commons.la ng3.mutable9161403170102966184
org.apache.commons.lang3.exception6703537678030111
org.apache.commons.lang3.text.translate114831559387306176
org.apache.commons.lang3.tuple646144523889107
org.apache.commons.lang3.event42010723205845
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
16524281515225432941120844038

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.apache.commons.lang3.StringUtils15671800181
org.apache.commons.lang3.ArrayUtils15182230224
org.apache.commons.lang3.text.StrBuilder9161453169
org.apache.commons.lang3.Conversion69842043
org.apache.commons.lang3.builder.ToStringStyle5961125128
org.apache.commons.lang3.time.FastDatePrinter455241681
org.apache.commons.lang3.time.DateUtils44159165
org.apache.commons.lang3.math.NumberUtils43748049
org.apache.commons.lang3.Cla ssUtils32440041
org.apache.commons.lang3.math.Fraction32334035
org.apache.commons.lang3.reflect.TypeUtils31428028
org.apache.commons.lang3.text.StrTokenizer30264065
org.apache.commons.lang3.time.FastDateParser29622938
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.ObjectUtils16331135
org.apache.commons.lang3.exception.ExceptionUtils16325026
org.apache.commons.lang3.Validate15539040
org.apache.commons.la ng3.reflect.FieldUtils14929030
org.apache.commons.lang3.AnnotationUtils14110113
org.apache.commons.lang3.text.WordUtils13513014
org.apache.commons.lang3.Range12424125
org.apache.commons.lang3.SystemUtils11814015
org.apache.commons.lang3.reflect.MethodUtils11414015

TOP 30 classes contain ing the most methods.

< td>org.apache.commons.lang3.mutable.MutableDouble
ObjectNCSSMethodsClassesJavadocs
org.apache.commons.lang3.ArrayUtils15182230224
org.apache.commons.lang3.StringUtils15671800181
org.apache.commons.lang3.text.StrBuilder9161453169
org.apache.commons.lang3.builder.ToStringStyle5961125128
org.apache.commons.lang3. text.StrTokenizer30264065
org.apache.commons.lang3.builder.ToStringBuilder19563064
org.apache.commons.lang3.time.DateUtils44159165
org.apache.commons.lang3.math.NumberUtils43748049
org.apache.commons.lang3.Conversion69842043
org.apache.commons.lang3.text.StrSubstitutor24242043
org.apache.commons.lang3.builder.StandardToStringStyle8441042
org.apache.commons.lang3.ClassUtils32440041
org.apache.commons.lang3.BooleanUtils25240041
org.apache.commons.lang3.Validate15539040
org.apache.commons.lang3.time.FastDateFormat8736134
org.ap ache.commons.lang3.builder.HashCodeBuilder19835036
org.apache.commons.lang3.builder.EqualsBuilder29634035
org.apache.commons.lang3.math.Fraction32334035
org.apache.commons.lang3.ObjectUtils16331135
org.apache.commons.lang3.builder.CompareToBuilder29230031
org.apache.commons.lang3.reflect.FieldUtils14929< /td>030
org.apache.commons.lang3.reflect.TypeUtils31428028
org.apache.commons.lang3.builder.ReflectionToStringBuilder10226027
org.apache.commons.lang3.exception.ExceptionUtils16325026
org.apache.commons.lang3.Range12424125
org.apache.commons.lang3.time.FastDatePrinter455241681
5624025
org.apache.commons.lang3.mutable.MutableFloat5524025
org.apache.commons.lang3.CharUtils8523024
org.apache.commons.lang3.mutable.MutableShort5523024

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
93.5115,152.000.3614.7216.42

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.apache.commons.lang3.time.FastDatePrinter.parsePattern()107331
org.apache.commons.lang3.math.NumberUtils.createNumber(String)93741
org.apache.commons.lang3.builder.ToStringStyle.appendInternal(StringBuffer,Strin g,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.StringUtils.splitWorker(String,String,int,boolean)61251
org.apache .commons.lang3.math.NumberUtils.isNumber(String)61641
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.Conversion.binaryBeMsb0ToHexDigit(char[],int)55471
org.apache.commons.lang3. RandomStringUtils.random(int,int,int,boolean,boolean,boolean[],Random)52311
org.apache.commons.lang3.Conversion.binaryToHexDigitMsb0_4bits(char[],int)51351
org.apache.commons.lang3.Conversion.binaryToHexDigit(char[],int)49401
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.time.DurationFormatUtils.format(Token[],int,int,int,int,int,int,int,boolean)44191
org.apache.commons.lang3.time.FastDateParser.getStrategy(String,Calendar)44421
org.apache.commons.lang3.LocaleUtils.toLocale(String)44381
org.apache.commons.lang3.Conversion.hexDigitMsb0ToInt(char)42401
org.apache.commons.lang3.Conversion.hexDigitToBinary(char)42401
org.apache.commons.lang3.Conversion.hexDigitMsb0ToBinary(char)42401
org.apache.commons.lang3.math.Fraction.getFraction(double)42111
org.apache.commons.lang3.builder.EqualsBuilder.append(Object,Object)41181
org.apache.com mons.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

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
15,152.005.693.380.99

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 {
Inte rface 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 Jav aNCSS 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).