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.model.visual.backward 16 269 1291 249 1644 124 398
pl.edu.agh.cast.ui.dialogs 47 110 1253 23 143 45 110
pl.edu.agh.cast.ui.dialogs.property 17 112 855 81 476 81 175
pl.edu.agh.cast.editor 19 83 680 80 424 106 232
pl.edu.agh.cast.backward.editor 19 87 676 73 439 35 245
pl.edu.agh.cast.ui.dialogs.search 12 44 516 31 172 38 102
pl.edu.agh.cast.tool 6 51 474 17 76 52 140
pl.edu.agh.cast.resource 13 86 442 68 491 54 237
pl.edu.agh.cast.util 6 17 418 16 97 54 149
pl.edu.agh.cast.project 4 40 397 37 266 60 87
pl.edu.agh.cast.model.attributes 14 84 396 70 437 25 289
pl.edu.agh.cast.data.persistence 14 102 385 104 630 22 212
pl.edu.agh.cast.backward.editor.action 15 60 360 65 341 16 239
pl.edu.agh.cast.navigator.ui 14 42 350 39 210 43 83
pl.edu.agh.cast.backward.resources.xml 9 30 287 31 183 22 121
pl.edu.agh.cast.backward.command 14 41 279 41 251 8 160
pl.edu.agh.cast.editpart 7 41 272 37 188 19 91
pl.edu.agh.cast.backward.resources 9 42 235 44 280 11 151
pl.edu.agh.cast.backward.editor.operation 4 30 210 14 104 7 79
pl.edu.agh.cast.ui.outline 6 47 208 42 223 19 105
pl.edu.agh.cast.command 5 22 204 21 136 17 80
pl.edu.agh.cast 3 31 193 28 168 34 115
pl.edu.agh.cast.backward.figure 4 22 189 19 117 4 64
pl.edu.agh.cast.ui.advisor 3 18 186 14 74 45 57
pl.edu.agh.cast.backward.figure.icons 5 25 169 28 214 18 80
pl.edu.agh.cast.navigator.ui.action 5 22 166 26 135 12 80
pl.edu.agh.cast.editor.action.delegate 3 26 141 26 140 7 48
pl.edu.agh.cast.ui.util 5 30 128 29 238 1 57
pl.edu.agh.cast.model.attributes.validation 7 27 118 31 174 6 112
pl.edu.agh.cast.figure 4 20 117 22 143 1 64
pl.edu.agh.cast.ui 5 24 104 27 177 5 86
com.cloudgarden.resource 2 9 96 2 14 0 10
pl.edu.agh.cast.backward.editor.operation.search.filters 5 9 89 14 89 5 80
pl.edu.agh.cast.navigator.provider 3 10 79 13 72 5 48
pl.edu.agh.cast.util.logging 4 9 78 13 71 1 76
pl.edu.agh.cast.editor.action 4 11 74 14 77 1 70
pl.edu.agh.cast.data.persistence.serialize 2 7 72 7 36 9 35
pl.edu.agh.cast.action 5 20 71 25 130 0 80
pl.edu.agh.cast.ui.wizards 1 5 68 1 3 8 10
pl.edu.agh.cast.navigator 4 17 67 21 125 5 73
pl.edu.agh.cast.model.visual 3 14 64 15 107 1 51
pl.edu.agh.cast.data.persistence.runtime 2 13 60 12 62 1 35
pl.edu.agh.cast.editor.input 4 18 58 22 131 10 64
pl.edu.agh.cast.backward.action 1 3 50 4 26 2 16
pl.edu.agh.cast.data.converter 3 14 49 8 52 2 32
pl.edu.agh.cast.model 2 4 43 4 27 0 32
pl.edu.agh.cast.backward.editor.operation.search 1 2 23 3 18 0 16
pl.edu.agh.cast.ui.outline.dnd 1 7 23 8 40 2 16
pl.edu.agh.cast.policy 1 2 22 3 15 3 22
pl.edu.agh.cast.data.model.resource 1 1 20 2 8 14 31
pl.edu.agh.cast.ui.preferences 1 2 17 3 15 0 16
pl.edu.agh.cast.palette 1 2 11 2 10 0 16
pl.edu.agh.cast.preferences 1 1 10 2 10 0 16
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
366 1865 12843 1631 9929 1060 5093

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
pl.edu.agh.cast.tool.OverviewRectangleTool 300 34 1 8
pl.edu.agh.cast.ui.dialogs.StatisticsDialog 291 11 8 5
pl.edu.agh.cast.util.Messages 280 2 0 0
pl.edu.agh.cast.ui.dialogs.ProjectStartupDialog 269 7 8 7
pl.edu.agh.cast.model.visual.backward.Diagram 254 43 0 40
pl.edu.agh.cast.ui.dialogs.property.PropertiesEditorDialog 229 16 5 12
pl.edu.agh.cast.project.ProjectUtil 222 25 2 26
pl.edu.agh.cast.ui.dialogs.CreateProjectDialog 210 12 9 4
pl.edu.agh.cast.backward.editor.AbstractEditor 187 34 2 29
pl.edu.agh.cast.ui.dialogs.FindDialog 176 14 6 3
pl.edu.agh.cast.editor.AbstractEditor 164 33 2 33
pl.edu.agh.cast.model.visual.backward.ConnectionGroup 162 31 0 26
pl.edu.agh.cast.model.visual.backward.VisualModelCachingFactory 156 29 0 26
pl.edu.agh.cast.ui.dialogs.property.PropertiesEditorPresenter 151 19 0 12
pl.edu.agh.cast.resource.VisualResource 148 24 0 22
pl.edu.agh.cast.navigator.ui.NavigatorTreeView 144 15 6 16
pl.edu.agh.cast.ui.dialogs.GetNewNameDialog 140 11 6 4
pl.edu.agh.cast.model.visual.backward.Node 138 29 0 27
pl.edu.agh.cast.backward.editor.EditorUtilBackward 123 15 1 13
pl.edu.agh.cast.ui.dialogs.search.AdvancedSearchDialog 117 6 2 2
pl.edu.agh.cast.project.UserPreferences 112 12 1 9
pl.edu.agh.cast.backward.figure.LegendFigure 102 7 0 3
pl.edu.agh.cast.editor.EditorSaverSupportDialog 101 5 4 3
pl.edu.agh.cast.backward.editor.EditorSaverSupportDialog 101 5 4 3
pl.edu.agh.cast.ui.dialogs.property.PropertiesLabelProvider 97 9 0 7
pl.edu.agh.cast.model.visual.backward.ModelElement 88 21 0 17
pl.edu.agh.cast.ui.dialogs.search.DateFilterPanel 87 7 1 6
pl.edu.agh.cast.command.ModifyPresentationElementCommand 87 9 0 4
pl.edu.agh.cast.tool.LabelEditManager 86 8 1 3
pl.edu.agh.cast.editpart.LabelEditManager 86 8 1 3

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
pl.edu.agh.cast.model.visual.backward.Diagram 254 43 0 40
pl.edu.agh.cast.tool.OverviewRectangleTool 300 34 1 8
pl.edu.agh.cast.backward.editor.AbstractEditor 187 34 2 29
pl.edu.agh.cast.editor.AbstractEditor 164 33 2 33
pl.edu.agh.cast.model.visual.backward.ConnectionGroup 162 31 0 26
pl.edu.agh.cast.model.visual.backward.VisualModelCachingFactory 156 29 0 26
pl.edu.agh.cast.model.visual.backward.Node 138 29 0 27
pl.edu.agh.cast.model.visual.backward.IDiagram 28 27 0 28
pl.edu.agh.cast.project.ProjectUtil 222 25 2 26
pl.edu.agh.cast.data.persistence.AbstractPersistenceProviderDecorator 53 24 0 24
pl.edu.agh.cast.resource.VisualResource 148 24 0 22
pl.edu.agh.cast.model.attributes.Attribute 82 22 0 12
pl.edu.agh.cast.model.visual.backward.ModelElement 88 21 0 17
pl.edu.agh.cast.resource.VisualResourceEntry 66 21 0 2
pl.edu.agh.cast.ui.dialogs.property.PropertyTreeEntry 76 20 2 12
pl.edu.agh.cast.data.persistence.IPersistenceProvider 21 20 0 21
pl.edu.agh.cast.ui.dialogs.property.PropertiesEditorPresenter 151 19 0 12
pl.edu.agh.cast.model.visual.backward.Statistic 64 19 0 20
pl.edu.agh.cast.model.attributes.AttributeManager 65 17 0 16
pl.edu.agh.cast.CastApplication 66 17 0 12
pl.edu.agh.cast.ui.dialogs.property.PropertiesEditorDialog 229 16 5 12
pl.edu.agh.cast.data.persistence.AbstractPersistenceProvider 74 16 0 15
pl.edu.agh.cast.ui.outline.OutlineMiniatureView 44 15 0 16
pl.edu.agh.cast.navigator.ui.NavigatorTreeView 144 15 6 16
pl.edu.agh.cast.backward.editor.EditorUtilBackward 123 15 1 13
pl.edu.agh.cast.ui.outline.OutlineTreeView 44 14 0 9
pl.edu.agh.cast.ui.dialogs.FindDialog 176 14 6 3
pl.edu.agh.cast.model.visual.backward.DiagramSettings 45 14 0 13
pl.edu.agh.cast.editpart.LegendEditPart 54 14 0 14
pl.edu.agh.cast.ui.util.MsgBoxHelper 38 13 0 13

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
29.98 12,843.00 0.30 5.10 4.49

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
pl.edu.agh.cast.ui.dialogs.property.PropertiesEditorDialog.createUI() 151 3 0
pl.edu.agh.cast.ui.dialogs.ProjectStartupDialog.open() 145 4 1
pl.edu.agh.cast.ui.dialogs.CreateProjectDialog.open(String) 107 5 1
pl.edu.agh.cast.ui.dialogs.FindDialog.open() 103 4 1
pl.edu.agh.cast.ui.dialogs.StatisticsDialog.open() 85 4 1
pl.edu.agh.cast.ui.dialogs.GetNewNameDialog.open(String) 82 4 1
pl.edu.agh.cast.editor.EditorSaverSupportDialog.open() 78 5 1
pl.edu.agh.cast.backward.editor.EditorSaverSupportDialog.open() 78 5 1
pl.edu.agh.cast.tool.OverviewRectangleTool.handleDragInProgress() 62 25 0
pl.edu.agh.cast.ui.dialogs.search.AdvancedSearchDialog.open() 58 4 0
pl.edu.agh.cast.ui.dialogs.CreateProjectDialog.inputTextModifyText(ModifyEvent) 46 15 0
pl.edu.agh.cast.model.visual.backward.Diagram.addAttributesFromEntities(IEntity,String,AttributeMergePolicy,String,String,String,IProgressMonitor) 45 20 1
pl.edu.agh.cast.ui.dialogs.ProjectStartupDialog.ProjectNameLocationCellLabelProvider.update(ViewerCell) 43 2 0
pl.edu.agh.cast.ui.wizards.SelectRootNumbersWizardPage.createControl(Composite) 43 1 0
pl.edu.agh.cast.navigator.ui.NavigatorProjectInfo.NavigatorProjectInfo(Composite) 43 1 1
pl.edu.agh.cast.ui.dialogs.search.DateFilterPanel.initGUI() 41 2 0
pl.edu.agh.cast.ui.dialogs.search.NumericFilterPanel.initGUI() 41 2 0
pl.edu.agh.cast.util.Messages.getByKey(String) 39 26 0
pl.edu.agh.cast.ui.dialogs.StatisticsDialog.fillStatistics() 33 3 0
pl.edu.agh.cast.ui.dialogs.property.PropertiesLabelProvider.getBackground(Object,int) 33 10 1
pl.edu.agh.cast.backward.figure.LegendFigure.addColoredLineFigure(HexColor) 32 2 0
pl.edu.agh.cast.ui.dialogs.StatisticsDialog.attachSortListeners() 30 1 0
pl.edu.agh.cast.ui.advisor.ApplicationWorkbenchAdvisor.loadActiveProject() 28 11 0
pl.edu.agh.cast.project.ProjectUtil.tryOpenRecentProject(MostRecentlyUsedProject) 28 13 1
pl.edu.agh.cast.util.Configuration.getBaseUrl(String) 28 3 1
pl.edu.agh.cast.ui.dialogs.StatisticsDialog.attachLabelProvider() 27 1 0
pl.edu.agh.cast.navigator.ui.NavigatorTreeView.fillContextMenu(IMenuManager) 27 5 1
pl.edu.agh.cast.editor.ExtendedMouseWheelZoomHandler.handleMouseWheel(Event,EditPartViewer) 27 9 1
pl.edu.agh.cast.backward.editor.operation.SelectMediatorsOperation.execute() 27 14 1
pl.edu.agh.cast.project.UserPreferences.changeMostRecentlyProjectName(IProject,String) 26 5 1

Averages.

Program NCSS NCSS average CCN average Javadocs average
12,843.00 4.96 1.90 0.72

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