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
org.springframework.richclient.application.support 30 305 1792 126 764 48 465
org.springframework.richclient.command 37 399 1666 272 1690 42 596
org.springframework.richclient.dialog 19 337 1534 168 974 12 296
org.springframework.richclient.util 16 123 1243 67 523 92 315
org.springframework.binding.form.support 14 186 1074 69 488 27 258
org.springframework.richclient.table 19 174 1022 75 406 48 309
org.springframework.richclient.form.binding.swing 23 169 974 50 421 8 360
org.springframework.rules.constraint 29 270 902 102 575 0 450
org.springframework.richclient.command.support 22 179 900 91 405 16 306
org.springframework.richclient.list 22 132 861 78 419 58 333
org.springframework.binding.validation.support 7 105 689 40 238 8 98
org.springframework.richclient.layout 4 97 672 60 462 15 71
org.springframework.richclient.application 26 133 640 73 561 14 408
org.springframework.rules.reporting 18 125 633 34 155 1 248
org.springframework.richclient.form 9 154 621 70 443 7 158
org.springframework.richclient.text 10 54 590 33 180 12 159
org.springframework.richclient.form.builder.support 15 56 500 26 195 18 211
org.springframework.richclient.application.config 9 102 488 66 576 7 157
org.springframework.richclient.security 17 79 480 71 543 40 688
org.springframework.richclient.control 8 60 465 33 229 9 148
org.springframework.richclient.command.config 13 87 443 78 504 11 205
org.springframework.richclient.factory 10 135 440 94 556 1 122
org.springframework.richclient.image 14 74 429 39 361 9 248
org.springframework.richclient.wizard 8 107 365 75 489 7 121
org.springframework.richclient.form.binding.support 6 62 344 20 144 9 96
org.springframework.rules.factory 3 128 323 64 466 0 48
org.springframework.richclient.core 12 66 307 24 131 4 205
org.springframework.rules.constraint.property 12 77 288 33 250 0 149
org.springframework.richclient.security.support 4 44 278 45 374 28 64
org.springframework.richclient.tree 6 38 274 14 122 34 84
org.springframework.richclient.form.builder 5 62 229 65 556 0 75
org.springframework.richclient.filechooser 4 31 222 18 138 0 60
org.springframework.richclient.application.statusbar.support 2 29 206 11 88 1 31
org.springframework.richclient.application.setup 4 27 195 10 39 3 15
org.springframework.richclient.table.renderer 9 32 183 9 52 7 135
org.springframework.richclient.dialog.control 3 37 181 3 24 3 45
org.springframework.richclient.form.binding.swing.date 8 34 181 6 31 1 60
org.springframework.richclient.application.splash 5 32 180 34 224 1 78
org.springframework.binding.value.swing 6 27 175 4 22 15 90
org.springframework.richclient.progress 6 39 135 18 116 2 90
org.springframework.rules 3 29 115 11 78 0 49
org.springframework.richclient.convert.support 3 14 82 3 17 0 45
org.springframework.rules.closure 7 15 80 17 123 0 108
org.springframework.rules.support 2 11 67 4 25 1 30
org.springframework.richclient.security.remoting 3 9 66 11 133 6 34
org.springframework.richclient.dialog.support 1 6 60 11 97 0 22
org.springframework.richclient.exceptionhandling 3 7 49 6 35 1 7
org.springframework.richclient.form.binding 5 15 36 20 101 0 75
org.springframework.richclient.application.event 1 5 21 1 5 0 7
org.springframework.richclient.application.statusbar 1 8 13 9 60 0 15
org.springframework.richclient.image.config 2 2 8 2 6 0 30
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
525 4528 23721 2363 15614 626 8477

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
org.springframework.richclient.layout.TableLayoutBuilder 360 50 1 29
org.springframework.binding.form.support.AbstractFormModel 354 66 4 28
org.springframework.richclient.application.support.DefaultApplicationServices 341 63 28 65
org.springframework.richclient.util.BrowserLauncher 315 8 1 6
org.springframework.richclient.form.AbstractForm 303 77 6 27
org.springframework.richclient.command.AbstractCommand 289 78 4 81
org.springframework.richclient.dialog.ApplicationDialog 271 72 3 74
org.springframework.richclient.command.CommandGroup 259 77 0 17
org.springframework.richclient.layout.GridBagLayoutBuilder 256 45 1 29
org.springframework.richclient.text.TextComponentPopup 251 26 9 7
org.springframework.richclient.factory.DefaultComponentFactory 228 65 2 21
org.springframework.rules.factory.Constraints 222 106 0 62
org.springframework.binding.validation.support.DefaultValidationResultsModel 214 38 2 13
org.springframework.richclient.util.OverlayHelper 194 12 4 3
org.springframework.binding.form.support.DefaultFormModel 180 37 2 7
org.springframework.rules.constraint.ConstraintsAccessor 179 89 0 9
org.springframework.richclient.table.ShuttleSortableTableModel 179 26 1 2
org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer 178 26 0 23
org.springframework.richclient.application.support.AbstractApplicationWindow 163 37 1 9
org.springframework.binding.validation.support.ValangRichValidator 161 13 3 2
org.springframework.richclient.table.BaseTableModel 157 33 0 34
org.springframework.richclient.application.support.DefaultPropertyEditorRegistry 147 10 8 4
org.springframework.richclient.application.support.AbstractApplicationPage 136 33 2 11
org.springframework.richclient.application.DefaultConversionServiceFactoryBean 135 8 6 2
org.springframework.richclient.command.config.CommandFaceDescriptor 134 32 0 33
org.springframework.richclient.list.ComboBoxAutoCompletion 128 9 1 4
org.springframework.richclient.application.support.AboutBox 127 4 2 11
org.springframework.richclient.dialog.TreeCompositeDialogPage 126 21 2 15
org.springframework.richclient.command.CommandGroupFactoryBean 126 28 0 29
org.springframework.richclient.control.SimpleInternalFrame 123 21 2 21

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
org.springframework.rules.factory.Constraints 222 106 0 62
org.springframework.rules.constraint.ConstraintsAccessor 179 89 0 9
org.springframework.richclient.command.AbstractCommand 289 78 4 81
org.springframework.richclient.form.AbstractForm 303 77 6 27
org.springframework.richclient.command.CommandGroup 259 77 0 17
org.springframework.richclient.dialog.ApplicationDialog 271 72 3 74
org.springframework.binding.form.support.AbstractFormModel 354 66 4 28
org.springframework.richclient.factory.DefaultComponentFactory 228 65 2 21
org.springframework.richclient.application.support.DefaultApplicationServices 341 63 28 65
org.springframework.richclient.layout.TableLayoutBuilder 360 50 1 29
org.springframework.richclient.layout.GridBagLayoutBuilder 256 45 1 29
org.springframework.richclient.factory.ComponentFactory 40 39 0 40
org.springframework.richclient.command.support.DefaultCommandManager 116 39 0 6
org.springframework.binding.validation.support.DefaultValidationResultsModel 214 38 2 13
org.springframework.binding.form.support.DefaultFormModel 180 37 2 7
org.springframework.richclient.application.support.AbstractApplicationWindow 163 37 1 9
org.springframework.richclient.application.support.AbstractApplicationPage 136 33 2 11
org.springframework.richclient.table.BaseTableModel 157 33 0 34
org.springframework.richclient.command.config.CommandFaceDescriptor 134 32 0 33
org.springframework.richclient.wizard.AbstractWizard 98 31 0 32
org.springframework.richclient.form.builder.TableFormBuilder 86 28 0 29
org.springframework.richclient.command.CommandGroupFactoryBean 126 28 0 29
org.springframework.richclient.core.LabeledObjectSupport 102 27 0 1
org.springframework.richclient.application.support.AbstractView 54 26 0 1
org.springframework.richclient.application.config.DefaultApplicationObjectConfigurer 178 26 0 23
org.springframework.richclient.command.ToggleCommand 95 26 0 8
org.springframework.richclient.table.ShuttleSortableTableModel 179 26 1 2
org.springframework.richclient.text.TextComponentPopup 251 26 9 7
org.springframework.rules.reporting.DefaultMessageTranslator 112 25 0 3
org.springframework.richclient.dialog.InputApplicationDialog 100 25 1 2

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
37.41 23,721.00 0.44 8.62 4.50

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
org.springframework.richclient.util.BrowserLauncher.loadClasses() 90 37 1
org.springframework.richclient.util.BrowserLauncher.locateBrowser() 76 34 1
org.springframework.richclient.util.BrowserLauncher.openURL(URL) 74 2 1
org.springframework.richclient.util.BrowserLauncher.Runnable$1.run() 68 32 0
org.springframework.richclient.util.OverlayHelper.positionOverlay(JLayeredPane) 57 24 0
org.springframework.richclient.layout.TableLayoutBuilder.fillInGaps() 42 10 0
org.springframework.richclient.util.SpringLayoutUtils.makeGrid(Container,int,int,int,int,int,int) 38 8 1
org.springframework.richclient.table.TableSortIndicator.TableHeaderClickHandler.mouseClicked(MouseEvent) 38 13 0
org.springframework.richclient.text.TextComponentPopup.DefaultKeymap.getKeyStrokesForAction(Action) 38 18 0
org.springframework.richclient.table.ShuttleSortableTableModel.tableChanged(TableModelEvent) 35 9 0
org.springframework.richclient.layout.TableLayoutBuilder.getAttributes(String) 34 20 0
org.springframework.richclient.command.config.CommandButtonLabelInfo.valueOf(String) 32 12 1
org.springframework.richclient.security.LoginCommand.doExecuteCommand() 32 2 1
org.springframework.richclient.dialog.TabbedDialogPage.createControl() 31 2 0
org.springframework.richclient.command.CommandGroupFactoryBean.initCommandGroupMembers(CommandGroup) 31 13 1
org.springframework.richclient.list.ComboBoxAutoCompletion.insertString(int,String,AttributeSet) 30 15 1
org.springframework.binding.validation.support.RulesValidator.validate(Object,String) 29 13 1
org.springframework.richclient.util.SpringLayoutUtils.makeCompactGrid(Container,int,int,int,int,int,int) 29 9 1
org.springframework.richclient.text.TimeFormat.TimeFormat$2.format(long) 29 8 0
org.springframework.binding.form.support.AbstractFormModel.childStateChanged(PropertyChangeEvent) 26 8 1
org.springframework.binding.form.support.AbstractFormModel.createConvertingValueModel(String,Class) 25 9 0
org.springframework.richclient.util.GridBagLayoutDebugPanel.paintGrid(Graphics) 25 7 0
org.springframework.richclient.layout.GridBagLayoutBuilder.appendLabeledField(JLabel,JComponent,LabelOrientation,int,int,boolean,boolean) 25 6 1
org.springframework.richclient.layout.GridBagLayoutBuilder.getDebugString(Component,GridBagConstraints) 25 5 0
org.springframework.richclient.control.ShadowBorder.paintBorder(Component,Graphics,int,int,int,int) 24 2 0
org.springframework.richclient.tree.BeanTreeCellRenderer.getTreeCellRendererComponent(JTree,Object,boolean,boolean,boolean,int,boolean) 24 10 1
org.springframework.richclient.form.binding.support.AbstractBinderSelectionStrategy.setBinderForPropertyName(Properties) 23 10 1
org.springframework.richclient.util.SeparatorUtils.consolidateSeparators(Component[]) 23 11 0
org.springframework.richclient.util.SeparatorUtils.consolidateSeparators(JMenu) 23 11 1
org.springframework.richclient.image.Handler.openConnection(URL) 23 16 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
23,721.00 3.55 1.60 0.37

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