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
pl.edu.agh.cast.schema.layout.algorithm 14 90 1157 69 532 85 93
pl.edu.agh.cast.schema.action 12 51 344 23 117 23 110
pl.edu.agh.cast.schema.editpart 4 40 322 7 24 8 40
pl.edu.agh.cast.schema.figure 8 38 308 9 43 7 57
pl.edu.agh.cast.schema.editor 6 23 203 9 55 25 24
pl.edu.agh.cast.schema.command 9 31 189 7 31 4 45
pl.edu.agh.cast.schema.action.layout 5 9 84 6 34 0 35
pl.edu.agh.cast.schema.model 1 11 72 7 43 2 12
pl.edu.agh.cast.schema.policy 2 8 63 2 8 2 39
pl.edu.agh.cast.ui.wizards 1 4 53 1 3 2 16
pl.edu.agh.cast.schema.util 1 1 32 1 5 2 6
pl.edu.agh.cast.schema 1 5 25 3 13 6 16
pl.edu.agh.cast.schema.layout 1 1 24 1 5 3 9
pl.edu.agh.cast.schema.model.visual 1 2 14 1 5 1 6
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
66 314 2890 146 918 170 508

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm 345 25 2 29
pl.edu.agh.cast.schema.layout.algorithm.GroupLayoutAlgorithm 134 10 0 1
pl.edu.agh.cast.schema.editpart.SchemaNodeEditPart 119 21 0 2
pl.edu.agh.cast.schema.figure.DoublePolylineConnection 119 10 1 1
pl.edu.agh.cast.schema.layout.algorithm.AdvancedPeacockLayoutAlgorithm 118 8 0 7
pl.edu.agh.cast.schema.layout.algorithm.PeacockLayoutAlgorithm 113 10 0 2
pl.edu.agh.cast.schema.layout.algorithm.EnhancedCircleLayout 100 5 0 5
pl.edu.agh.cast.schema.editor.SchemaEditor 85 12 3 3
pl.edu.agh.cast.schema.editpart.SchemaEditPart 60 9 0 2
pl.edu.agh.cast.schema.layout.algorithm.AbstractLayoutAlgorithm 55 7 0 7
pl.edu.agh.cast.schema.model.SchemaDiagram 53 11 0 7
pl.edu.agh.cast.schema.layout.algorithm.NewPeacockLayoutAlgorithm 51 5 0 2
pl.edu.agh.cast.schema.figure.VariableThicknessPolylineConnection 49 6 0 1
pl.edu.agh.cast.schema.layout.algorithm.CircleLayoutAlgorithm 47 4 0 2
pl.edu.agh.cast.schema.layout.algorithm.CombinationGenerator 40 5 0 4
pl.edu.agh.cast.schema.action.ToggleMainEntityAction 39 6 0 1
pl.edu.agh.cast.schema.action.ResetThicknessAction 38 7 0 1
pl.edu.agh.cast.ui.wizards.GetSelectMediatorsParametersWizard 37 4 0 1
pl.edu.agh.cast.schema.editpart.ConnectionGroupEditPart 37 8 0 1
pl.edu.agh.cast.schema.action.layout.SetLayoutAction 37 4 0 1
pl.edu.agh.cast.schema.figure.SinglePolylineConnection 34 6 0 1
pl.edu.agh.cast.schema.layout.algorithm.AbstractGroupingLayoutAlgorithm 33 5 0 6
pl.edu.agh.cast.schema.action.ShowPropertiesAction 33 7 0 1
pl.edu.agh.cast.schema.command.SetLayoutCommand 32 4 2 1
pl.edu.agh.cast.schema.action.InvertSelectionAction 31 6 0 7
pl.edu.agh.cast.schema.util.Messages 30 1 0 1
pl.edu.agh.cast.schema.figure.SchemaNodeFigure 29 8 0 1
pl.edu.agh.cast.schema.editor.SchemaEditorContextMenuProvider 27 3 0 3
pl.edu.agh.cast.schema.command.AddConnectionCommand 26 4 0 1
pl.edu.agh.cast.schema.command.MoveDiagramElementCommand 23 4 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm 345 25 2 29
pl.edu.agh.cast.schema.editpart.SchemaNodeEditPart 119 21 0 2
pl.edu.agh.cast.schema.editor.SchemaEditor 85 12 3 3
pl.edu.agh.cast.schema.model.SchemaDiagram 53 11 0 7
pl.edu.agh.cast.schema.layout.algorithm.PeacockLayoutAlgorithm 113 10 0 2
pl.edu.agh.cast.schema.layout.algorithm.GroupLayoutAlgorithm 134 10 0 1
pl.edu.agh.cast.schema.figure.DoublePolylineConnection 119 10 1 1
pl.edu.agh.cast.schema.editpart.SchemaEditPart 60 9 0 2
pl.edu.agh.cast.schema.editpart.ConnectionGroupEditPart 37 8 0 1
pl.edu.agh.cast.schema.layout.algorithm.AdvancedPeacockLayoutAlgorithm 118 8 0 7
pl.edu.agh.cast.schema.figure.SchemaNodeFigure 29 8 0 1
pl.edu.agh.cast.schema.layout.algorithm.AbstractLayoutAlgorithm 55 7 0 7
pl.edu.agh.cast.schema.action.ShowPropertiesAction 33 7 0 1
pl.edu.agh.cast.schema.action.ResetThicknessAction 38 7 0 1
pl.edu.agh.cast.schema.action.InvertSelectionAction 31 6 0 7
pl.edu.agh.cast.schema.action.ToggleMainEntityAction 39 6 0 1
pl.edu.agh.cast.schema.figure.VariableThicknessPolylineConnection 49 6 0 1
pl.edu.agh.cast.schema.figure.SinglePolylineConnection 34 6 0 1
pl.edu.agh.cast.schema.command.ToggleMainNodeCommand 13 5 0 1
pl.edu.agh.cast.schema.command.SelectMediatorsCommand 18 5 0 1
pl.edu.agh.cast.schema.policy.SchemaConnectionCreatePolicy 16 5 0 1
pl.edu.agh.cast.schema.Activator 19 5 0 3
pl.edu.agh.cast.schema.layout.algorithm.AbstractGroupingLayoutAlgorithm 33 5 0 6
pl.edu.agh.cast.schema.layout.algorithm.CombinationGenerator 40 5 0 4
pl.edu.agh.cast.schema.layout.algorithm.EnhancedCircleLayout 100 5 0 5
pl.edu.agh.cast.schema.layout.algorithm.NewPeacockLayoutAlgorithm 51 5 0 2
pl.edu.agh.cast.schema.action.SelectLeafNodesAction 20 5 0 6
pl.edu.agh.cast.schema.figure.DoublePolylineConnection.InternalConnectionAnchor 16 5 0 0
pl.edu.agh.cast.ui.wizards.GetSelectMediatorsParametersWizard 37 4 0 1
pl.edu.agh.cast.schema.command.SetLayoutCommand 32 4 2 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
35.33 2,890.00 0.12 4.76 2.24

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
pl.edu.agh.cast.schema.layout.algorithm.EnhancedCircleLayout.doLayout(Node,int,int,IProgressMonitor) 69 16 1
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm.steepestDescent(Edge) 33 7 1
pl.edu.agh.cast.schema.layout.algorithm.AdvancedPeacockLayoutAlgorithm.positionNeighbours(Node,IProgressMonitor) 29 11 1
pl.edu.agh.cast.schema.layout.algorithm.GroupLayoutAlgorithm.setNodesPositions(Node,IProgressMonitor) 29 4 0
pl.edu.agh.cast.schema.layout.algorithm.PeacockLayoutAlgorithm.setNodesPositions(Node,IProgressMonitor) 28 5 1
pl.edu.agh.cast.schema.layout.algorithm.AbstractLayoutAlgorithm.layoutNodes(Node,IProgressMonitor) 27 9 1
pl.edu.agh.cast.schema.editor.SchemaEditor.createActions() 27 1 0
pl.edu.agh.cast.schema.editpart.SchemaNodeEditPart.propertyChange(PropertyChangeEvent) 26 10 0
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm.makeTree(TreeNode,Node,String,String) 26 5 1
pl.edu.agh.cast.ui.wizards.GetSelectMediatorsParametersWizard.performFinish() 25 4 0
pl.edu.agh.cast.schema.layout.algorithm.PeacockLayoutAlgorithm.drawTail(Node,Point,Node) 25 4 0
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm.setNodesPositions(Node,IProgressMonitor) 24 8 0
pl.edu.agh.cast.schema.layout.algorithm.AdvancedPeacockLayoutAlgorithm.drawPeacock(Node,double,Point) 24 5 1
pl.edu.agh.cast.schema.figure.DoublePolylineConnection.setPoints(PointList) 24 3 0
pl.edu.agh.cast.schema.layout.algorithm.CircleLayoutAlgorithm.setNodesPositions(Node,IProgressMonitor) 22 5 0
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm.getRootConnectionNodes(int,String) 22 8 1
pl.edu.agh.cast.schema.layout.algorithm.GroupLayoutAlgorithm.displayFigureChildren(Node,Node,Node,int,int,double,double,int,int) 22 7 0
pl.edu.agh.cast.schema.layout.algorithm.GroupLayoutAlgorithm.childrenCount(Node,Node,Node) 22 15 0
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm.setRootNode(Node) 21 6 1
pl.edu.agh.cast.schema.layout.algorithm.NewPeacockLayoutAlgorithm.arrangeInArc(Node,double,double,double,Point) 20 5 1
pl.edu.agh.cast.schema.layout.algorithm.PeacockLayoutAlgorithm.drawCommonEntities(Node) 19 3 0
pl.edu.agh.cast.schema.action.layout.SetLayoutAction.selectionChanged(IAction,ISelection) 19 7 0
pl.edu.agh.cast.schema.figure.VariableThicknessPolylineConnection.VariableThicknessPolylineConnection(ConnectionGroup) 19 3 0
pl.edu.agh.cast.schema.editpart.SchemaEditPart.propertyChange(PropertyChangeEvent) 18 11 0
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm.mergeGraphAndMakeTree(Node) 18 2 1
pl.edu.agh.cast.schema.layout.algorithm.GroupLayoutAlgorithm.getCycles(Node,IProgressMonitor) 18 5 0
pl.edu.agh.cast.schema.editor.SchemaEditorContextMenuProvider.buildContextMenu(IMenuManager) 18 1 1
pl.edu.agh.cast.schema.figure.DoublePolylineConnection.DoublePolylineConnection(ConnectionGroup) 18 1 0
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm.derivativeX(Edge,Node) 17 5 1
pl.edu.agh.cast.schema.layout.algorithm.Peacock3LayoutAlgorithm.derivativeY(Edge,Node) 17 5 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
2,890.00 6.53 2.31 0.27

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