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.

PackageClassesMethodsNCSSJavadocsJavadoc linesSingle lines commentMulti lines comment
org.directdemocracyportal.democracy.web.views14468386030311060
org.directdemocracyportal.democracy.service.governmentloader1153697583273581
org.directdemocracyportal.democracy.service798541583591266
org.directdemocracyportal.democracy.model.world1681410924610135
org.directdemocracyportal.democracy.model.application127431279394097
org.directdemocracyportal.democracy.model.core65529051254079
org.directdemocracyportal.democracy.web.controller22328024122616
org.directdemocracyportal.democracy.service.dao.hibernate133727226831170
org.directdemocracyportal.democracy.web.views.dialogs1125270241201634
org.directdemocracyportal.democracy.web6913213620113
org.directdemocracyportal.democracy.web.action1915102341330101
org.directdemocracyportal.democracy.service.dao13248737193155
org.directdemocracyportal.democracy.web.views.header226541488
org.directdemocracyportal.democracy.web.actionlistener2459422021
org.directdemocracyportal.democracy.service.command21439168308
org.directdemocracyportal.democracy.web.main11132814
org.directdemocracyportal.democracy.web.views.comparator11713010
Classes totalMethods totalNCSS totalJavadocsJavadoc linesSingle lines commentMulti lines comment
138562441458329411791258

Objects

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

TOP 30 classes containing the most NCSS.

ObjectNCSSMethodsClassesJavadocs
org.directdemocracyportal.democracy.service.PortalServiceImpl2984102
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentImporterImpl29015225
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentDocumentImporterImpl20312217
org.directdemocracyportal.democracy.web.controller.FrontController20022022
org.directdemocracyportal.democracy.web.views.OrganisationOverviewPanel13110011
org.directdemocracyportal.democracy.web.views.UserProfilePanel119708
org.directdemocracyportal.democracy.model.world.Organisation10720121
org.directdemocracyportal.democracy.service.governmentloader.SwedishParliamentOrganisationStructureImporterImpl1063112
org.directdemocracyportal.democracy.web.views.GovernmentOverviewPanel99809
org.directdemocracyportal.democracy.web.views.dialogs.RegisterUserDialog89829
org.directdemocracyportal.democracy.service.UserServiceImpl851004
org.directdemocracyportal.democracy.web.views.OnlinePoliticalPartyOverviewPanel84708
org.directdemocracyportal.democracy.model.application.User7728029
org.directdemocracyportal.democracy.model.core.Role7415013
org.directdemocracyportal.democracy.web.ApplicationMessageHolder66113
org.directdemocracyportal.democracy.web.views.dialogs.CreatePartyDialog58425
org.directdemocracyportal.democracy.web.ApplicationMessageHolder.MessageConstans57000
org.directdemocracyportal.democracy.model.core.Agent5112010
org.directdemocracyportal.democracy.web.views.ExplorerPanel49102
org.directdemocracyportal.democracy.model.core.Environment44907
org.directdemocracyportal.democracy.service.governmentloader.SwedishParliamentOrganisationStructureImporterImpl.OrgStructureAnswerPage44808
org.directdemocracyportal.democracy.web.views.dialogs.LoginDialog44324
org.directdemocracyportal.democracy.service.PortalService4140041
org.directdemocracyportal.democracy.model.application.UserSession3914014
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentImporterImpl.ActivePoliticalParty35402
org.directdemocracyportal.democracy.model.core.GroupAgent2910011
org.directdemocracyportal.democracy.web.actionlistener.ApplicationActionListener29202
org.directdemocracyportal.democracy.model.world.Resolution289110
org.directdemocracyportal.democracy.model.application.Event2710010
org.directdemocracyportal.democracy.model.world.VoteResult279010

TOP 30 classes containing the most methods.

ObjectNCSSMethodsClassesJavadocs
org.directdemocracyportal.democracy.service.PortalServiceImpl2984102
org.directdemocracyportal.democracy.service.PortalService4140041
org.directdemocracyportal.democracy.model.application.User7728029
org.directdemocracyportal.democracy.web.controller.FrontController20022022
org.directdemocracyportal.democracy.model.world.Organisation10720121
org.directdemocracyportal.democracy.model.core.Role7415013
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentImporterImpl29015225
org.directdemocracyportal.democracy.model.application.UserSession3914014
org.directdemocracyportal.democracy.model.core.Agent5112010
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentDocumentImporterImpl20312217
org.directdemocracyportal.democracy.model.core.GroupAgent2910011
org.directdemocracyportal.democracy.model.application.Event2710010
org.directdemocracyportal.democracy.service.UserServiceImpl851004
org.directdemocracyportal.democracy.service.command.RegisterCommand2610011
org.directdemocracyportal.democracy.web.views.OrganisationOverviewPanel13110011
org.directdemocracyportal.democracy.model.core.Environment44907
org.directdemocracyportal.democracy.model.world.VoteResult279010
org.directdemocracyportal.democracy.model.world.Resolution289110
org.directdemocracyportal.democracy.model.world.Election23909
org.directdemocracyportal.democracy.service.governmentloader.SwedishParliamentOrganisationStructureImporterImpl.OrgStructureAnswerPage44808
org.directdemocracyportal.democracy.web.views.GovernmentOverviewPanel99809
org.directdemocracyportal.democracy.web.views.dialogs.RegisterUserDialog89829
org.directdemocracyportal.democracy.model.core.Resource18707
org.directdemocracyportal.democracy.model.world.Region18708
org.directdemocracyportal.democracy.service.UserService8708
org.directdemocracyportal.democracy.web.views.OnlinePoliticalPartyOverviewPanel84708
org.directdemocracyportal.democracy.web.views.UserProfilePanel119708
org.directdemocracyportal.democracy.model.application.Authority15606
org.directdemocracyportal.democracy.model.world.Vote18617
org.directdemocracyportal.democracy.model.world.Government19617

