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.opentrafficsim.core.geometry 13 171 1971 201 1230 234 153
org.opentrafficsim.gui 7 51 731 83 329 70 53
org.opentrafficsim.core.network 16 153 653 159 693 17 195
org.opentrafficsim.core.units.distributions 6 10 573 48 214 0 16
org.opentrafficsim.core.gtu 12 103 521 112 461 15 119
org.opentrafficsim.core.gtu.plan.operational 3 38 433 79 402 30 44
org.opentrafficsim.simulationengine.properties 10 102 428 118 482 7 24
org.opentrafficsim.core.network.factory.xml.units 8 34 413 42 221 8 15
org.opentrafficsim.core.gtu.drivercharacteristics 9 52 236 61 379 13 31
org.opentrafficsim.core.math 5 31 207 52 306 21 14
org.opentrafficsim.core.dsol 10 54 195 64 208 3 33
org.opentrafficsim.simulationengine 9 34 183 43 264 3 19
org.opentrafficsim.core.gtu.animation 7 23 178 35 165 3 26
org.opentrafficsim.core.distributions 3 22 168 32 158 3 16
org.opentrafficsim.core.network.route 5 23 118 28 144 1 18
org.opentrafficsim.core.network.animation 4 8 96 12 72 2 13
org.opentrafficsim.core.perception 4 22 55 25 105 1 29
org.opentrafficsim.core.object.animation 1 8 40 9 40 0 11
org.opentrafficsim.core.object 2 5 25 7 34 1 13
org.opentrafficsim.core.gtu.plan.strategical 2 5 18 7 67 1 13
org.opentrafficsim.core.gtu.plan.tactical 1 1 12 2 34 0 11
org.opentrafficsim.core.idgenerator 1 2 12 3 19 0 11
org.opentrafficsim.core.gtu.perception 1 2 10 3 21 0 12
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
139 954 7276 1225 6048 433 889

Objects

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.opentrafficsim.core.geometry.OTSLine3D 431 49 1 50
org.opentrafficsim.gui.OTSControlPanel 338 19 6 40
org.opentrafficsim.core.geometry.OTSBufferingAV 312 16 0 17
org.opentrafficsim.core.gtu.plan.operational.OperationalPlan 299 25 4 64
org.opentrafficsim.core.geometry.Test 239 14 1 18
org.opentrafficsim.core.geometry.OTSBufferingJTS 235 11 0 12
org.opentrafficsim.core.network.OTSNetwork 173 31 0 32
org.opentrafficsim.core.gtu.AbstractGTU 145 28 0 29
org.opentrafficsim.core.geometry.OTSOffsetLinePK 144 2 0 3
org.opentrafficsim.core.distributions.Distribution 142 15 1 23
org.opentrafficsim.core.network.OTSNode 115 18 0 19
org.opentrafficsim.core.geometry.OTSPoint3D 112 27 0 28
org.opentrafficsim.core.geometry.TestIntersectionPerformance 110 4 1 19
org.opentrafficsim.core.gtu.RelativePosition 105 9 1 16
org.opentrafficsim.gui.OTSAnimationPanel 103 15 2 21
org.opentrafficsim.core.network.OTSLink 89 16 0 17
org.opentrafficsim.core.geometry.Clothoid 87 12 0 13
org.opentrafficsim.simulationengine.properties.CompoundProperty 87 16 1 17
org.opentrafficsim.core.network.factory.xml.units.Distributions 86 8 0 9
org.opentrafficsim.core.geometry.OTSShape 80 13 0 14
org.opentrafficsim.core.gtu.plan.operational.OperationalPlanBuilder 80 7 0 8
org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar 77 0 2 9
org.opentrafficsim.core.units.distributions.ContinuousDistFloatScalar 77 0 2 9
org.opentrafficsim.core.units.distributions.DiscreteDistDoubleScalar 77 0 2 9
org.opentrafficsim.core.units.distributions.DiscreteDistFloatScalar 77 0 2 9
org.opentrafficsim.core.geometry.Bezier 71 10 0 11
org.opentrafficsim.core.network.factory.xml.units.LengthUnits 67 6 0 7
org.opentrafficsim.core.network.factory.xml.units.TimeUnits 67 6 0 7
org.opentrafficsim.simulationengine.properties.ProbabilityDistributionProperty 65 14 0 15
org.opentrafficsim.core.gtu.drivercharacteristics.BehavioralCharacteristics 64 19 0 20

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.opentrafficsim.core.geometry.OTSLine3D 431 49 1 50
org.opentrafficsim.core.network.OTSNetwork 173 31 0 32
org.opentrafficsim.core.gtu.AbstractGTU 145 28 0 29
org.opentrafficsim.core.geometry.OTSPoint3D 112 27 0 28
org.opentrafficsim.core.gtu.GTU 28 27 0 28
org.opentrafficsim.core.gtu.plan.operational.OperationalPlan 299 25 4 64
org.opentrafficsim.core.network.Network 25 24 0 25
org.opentrafficsim.core.gtu.drivercharacteristics.BehavioralCharacteristics 64 19 0 20
org.opentrafficsim.gui.OTSControlPanel 338 19 6 40
org.opentrafficsim.core.network.OTSNode 115 18 0 19
org.opentrafficsim.core.geometry.OTSBufferingAV 312 16 0 17
org.opentrafficsim.core.network.OTSLink 89 16 0 17
org.opentrafficsim.simulationengine.properties.CompoundProperty 87 16 1 17
org.opentrafficsim.core.distributions.Distribution 142 15 1 23
org.opentrafficsim.gui.OTSAnimationPanel 103 15 2 21
org.opentrafficsim.core.geometry.Test 239 14 1 18
org.opentrafficsim.simulationengine.properties.ProbabilityDistributionProperty 65 14 0 15
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface 14 13 0 14
org.opentrafficsim.core.geometry.OTSShape 80 13 0 14
org.opentrafficsim.core.geometry.Clothoid 87 12 0 13
org.opentrafficsim.core.network.route.Route 39 12 0 13
org.opentrafficsim.core.geometry.OTSBufferingJTS 235 11 0 12
org.opentrafficsim.core.math.Acceleration3D 37 11 0 12
org.opentrafficsim.core.math.Speed3D 37 11 0 12
org.opentrafficsim.core.network.Link 12 11 0 12
org.opentrafficsim.core.network.Node 12 11 0 12
org.opentrafficsim.simulationengine.properties.AbstractProperty 36 11 1 18
org.opentrafficsim.simulationengine.properties.ContinuousProperty 41 11 0 12
org.opentrafficsim.simulationengine.properties.IntegerProperty 41 11 0 12
org.opentrafficsim.core.dsol.OTSSimTimeDouble 24 10 0 11

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
44.07 7,276.00 0.24 6.86 8.81

