Apache Commons logo Commons Crypto? logo

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.crypto.stream 5 112 812 121 953 52 242
org.apache.commons.crypto.jna 4 53 280 55 320 21 135
org.apache.commons.crypto.cipher 6 50 268 57 570 13 205
org.apache.commons.crypto 4 26 248 31 159 38 125
org.apache.commons.crypto.random 6 22 169 28 178 19 195
org.apache.commons.crypto.utils 3 18 148 22 146 9 78
org.apache.commons.crypto.stream.input 3 21 87 24 262 0 71
org.apache.commons.crypto.stream.output 3 12 48 15 121 0 71
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
34 314 2060 353 2709 152 1122

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.apache.commons.crypto.stream.CryptoInputStream 195 30 0 31
org.apache.commons.crypto.stream.CtrCryptoInputStream 189 29 0 30
org.apache.commons.crypto.stream.CryptoOutputStream 126 20 0 21
org.apache.commons.crypto.jna.OpenSslJnaCipher 126 12 3 12
org.apache.commons.crypto.stream.PositionedCryptoInputStream 124 16 1 21
org.apache.commons.crypto.NativeCodeLoader 94 8 0 9
org.apache.commons.crypto.cipher.OpenSsl 91 12 3 14
org.apache.commons.crypto.OsInfo 79 7 0 8
org.apache.commons.crypto.stream.CtrCryptoOutputStream 77 17 0 18
org.apache.commons.crypto.jna.OpenSslJnaCryptoRandom 57 8 0 9
org.apache.commons.crypto.utils.Utils 53 10 1 11
org.apache.commons.crypto.utils.ReflectionUtils 50 4 1 6
org.apache.commons.crypto.jna.OpenSslNativeJna 48 29 0 29
org.apache.commons.crypto.random.CryptoRandomFactory 48 4 1 5
org.apache.commons.crypto.Crypto 44 5 1 7
org.apache.commons.crypto.random.OsCryptoRandom 41 5 0 6
org.apache.commons.crypto.cipher.CryptoCipherFactory 40 4 1 5
org.apache.commons.crypto.random.OpenSslCryptoRandom 39 6 0 7
org.apache.commons.crypto.cipher.OpenSslCipher 37 9 0 10
org.apache.commons.crypto.stream.input.ChannelInput 35 8 0 9
org.apache.commons.crypto.stream.input.StreamInput 33 7 0 8
org.apache.commons.crypto.cipher.JceCipher 25 9 0 10
org.apache.commons.crypto.stream.output.StreamOutput 23 5 0 6
org.apache.commons.crypto.utils.IoUtils 22 4 0 5
org.apache.commons.crypto.cipher.OpenSslNative 10 9 0 10
org.apache.commons.crypto.stream.output.ChannelOutput 9 4 0 5
org.apache.commons.crypto.jna.OpenSslJna 9 4 0 5
org.apache.commons.crypto.cipher.CryptoCipher 8 7 0 8
org.apache.commons.crypto.OpenSslInfoNative 7 6 0 7
org.apache.commons.crypto.stream.input.Input 7 6 0 7

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.apache.commons.crypto.stream.CryptoInputStream 195 30 0 31
org.apache.commons.crypto.stream.CtrCryptoInputStream 189 29 0 30
org.apache.commons.crypto.jna.OpenSslNativeJna 48 29 0 29
org.apache.commons.crypto.stream.CryptoOutputStream 126 20 0 21
org.apache.commons.crypto.stream.CtrCryptoOutputStream 77 17 0 18
org.apache.commons.crypto.stream.PositionedCryptoInputStream 124 16 1 21
org.apache.commons.crypto.jna.OpenSslJnaCipher 126 12 3 12
org.apache.commons.crypto.cipher.OpenSsl 91 12 3 14
org.apache.commons.crypto.utils.Utils 53 10 1 11
org.apache.commons.crypto.cipher.OpenSslCipher 37 9 0 10
org.apache.commons.crypto.cipher.JceCipher 25 9 0 10
org.apache.commons.crypto.cipher.OpenSslNative 10 9 0 10
org.apache.commons.crypto.stream.input.ChannelInput 35 8 0 9
org.apache.commons.crypto.jna.OpenSslJnaCryptoRandom 57 8 0 9
org.apache.commons.crypto.NativeCodeLoader 94 8 0 9
org.apache.commons.crypto.stream.input.StreamInput 33 7 0 8
org.apache.commons.crypto.OsInfo 79 7 0 8
org.apache.commons.crypto.cipher.CryptoCipher 8 7 0 8
org.apache.commons.crypto.OpenSslInfoNative 7 6 0 7
org.apache.commons.crypto.stream.input.Input 7 6 0 7
org.apache.commons.crypto.random.OpenSslCryptoRandom 39 6 0 7
org.apache.commons.crypto.stream.output.StreamOutput 23 5 0 6
org.apache.commons.crypto.Crypto 44 5 1 7
org.apache.commons.crypto.random.OsCryptoRandom 41 5 0 6
org.apache.commons.crypto.stream.output.ChannelOutput 9 4 0 5
org.apache.commons.crypto.utils.IoUtils 22 4 0 5
org.apache.commons.crypto.utils.ReflectionUtils 50 4 1 6
org.apache.commons.crypto.jna.OpenSslJna 9 4 0 5
org.apache.commons.crypto.cipher.CryptoCipherFactory 40 4 1 5
org.apache.commons.crypto.random.CryptoRandomFactory 48 4 1 5

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
51.85 2,060.00 0.35 9.24 10.38

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.apache.commons.crypto.jna.OpenSslJnaCipher.init(int,Key,AlgorithmParameterSpec) 40 13 1
org.apache.commons.crypto.NativeCodeLoader.extractLibraryFile(String,String,String) 35 13 1
org.apache.commons.crypto.stream.CtrCryptoInputStream.read(ByteBuffer) 24 10 1
org.apache.commons.crypto.random.CryptoRandomFactory.getCryptoRandom(Properties) 24 11 1
org.apache.commons.crypto.utils.ReflectionUtils.getClassByNameOrNull(String) 23 9 1
org.apache.commons.crypto.NativeCodeLoader.findNativeLibrary() 22 10 1
org.apache.commons.crypto.stream.PositionedCryptoInputStream.decrypt(long,long[],int,int) 21 2 1
org.apache.commons.crypto.stream.CryptoInputStream.read(int[],int,int) 21 13 1
org.apache.commons.crypto.Crypto.main(String[]) 21 3 1
org.apache.commons.crypto.stream.CtrCryptoInputStream.skip(long) 19 6 1
org.apache.commons.crypto.stream.CryptoInputStream.skip(long) 19 6 1
org.apache.commons.crypto.cipher.CryptoCipherFactory.getCryptoCipher(String,Properties) 19 9 1
org.apache.commons.crypto.stream.CryptoOutputStream.write(ByteBuffer) 18 3 1
org.apache.commons.crypto.jna.OpenSslJnaCryptoRandom.OpenSslJnaCryptoRandom(Properties) 18 9 1
org.apache.commons.crypto.stream.CryptoOutputStream.write(Override[],int,int) 17 10 1
org.apache.commons.crypto.stream.CryptoInputStream.read(ByteBuffer) 17 6 1
org.apache.commons.crypto.stream.CtrCryptoInputStream.decrypt(ByteBuffer,int,int) 16 2 1
org.apache.commons.crypto.stream.CtrCryptoOutputStream.encrypt() 16 5 1
org.apache.commons.crypto.stream.CryptoInputStream.decryptMore() 16 9 1
org.apache.commons.crypto.utils.Utils.createDefaultProperties() 16 6 1
org.apache.commons.crypto.stream.input.ChannelInput.skip(long) 15 5 1
org.apache.commons.crypto.stream.input.StreamInput.read(ByteBuffer) 15 5 1
org.apache.commons.crypto.OsInfo.getArchName() 15 9 1
org.apache.commons.crypto.OsInfo.translateOSNameToFolderName(String) 14 9 1
org.apache.commons.crypto.stream.CryptoOutputStream.encryptFinal() 13 7 1
org.apache.commons.crypto.stream.CryptoInputStream.decryptFinal() 13 7 1
org.apache.commons.crypto.utils.ReflectionUtils.newInstance(T,Object) 13 6 1
org.apache.commons.crypto.NativeCodeLoader.contentsEquals(InputStream,InputStream) 13 6 1
org.apache.commons.crypto.stream.CtrCryptoInputStream.decryptBuffer(ByteBuffer) 12 8 1
org.apache.commons.crypto.stream.CtrCryptoInputStream.calculateIV(e[],long,long[]) 12 3 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,060.00 4.64 2.21 0.96

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