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.

Package Classes Methods NCSS Javadocs Javadoc lines Single lines comment Multi lines comment
it.amattioli.workstate.core 38 284 1485 105 871 17 9
it.amattioli.workstate.config 23 107 682 27 297 22 0
it.amattioli.workstate.exceptions 8 65 323 14 88 1 0
it.amattioli.workstate.actions 15 51 193 15 117 2 0
it.amattioli.workstate.wfunit 9 32 188 2 7 0 0
it.amattioli.workstate.hibernate 4 24 118 0 0 0 0
it.amattioli.workstate.conversion 4 14 81 1 3 6 19
it.amattioli.workstate.info 5 17 79 2 11 0 0
it.amattioli.workstate.specifications 2 18 73 0 0 0 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
108 612 3222 166 1394 48 28

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
it.amattioli.workstate.config.ConfigBuilder 149 18 1 5
it.amattioli.workstate.core.Machine 111 21 0 1
it.amattioli.workstate.config.SaxEventsHandler 96 4 0 1
it.amattioli.workstate.core.Transition 92 22 1 5
it.amattioli.workstate.core.MetaAttribute 89 15 0 0
it.amattioli.workstate.core.RealState 84 18 0 9
it.amattioli.workstate.exceptions.ErrorMessage 76 3 0 1
it.amattioli.workstate.core.StateMemento 73 6 0 2
it.amattioli.workstate.core.State 71 24 0 14
it.amattioli.workstate.core.SequentialState 71 11 0 4
it.amattioli.workstate.core.CompositeState 70 13 0 0
it.amattioli.workstate.core.MetaEvent 69 12 0 10
it.amattioli.workstate.core.ReferenceState 69 16 0 2
it.amattioli.workstate.exceptions.WorkflowException 66 11 0 0
it.amattioli.workstate.core.MetaRealState 61 13 0 5
it.amattioli.workstate.core.EventRepository 58 8 0 6
it.amattioli.workstate.exceptions.MessageBundle 57 7 0 5
it.amattioli.workstate.config.TransitionBuilder 55 9 0 0
it.amattioli.workstate.exceptions.ErrorMessages 55 26 0 1
it.amattioli.workstate.core.MetaState 54 11 0 10
it.amattioli.workstate.core.MetaMachine 53 14 0 1
it.amattioli.workstate.specifications.MachineSpecification 50 13 0 0
it.amattioli.workstate.hibernate.MachineHibernateType 48 13 0 0
it.amattioli.workstate.config.MetaRealStateBuilder 44 9 0 0
it.amattioli.workstate.wfunit.XmlTestEventHandler 42 5 0 0
it.amattioli.workstate.conversion.ConversionService 42 8 0 0
it.amattioli.workstate.core.MetaCompositeState 42 9 0 9
it.amattioli.workstate.config.XmlConfiguration 40 8 0 2
it.amattioli.workstate.info.TreeInfo 38 6 0 0
it.amattioli.workstate.wfunit.WorkflowTestCase 36 10 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
it.amattioli.workstate.exceptions.ErrorMessages 55 26 0 1
it.amattioli.workstate.core.State 71 24 0 14
it.amattioli.workstate.core.Transition 92 22 1 5
it.amattioli.workstate.core.Machine 111 21 0 1
it.amattioli.workstate.config.ConfigBuilder 149 18 1 5
it.amattioli.workstate.core.RealState 84 18 0 9
it.amattioli.workstate.core.ReferenceState 69 16 0 2
it.amattioli.workstate.core.MetaAttribute 89 15 0 0
it.amattioli.workstate.core.MetaMachine 53 14 0 1
it.amattioli.workstate.core.MetaRealState 61 13 0 5
it.amattioli.workstate.core.CompositeState 70 13 0 0
it.amattioli.workstate.specifications.MachineSpecification 50 13 0 0
it.amattioli.workstate.hibernate.MachineHibernateType 48 13 0 0
it.amattioli.workstate.core.MetaEvent 69 12 0 10
it.amattioli.workstate.config.Registry 32 11 0 0
it.amattioli.workstate.core.MetaState 54 11 0 10
it.amattioli.workstate.core.SequentialState 71 11 0 4
it.amattioli.workstate.exceptions.WorkflowException 66 11 0 0
it.amattioli.workstate.wfunit.WorkflowTestCase 36 10 0 0
it.amattioli.workstate.config.TransitionBuilder 55 9 0 0
it.amattioli.workstate.config.MetaRealStateBuilder 44 9 0 0
it.amattioli.workstate.core.MetaCompositeState 42 9 0 9
it.amattioli.workstate.config.XmlConfiguration 40 8 0 2
it.amattioli.workstate.conversion.ConversionService 42 8 0 0
it.amattioli.workstate.core.EventRepository 58 8 0 6
it.amattioli.workstate.hibernate.HqlMachineSpecification 26 8 1 0
it.amattioli.workstate.exceptions.SimpleKeyedException 23 8 0 0
it.amattioli.workstate.core.PseudoState 15 7 0 0
it.amattioli.workstate.core.Event 34 7 0 6
it.amattioli.workstate.exceptions.MessageBundle 57 7 0 5

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
26.58 3,222.00 0.03 5.67 1.54

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
it.amattioli.workstate.config.SaxEventsHandler.endElement(String,String,String) 48 17 0
it.amattioli.workstate.config.ConfigBuilder.newState(StateType,String,String) 40 17 1
it.amattioli.workstate.config.SaxEventsHandler.startElement(String,String,String,Attributes) 39 13 0
it.amattioli.workstate.core.StateMemento.fromTag(String) 39 9 1
it.amattioli.workstate.exceptions.MessageBundle.replaceResources(String) 38 11 0
it.amattioli.workstate.core.ExternalTransition.perform(Event,State) 25 11 0
it.amattioli.workstate.config.TransitionBuilder.newGuard(String) 23 11 0
it.amattioli.workstate.core.SequentialState.enterCurrent(MetaState) 21 14 1
it.amattioli.workstate.core.ConcurrentState.initSubstates(StateMemento) 18 8 0
it.amattioli.workstate.config.ConfigBuilder.endState() 17 7 1
it.amattioli.workstate.core.MetaAttribute.toString() 17 5 0
it.amattioli.workstate.core.SequentialState.restore(StateMemento) 17 6 0
it.amattioli.workstate.exceptions.WorkflowException.equals(Object) 17 9 0
it.amattioli.workstate.core.MetaAttribute.setAttributeClass(String) 16 8 0
it.amattioli.workstate.config.TransitionBuilder.newTransitionAction(String) 15 9 0
it.amattioli.workstate.config.MetaRealStateBuilder.newStateAction(String) 15 9 0
it.amattioli.workstate.core.EventRepository.buildEvent(String,Object,ConversionService) 15 6 1
it.amattioli.workstate.core.EventRepository.constructParamValue(MetaAttribute,Object,ConversionService) 15 4 0
it.amattioli.workstate.core.ReferenceState.restore(StateMemento) 15 5 0
it.amattioli.workstate.core.Machine.getAttribute(String) 15 12 0
it.amattioli.workstate.wfunit.XmlTestEventsReader.readEvents() 14 7 0
it.amattioli.workstate.wfunit.XmlTestEventHandler.startElement(String,String,String,Attributes) 14 5 0
it.amattioli.workstate.info.TreeInfo.appendString(StringBuffer) 14 4 0
it.amattioli.workstate.conversion.ConversionService.findFormat(Class) 13 5 0
it.amattioli.workstate.core.Event.toString() 13 3 1
it.amattioli.workstate.core.Machine.processEvents() 13 4 0
it.amattioli.workstate.wfunit.XmlTestEventHandler.endElement(String,String,String) 12 5 0
it.amattioli.workstate.core.MetaState.descendFrom(MetaCompositeState) 12 5 1
it.amattioli.workstate.core.EventRepository.convertStringParam(MetaAttribute,Object,ConversionService) 12 4 0
it.amattioli.workstate.core.MetaEvent.initParameters(Object) 12 4 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
3,222.00 4.12 2.02 0.20

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