Averages.

NCSS averageProgram NCSSClasses averageMethods averageJavadocs average
25.734,414.000.124.074.36

Methods

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

TOP 30 Methods containing the most NCSS.

MethodsNCSSCCNJavadocs
org.directdemocracyportal.democracy.web.controller.FrontController.handleAction(ControllerAction)50180
org.directdemocracyportal.democracy.web.views.dialogs.RegisterUserDialog.RegisterUserDialog(Portal)5011
org.directdemocracyportal.democracy.web.views.ExplorerPanel.ExplorerPanel()4811
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentDocumentImporterImpl.importVoteResult(Issue,Resolution)42101
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentDocumentImporterImpl.ImportAllResulotions()41201
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentImporterImpl.doImport()39110
org.directdemocracyportal.democracy.service.PortalServiceImpl.createGovernment(String,Long,GovernmentType,String)3810
org.directdemocracyportal.democracy.service.PortalServiceImpl.createOrganisation(String,String,Country,Region,OrganisationType,Organisation)3450
org.directdemocracyportal.democracy.service.PortalServiceImpl.createRegionalGovernment(String,Country,Region,OrganisationType,Government)3410
org.directdemocracyportal.democracy.model.core.Role.equals(Object)33270
org.directdemocracyportal.democracy.service.governmentloader.SwedishParliamentOrganisationStructureImporterImpl.createOrganisationWithMembers(String,String,String,Long)33121
org.directdemocracyportal.democracy.service.UserServiceImpl.register(RegisterCommand,String)3390
org.directdemocracyportal.democracy.web.views.dialogs.CreatePartyDialog.CreatePartyDialog(Country)2911
org.directdemocracyportal.democracy.web.views.dialogs.LoginDialog.LoginDialog()2811
org.directdemocracyportal.democracy.web.controller.FrontController.createMenu()2721
org.directdemocracyportal.democracy.model.world.Organisation.getActivePoliticalParties()26121
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentImporterImpl.importRegionalGovernment(HtmlAnchor,Government,Country)2621
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentImporterImpl.ImportMunicipal(HtmlAnchor,Government,Country,Region)2621
org.directdemocracyportal.democracy.web.views.UserProfilePanel.getInformationGridBox(User)2611
org.directdemocracyportal.democracy.web.views.OrganisationOverviewPanel.getMemberGridBox(Organisation)2441
org.directdemocracyportal.democracy.web.views.GovernmentsPanel.GovernmentsPanel(Government)2421
org.directdemocracyportal.democracy.service.governmentloader.SwedishParliamentOrganisationStructureImporterImpl.OrgStructureAnswerPage.OrgStructureAnswerPage(HtmlTable,String,String)2381
org.directdemocracyportal.democracy.web.actionlistener.ApplicationActionListener.actionPerformed(ActionEvent)2390
org.directdemocracyportal.democracy.web.views.UserProfilePanel.createMemberTabSheet(User)2311
org.directdemocracyportal.democracy.web.views.UserProfilePanel.getRoleGridBox(User)2351
org.directdemocracyportal.democracy.service.governmentloader.SwedishParliamentOrganisationStructureImporterImpl.doImport()2220
org.directdemocracyportal.democracy.web.views.header.UserPanel.UserPanel(User)2211
org.directdemocracyportal.democracy.model.core.Environment.equals(Object)21170
org.directdemocracyportal.democracy.model.core.Agent.equals(Object)21170
org.directdemocracyportal.democracy.service.governmentloader.SwedishGovernmentImporterImpl.ActivePoliticalParty.equals(Object)21170

Averages.

Program NCSSNCSS averageCCN averageJavadocs average
4,414.005.171.640.81

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 declarationpackage java.lang;
Import declarationimport java.awt.*;
Class declaration
  • public class Foo {
  • public class Foo extends Bla {
Interface declarationpublic interface Able ; {
Field declaration
  • int a;
  • int a, b, c = 5, d = 6;
Method declaration
  • public void cry();
  • public void gib() throws DeadException {
Constructor declarationpublic Foo() {
Constructor invocation
  • this();
  • super();
Statement declaration
  • i = 0;
  • if (ok)
  • if (exit) {
  • if (3 == 4);
  • if (4 == 4) { ;
  • } else {
Label declarationfine :

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