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
ch.visnet.heartbreak 35 136 596 0 0 84 1
com.adhoco.controller 1 5 17 1 6 1 0
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
36 141 613 1 6 85 1

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
ch.visnet.heartbreak.Node2NodeConnection 46 6 1 0
ch.visnet.heartbreak.MockRoomController 46 17 0 0
ch.visnet.heartbreak.MockValveHeating 40 27 0 0
ch.visnet.heartbreak.SimpleThermalNode 38 5 0 0
ch.visnet.heartbreak.HeatingBreaker 30 2 0 0
ch.visnet.heartbreak.EccobuildClimateDAO 29 4 2 0
ch.visnet.heartbreak.RealTimeClockAdapter 20 9 0 0
ch.visnet.heartbreak.MockMeteo 20 6 0 0
ch.visnet.heartbreak.ControllableHeatSource 19 5 0 0
ch.visnet.heartbreak.ScheduledTemperatureNode 17 5 0 0
ch.visnet.heartbreak.SimpleZoneThermalModel 17 4 0 0
ch.visnet.heartbreak.AbstractThermalNode 17 4 0 0
ch.visnet.heartbreak.SineWave 16 4 0 0
com.adhoco.controller.HeatingAdapter 15 5 0 1
ch.visnet.heartbreak.SimpleZoneModel 12 4 0 0
ch.visnet.heartbreak.SimpleSolarGains 12 3 0 0
ch.visnet.heartbreak.AdhocoHardwareFactory 11 1 0 0
ch.visnet.heartbreak.Main 10 1 0 0
ch.visnet.heartbreak.ScheduledIlluminance 8 2 0 0
ch.visnet.heartbreak.EccobuildIrradianceSchedule 6 2 0 0
ch.visnet.heartbreak.MockRoom 6 1 0 0
ch.visnet.heartbreak.AbstractHeatSource 6 3 0 0
ch.visnet.heartbreak.EccobuildTemperatureSchedule 6 2 0 0
ch.visnet.heartbreak.FunctionalSchedule 6 2 0 0
ch.visnet.heartbreak.SimpleZoneLightingModel 5 3 0 0
ch.visnet.heartbreak.MockHomeController 5 2 0 0
ch.visnet.heartbreak.NodeConnection 4 3 0 0
ch.visnet.heartbreak.ThermalNode 4 3 0 0
ch.visnet.heartbreak.Steppable 3 2 0 0
ch.visnet.heartbreak.Illuminance 2 1 0 0

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
ch.visnet.heartbreak.MockValveHeating 40 27 0 0
ch.visnet.heartbreak.MockRoomController 46 17 0 0
ch.visnet.heartbreak.RealTimeClockAdapter 20 9 0 0
ch.visnet.heartbreak.Node2NodeConnection 46 6 1 0
ch.visnet.heartbreak.MockMeteo 20 6 0 0
ch.visnet.heartbreak.ScheduledTemperatureNode 17 5 0 0
ch.visnet.heartbreak.ControllableHeatSource 19 5 0 0
ch.visnet.heartbreak.SimpleThermalNode 38 5 0 0
com.adhoco.controller.HeatingAdapter 15 5 0 1
ch.visnet.heartbreak.SineWave 16 4 0 0
ch.visnet.heartbreak.SimpleZoneThermalModel 17 4 0 0
ch.visnet.heartbreak.SimpleZoneModel 12 4 0 0
ch.visnet.heartbreak.AbstractThermalNode 17 4 0 0
ch.visnet.heartbreak.EccobuildClimateDAO 29 4 2 0
ch.visnet.heartbreak.NodeConnection 4 3 0 0
ch.visnet.heartbreak.AbstractHeatSource 6 3 0 0
ch.visnet.heartbreak.ThermalNode 4 3 0 0
ch.visnet.heartbreak.SimpleZoneLightingModel 5 3 0 0
ch.visnet.heartbreak.SimpleSolarGains 12 3 0 0
ch.visnet.heartbreak.EccobuildIrradianceSchedule 6 2 0 0
ch.visnet.heartbreak.Steppable 3 2 0 0
ch.visnet.heartbreak.ScheduledIlluminance 8 2 0 0
ch.visnet.heartbreak.HeatingBreaker 30 2 0 0
ch.visnet.heartbreak.EccobuildTemperatureSchedule 6 2 0 0
ch.visnet.heartbreak.FunctionalSchedule 6 2 0 0
ch.visnet.heartbreak.MockHomeController 5 2 0 0
ch.visnet.heartbreak.Illuminance 2 1 0 0
ch.visnet.heartbreak.MockRoom 6 1 0 0
ch.visnet.heartbreak.Main 10 1 0 0
ch.visnet.heartbreak.ZoneThermalModel 2 1 0 0

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
13.47 613.00 0.08 3.92 0.03

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
ch.visnet.heartbreak.SimpleThermalNode.getTemperature() 13 5 0
ch.visnet.heartbreak.HeatingBreaker.testBasicHeating() 13 2 0
ch.visnet.heartbreak.Node2NodeConnection.nodeIsDone(AbstractThermalNode) 12 5 0
ch.visnet.heartbreak.SimpleThermalNode.SimpleThermalNode(Calendar,double,double) 10 2 0
ch.visnet.heartbreak.Main.main(String[]) 9 1 0
ch.visnet.heartbreak.Node2NodeConnection.update(long) 8 3 0
ch.visnet.heartbreak.Node2NodeConnection.getHeatToNode(AbstractThermalNode) 8 3 0
ch.visnet.heartbreak.AdhocoHardwareFactory.newHardware(AdhocoControlProfile,int) 8 3 0
ch.visnet.heartbreak.EccobuildClimateDAO.getClimateAt(Calendar) 8 3 0
ch.visnet.heartbreak.MockRoomController.MockRoomController(ZoneModel,Room,Home,ControllerSettings,IHomeController,IMeteo) 7 1 0
ch.visnet.heartbreak.ScheduledTemperatureNode.step(long) 6 3 0
ch.visnet.heartbreak.SimpleThermalNode.step(long) 6 3 0
ch.visnet.heartbreak.HeatingBreaker.HeatingBreaker(HeatingAdapter,ThermalNode,ThermalNode,ThermalNode,Illuminance) 6 1 0
ch.visnet.heartbreak.MockMeteo.getOutdoorTemperature(long) 6 3 0
ch.visnet.heartbreak.SineWave.SineWave(double,double,long,double) 5 1 0
ch.visnet.heartbreak.SimpleZoneThermalModel.step(long) 5 4 0
ch.visnet.heartbreak.ControllableHeatSource.newControllableHeatSource(ThermalNode,double,COVSubscribable) 5 1 0
ch.visnet.heartbreak.ControllableHeatSource.ControllableHeatSource(double,COVSubscribable) 5 3 0
ch.visnet.heartbreak.MockRoom.newRoom(RoomID,Hardware) 5 1 0
ch.visnet.heartbreak.Node2NodeConnection.newConnection(AbstractThermalNode,AbstractThermalNode,double) 5 1 0
ch.visnet.heartbreak.Node2NodeConnection.Node2NodeConnection(AbstractThermalNode,AbstractThermalNode,double) 5 1 0
ch.visnet.heartbreak.ScheduledTemperatureNode.ScheduledTemperatureNode(Schedule,Calendar) 4 1 0
ch.visnet.heartbreak.SimpleSolarGains.newSimpleSolarGains(ThermalNode,Illuminance,double) 4 1 0
com.adhoco.controller.HeatingAdapter.HeatingAdapter(IRoomController,Hardware) 4 1 0
ch.visnet.heartbreak.SimpleZoneThermalModel.SimpleZoneThermalModel(Set,ThermalNode) 3 1 0
ch.visnet.heartbreak.ControllableHeatSource.notifyCOV(AnalogOutput) 3 1 0
ch.visnet.heartbreak.SimpleZoneModel.SimpleZoneModel(ZoneThermalModel,ZoneLightingModel) 3 1 0
ch.visnet.heartbreak.SimpleThermalNode.addHeat(double) 3 1 0
ch.visnet.heartbreak.AbstractThermalNode.AbstractThermalNode(Calendar) 3 1 0
ch.visnet.heartbreak.AbstractThermalNode.addConnection(NodeConnection) 3 3 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
613.00 2.67 1.35 0.00

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