Methods

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.opentrafficsim.core.geometry.OTSBufferingAV.offsetLine(OTSLine3D,double) 161 57 1
org.opentrafficsim.core.geometry.OTSOffsetLinePK.offsetLine(OTSLine3D,double) 137 57 1
org.opentrafficsim.core.geometry.OTSBufferingJTS.offsetLine(OTSLine3D,double) 83 33 1
org.opentrafficsim.core.geometry.Test.checkOffsetLine(OTSLine3D,double,OTSLine3D.OffsetMethod) 69 29 1
org.opentrafficsim.core.geometry.OTSBufferingJTS.offsetGeometryOLD(OTSLine3D,double) 68 27 1
org.opentrafficsim.gui.OTSControlPanel.TimeWarpPanel.TimeWarpPanel(double,double,double,int,DEVSSimulatorInterface) 56 15 1
org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel.draw() 54 51 1
org.opentrafficsim.core.units.distributions.ContinuousDistFloatScalar.Rel.draw() 54 51 1
org.opentrafficsim.core.units.distributions.DiscreteDistDoubleScalar.Rel.draw() 54 51 1
org.opentrafficsim.core.units.distributions.DiscreteDistFloatScalar.Rel.draw() 54 51 1
org.opentrafficsim.core.geometry.OTSBufferingAV.splitAtIntersection(Line2D.Double,Line2D.Double) 43 34 1
org.opentrafficsim.core.geometry.OTSLine3D.extract(double,double) 43 18 1
org.opentrafficsim.gui.OTSControlPanel.actionPerformed(ActionEvent) 39 16 1
org.opentrafficsim.core.geometry.OTSBufferingJTS.offsetLine(OTSLine3D,double,double) 38 11 1
org.opentrafficsim.core.geometry.OTSLine3D.offsetLine(double,double) 38 11 1
org.opentrafficsim.core.geometry.OTSLine3D.offsetLine(OTSLine3D[],OTSLine3D[][]) 38 11 1
org.opentrafficsim.core.network.factory.xml.units.Colors.parseColor(String) 37 32 1
org.opentrafficsim.core.network.factory.xml.units.Distributions.makeDistContinuous(String,String[]) 37 35 1
org.opentrafficsim.core.geometry.OTSShape.intersects(OTSShape) 34 37 1
org.opentrafficsim.gui.ProbabilityDistributionEditor.ProbabilityDistributionEditor(String[],Double[]) 34 3 1
org.opentrafficsim.core.gtu.AbstractGTU.AbstractGTU(String,GTUType,OTSDEVSSimulatorInterface,StrategicalPlanner,Perception,DirectedPoint,Speed,PerceivableContext) 33 6 1
org.opentrafficsim.core.gtu.plan.operational.OperationalPlan.equals(Object) 33 27 1
org.opentrafficsim.core.gtu.plan.operational.OperationalPlanBuilder.buildMaximumAccelerationPlan(GTU,OTSLine3D,Time.Abs,Speed,Speed,Acceleration,Acceleration) 33 9 1
org.opentrafficsim.core.gtu.RelativePosition.equals(Object) 33 27 1
org.opentrafficsim.core.network.OTSLink.equals(Object) 33 27 1
org.opentrafficsim.core.geometry.Test.main(String[]) 30 2 1
org.opentrafficsim.core.geometry.OTSLine3D.noiseFilteredLine(double) 29 16 1
org.opentrafficsim.core.geometry.TestIntersectionPerformance.Results.result(boolean,boolean) 29 9 1
org.opentrafficsim.core.geometry.Clothoid.fresnel(double) 28 4 1
org.opentrafficsim.core.network.OTSNetwork.getShortestRouteBetween(GTUType,Node,Node,Node) 27 11 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
7,276.00 5.13 2.62 0.98

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