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
ejava.examples.orm.rel.annotated 12 96 346 12 113 31 0
ejava.examples.orm.rel.composite 9 47 182 4 16 8 0
ejava.examples.orm.map.annotated 7 43 160 7 39 0 0
ejava.examples.orm.rel 2 16 53 0 0 0 0
ejava.examples.orm.onetomany.annotated 2 16 50 2 116 2 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
32 218 791 25 284 41 0

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
ejava.examples.orm.rel.annotated.Borrower 44 14 0 2
ejava.examples.orm.rel.annotated.Person 29 11 0 1
ejava.examples.orm.map.annotated.ManyManyOwningEntity 26 8 0 1
ejava.examples.orm.rel.annotated.Checkout 26 9 0 0
ejava.examples.orm.rel.annotated.Author 26 8 0 1
ejava.examples.orm.rel.annotated.Inventory 26 8 0 1
ejava.examples.orm.rel.annotated.MediaCopy 26 9 0 1
ejava.examples.orm.onetomany.annotated.OneManyOwningParent 25 9 0 1
ejava.examples.orm.rel.MediaCopyPK2 24 8 0 0
ejava.examples.orm.rel.MediaCopyPK 24 8 0 0
ejava.examples.orm.rel.annotated.Media 24 7 0 1
ejava.examples.orm.rel.composite.ResidentPK 23 6 0 0
ejava.examples.orm.rel.composite.DoorPK 23 6 0 0
ejava.examples.orm.rel.composite.RoomPK 23 6 0 0
ejava.examples.orm.rel.composite.MortgagePK 23 6 0 0
ejava.examples.orm.map.annotated.OneManyInverseParent 22 6 0 1
ejava.examples.orm.map.annotated.ManyManyInverseEntity 22 6 0 1
ejava.examples.orm.rel.annotated.MediaCopy2 22 8 0 1
ejava.examples.orm.map.annotated.OneManyOwningParent 21 7 0 1
ejava.examples.orm.rel.annotated.Library 20 6 0 1
ejava.examples.orm.rel.annotated.Photo 20 6 0 1
ejava.examples.orm.onetomany.annotated.OneManyChild 19 7 0 1
ejava.examples.orm.map.annotated.OneManyOwningChild 19 6 0 1
ejava.examples.orm.rel.composite.House 19 7 0 0
ejava.examples.orm.rel.annotated.Applicant 19 7 0 1
ejava.examples.orm.map.annotated.ManyManyEntity 14 5 0 1
ejava.examples.orm.map.annotated.OneManyChild 14 5 0 1
ejava.examples.orm.rel.composite.Room 13 4 0 1
ejava.examples.orm.rel.composite.Mortgage 11 4 0 1
ejava.examples.orm.rel.composite.Door 11 4 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
ejava.examples.orm.rel.annotated.Borrower 44 14 0 2
ejava.examples.orm.rel.annotated.Person 29 11 0 1
ejava.examples.orm.onetomany.annotated.OneManyOwningParent 25 9 0 1
ejava.examples.orm.rel.annotated.Checkout 26 9 0 0
ejava.examples.orm.rel.annotated.MediaCopy 26 9 0 1
ejava.examples.orm.map.annotated.ManyManyOwningEntity 26 8 0 1
ejava.examples.orm.rel.MediaCopyPK2 24 8 0 0
ejava.examples.orm.rel.MediaCopyPK 24 8 0 0
ejava.examples.orm.rel.annotated.MediaCopy2 22 8 0 1
ejava.examples.orm.rel.annotated.Author 26 8 0 1
ejava.examples.orm.rel.annotated.Inventory 26 8 0 1
ejava.examples.orm.onetomany.annotated.OneManyChild 19 7 0 1
ejava.examples.orm.map.annotated.OneManyOwningParent 21 7 0 1
ejava.examples.orm.rel.composite.House 19 7 0 0
ejava.examples.orm.rel.annotated.Media 24 7 0 1
ejava.examples.orm.rel.annotated.Applicant 19 7 0 1
ejava.examples.orm.map.annotated.OneManyInverseParent 22 6 0 1
ejava.examples.orm.map.annotated.OneManyOwningChild 19 6 0 1
ejava.examples.orm.map.annotated.ManyManyInverseEntity 22 6 0 1
ejava.examples.orm.rel.composite.ResidentPK 23 6 0 0
ejava.examples.orm.rel.composite.DoorPK 23 6 0 0
ejava.examples.orm.rel.composite.RoomPK 23 6 0 0
ejava.examples.orm.rel.composite.MortgagePK 23 6 0 0
ejava.examples.orm.rel.annotated.Library 20 6 0 1
ejava.examples.orm.rel.annotated.Photo 20 6 0 1
ejava.examples.orm.map.annotated.ManyManyEntity 14 5 0 1
ejava.examples.orm.map.annotated.OneManyChild 14 5 0 1
ejava.examples.orm.rel.composite.Mortgage 11 4 0 1
ejava.examples.orm.rel.composite.Door 11 4 0 1
ejava.examples.orm.rel.composite.Resident 11 4 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
21.19 791.00 0.00 6.81 0.78

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
ejava.examples.orm.map.annotated.OneManyInverseParent.toString() 10 3 0
ejava.examples.orm.map.annotated.ManyManyInverseEntity.toString() 10 3 0
ejava.examples.orm.map.annotated.ManyManyOwningEntity.toString() 9 3 0
ejava.examples.orm.rel.composite.ResidentPK.equals(Object) 9 8 0
ejava.examples.orm.rel.composite.DoorPK.equals(Object) 9 8 0
ejava.examples.orm.rel.composite.RoomPK.equals(Object) 9 8 0
ejava.examples.orm.rel.composite.MortgagePK.equals(Object) 9 8 0
ejava.examples.orm.rel.annotated.Author.toString() 9 2 0
ejava.examples.orm.rel.annotated.Media.toString() 9 2 0
ejava.examples.orm.rel.annotated.Inventory.toString() 9 2 0
ejava.examples.orm.rel.annotated.Borrower.toString() 8 3 0
ejava.examples.orm.rel.annotated.Library.toString() 8 2 0
ejava.examples.orm.map.annotated.OneManyOwningChild.toString() 7 2 0
ejava.examples.orm.map.annotated.OneManyOwningParent.toString() 7 2 0
ejava.examples.orm.onetomany.annotated.OneManyOwningParent.toString() 6 1 0
ejava.examples.orm.rel.MediaCopyPK2.equals(Object) 6 6 0
ejava.examples.orm.rel.MediaCopyPK.equals(Object) 6 6 0
ejava.examples.orm.onetomany.annotated.OneManyChild.toString() 5 1 0
ejava.examples.orm.map.annotated.ManyManyEntity.toString() 5 1 0
ejava.examples.orm.map.annotated.OneManyChild.toString() 5 1 0
ejava.examples.orm.rel.annotated.MediaCopy.MediaCopy(Media,int) 5 1 0
ejava.examples.orm.rel.composite.Room.Room(House,int) 4 1 0
ejava.examples.orm.rel.annotated.Borrower.Borrower(Person) 4 1 0
ejava.examples.orm.rel.annotated.MediaCopy2.MediaCopy2(Media,int) 4 1 0
ejava.examples.orm.rel.annotated.Photo.toString() 4 3 0
ejava.examples.orm.rel.MediaCopyPK2.MediaCopyPK2(long,int) 3 1 0
ejava.examples.orm.rel.composite.ResidentPK.ResidentPK(int,int) 3 1 0
ejava.examples.orm.rel.composite.Mortgage.Mortgage(House,int) 3 1 0
ejava.examples.orm.rel.composite.DoorPK.DoorPK(int,int) 3 1 0
ejava.examples.orm.rel.composite.RoomPK.RoomPK(int,int) 3 1 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
791.00 2.52 1.26 0.00

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