JavaNCSS Metric Results

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

The following document contains the results of a JavaNCSS metric analysis.
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
net.sf.hattori.populators.domain 4 8 230 1 3 31 0
net.sf.hattori.populators.dto 5 9 147 3 24 9 0
net.sf.hattori.populators 5 8 104 4 28 9 0
net.sf.hattori 1 10 94 3 29 3 0
net.sf.hattori.repository 5 31 82 6 35 1 0
net.sf.hattori.annotations 0 0 38 0 0 0 67
net.sf.hattori.exceptions 3 12 30 2 10 4 0
net.sf.hattori.annotations.util 2 3 17 1 5 0 0
net.sf.hattori.log 1 5 15 0 0 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
26 86 757 20 134 57 67

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
net.sf.hattori.PopulationManager 81 10 0 3
net.sf.hattori.populators.domain.DomainObjectCollectionFieldPopulator 80 2 0 0
net.sf.hattori.populators.domain.DomainObjectDirectFieldPopulator 47 2 0 0
net.sf.hattori.populators.DynamicPopulator 47 4 0 0
net.sf.hattori.populators.domain.ByNameDomainObjectFieldPopulator 38 2 0 1
net.sf.hattori.populators.dto.DTODirectFieldPopulator 32 2 0 0
net.sf.hattori.populators.dto.DTOCollectionFieldPopulator 24 2 0 0
net.sf.hattori.repository.AbstractPersistentObjectDTO 24 10 0 1
net.sf.hattori.populators.dto.ByNameDTOFieldPopulator 23 2 0 1
net.sf.hattori.populators.domain.AbstractDomainObjectFieldPopulator 22 2 0 0
net.sf.hattori.repository.AbstractPersistentObject 21 9 0 2
net.sf.hattori.populators.dto.DTOFieldPopulator 19 2 0 1
net.sf.hattori.populators.AbstractFieldAccessor 17 2 0 2
net.sf.hattori.log.Logger 13 5 0 0
net.sf.hattori.exceptions.AnnotationConfigurationException 9 4 0 1
net.sf.hattori.exceptions.ConcurrentDTOException 9 4 0 0
net.sf.hattori.exceptions.DTOPopulationException 9 4 0 1
net.sf.hattori.repository.PersistentObject 6 5 0 1
net.sf.hattori.repository.PersistentObjectDTO 6 5 0 2
net.sf.hattori.annotations.util.UndefinedStaticPopulator 5 2 0 1
net.sf.hattori.annotations.util.AbstractPersistentObjectStaticPopulator 4 1 0 0
net.sf.hattori.populators.dto.NoOperationDTOFieldPopulator 4 1 0 1
net.sf.hattori.populators.ObjectPopulator 3 2 0 1
net.sf.hattori.repository.EntityLocator 3 2 0 0
net.sf.hattori.populators.PopulationState 1 0 0 0
net.sf.hattori.populators.StaticPopulator 1 0 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
net.sf.hattori.PopulationManager 81 10 0 3
net.sf.hattori.repository.AbstractPersistentObjectDTO 24 10 0 1
net.sf.hattori.repository.AbstractPersistentObject 21 9 0 2
net.sf.hattori.log.Logger 13 5 0 0
net.sf.hattori.repository.PersistentObject 6 5 0 1
net.sf.hattori.repository.PersistentObjectDTO 6 5 0 2
net.sf.hattori.exceptions.AnnotationConfigurationException 9 4 0 1
net.sf.hattori.exceptions.ConcurrentDTOException 9 4 0 0
net.sf.hattori.exceptions.DTOPopulationException 9 4 0 1
net.sf.hattori.populators.DynamicPopulator 47 4 0 0
net.sf.hattori.annotations.util.UndefinedStaticPopulator 5 2 0 1
net.sf.hattori.populators.AbstractFieldAccessor 17 2 0 2
net.sf.hattori.populators.domain.AbstractDomainObjectFieldPopulator 22 2 0 0
net.sf.hattori.populators.domain.ByNameDomainObjectFieldPopulator 38 2 0 1
net.sf.hattori.populators.domain.DomainObjectCollectionFieldPopulator 80 2 0 0
net.sf.hattori.populators.domain.DomainObjectDirectFieldPopulator 47 2 0 0
net.sf.hattori.populators.dto.ByNameDTOFieldPopulator 23 2 0 1
net.sf.hattori.populators.dto.DTOCollectionFieldPopulator 24 2 0 0
net.sf.hattori.populators.dto.DTODirectFieldPopulator 32 2 0 0
net.sf.hattori.populators.dto.DTOFieldPopulator 19 2 0 1
net.sf.hattori.populators.ObjectPopulator 3 2 0 1
net.sf.hattori.repository.EntityLocator 3 2 0 0
net.sf.hattori.annotations.util.AbstractPersistentObjectStaticPopulator 4 1 0 0
net.sf.hattori.populators.dto.NoOperationDTOFieldPopulator 4 1 0 1
net.sf.hattori.populators.PopulationState 1 0 0 0
net.sf.hattori.populators.StaticPopulator 1 0 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
21.08 757.00 0.00 3.31 0.77

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
net.sf.hattori.populators.domain.DomainObjectCollectionFieldPopulator.disassembleCollectionField(Field,PersistentObjectDTO,Object) 63 35 0
net.sf.hattori.populators.domain.ByNameDomainObjectFieldPopulator.setFieldValue(Field,PersistentObjectDTO,Object) 32 18 0
net.sf.hattori.populators.domain.DomainObjectDirectFieldPopulator.disassembleField(Field,PersistentObjectDTO,Object) 30 15 0
net.sf.hattori.PopulationManager.populateDomainObject(PersistentObjectDTO,EntityLocator) 21 10 1
net.sf.hattori.populators.domain.AbstractDomainObjectFieldPopulator.setDomainField(PersistentObjectDTO,String,Object,String) 20 8 0
net.sf.hattori.populators.dto.DTOCollectionFieldPopulator.assembleCollectionField(Field,PersistentObjectDTO,Object) 17 6 0
net.sf.hattori.populators.dto.DTODirectFieldPopulator.assembleField(Field,PersistentObjectDTO,Object) 17 8 0
net.sf.hattori.populators.dto.DTOFieldPopulator.setDirectPopulationFieldValue(PersistentObjectDTO,String,Object,String) 17 7 1
net.sf.hattori.PopulationManager.getPopulator(PersistentObjectDTO) 16 5 0
net.sf.hattori.populators.domain.DomainObjectCollectionFieldPopulator.populateField(Field,PersistentObjectDTO,PersistentObject) 16 7 0
net.sf.hattori.populators.domain.DomainObjectDirectFieldPopulator.populateField(Field,PersistentObjectDTO,PersistentObject) 16 8 0
net.sf.hattori.populators.dto.ByNameDTOFieldPopulator.populateField(Field,PersistentObjectDTO,Object) 16 7 0
net.sf.hattori.populators.DynamicPopulator.populateDTO(PersistentObject,PersistentObjectDTO) 15 5 0
net.sf.hattori.populators.dto.DTODirectFieldPopulator.populateDTOField(Field,PersistentObject,PersistentObjectDTO) 14 6 0
net.sf.hattori.populators.DynamicPopulator.getDTOFieldPopulator(Field) 13 9 0
net.sf.hattori.populators.AbstractFieldAccessor.getPropertyName(Field) 11 5 0
net.sf.hattori.PopulationManager.populateDTO(PersistentObject,Class) 9 3 0
net.sf.hattori.PopulationManager.populateDTO(PersistentObject,PersistentObjectDTO) 9 5 0
net.sf.hattori.populators.DynamicPopulator.populateDomainObject(PersistentObjectDTO,PersistentObject) 9 2 0
net.sf.hattori.populators.DynamicPopulator.getDomainObjectFieldPopulator(Field) 8 5 0
net.sf.hattori.PopulationManager.populateDomainObject(PersistentObjectDTO,PersistentObject) 7 3 0
net.sf.hattori.populators.dto.ByNameDTOFieldPopulator.populateDTOField(Field,PersistentObject,PersistentObjectDTO) 6 2 0
net.sf.hattori.populators.dto.DTOCollectionFieldPopulator.populateDTOField(Field,PersistentObject,PersistentObjectDTO) 6 2 0
net.sf.hattori.PopulationManager.populateDTOList(List,Class) 5 2 0
net.sf.hattori.populators.AbstractFieldAccessor.fieldIsInitializedValue(String,Object) 5 4 1
net.sf.hattori.populators.domain.ByNameDomainObjectFieldPopulator.populateField(Field,PersistentObjectDTO,PersistentObject) 5 2 1
net.sf.hattori.PopulationManager.getInstance() 4 2 1
net.sf.hattori.annotations.util.AbstractPersistentObjectStaticPopulator.populatePersistentProperties(PersistentObject,PersistentObjectDTO) 3 1 0
net.sf.hattori.populators.dto.NoOperationDTOFieldPopulator.populateDTOField(Field,PersistentObject,PersistentObjectDTO) 3 1 0
net.sf.hattori.repository.AbstractPersistentObjectDTO.resetPersistentState() 3 1 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
757.00 5.94 2.93 0.10

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