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
gboat2.web.action 22 335 2631 86 431 286 113
gboat2.web.business.impl 20 171 1801 53 349 182 119
gboat2.web.model 39 373 1192 35 240 80 190
gboat2.web.service.impl 15 73 752 26 138 40 87
gboat2.web.business 20 138 260 143 892 14 104
gboat2.web.service 15 75 174 77 442 1 43
gboat2.web.util 6 26 165 16 90 34 24
gboat2.web.validators 3 6 86 3 24 16 12
gboat2.web.exception 6 24 69 3 17 8 32
gboat2.web 2 2 47 4 22 18 32
gboat2.web.validate 2 4 30 2 14 1 8
Classes total Methods total NCSS total Javadocs Javadoc lines Single lines comment Multi lines comment
150 1227 7207 448 2659 680 764

Objects

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

TOP 30 classes containing the most NCSS.

Object NCSS Methods Classes Javadocs
gboat2.web.business.impl.AuthorityBusinessImpl 466 52 0 23
gboat2.web.action.LoginAction 334 44 0 16
gboat2.web.action.UserAction 316 55 0 13
gboat2.web.action.GroupAction 207 32 0 7
gboat2.web.action.GIndexAction 201 31 0 4
gboat2.web.service.impl.SessionServiceImpl 199 14 0 4
gboat2.web.business.impl.ResourceBusinessImpl 196 20 0 4
gboat2.web.action.ResourceAction 174 34 0 11
gboat2.web.action.MetadataAction 134 28 0 1
gboat2.web.business.impl.UserBusinessImpl 121 16 0 1
gboat2.web.action.RoleAction 107 19 0 7
gboat2.web.service.impl.UserServiceImpl 104 17 0 3
gboat2.web.action.AuthorityAction 103 18 0 5
gboat2.web.action.ShortcutAction 97 12 0 3
gboat2.web.business.impl.ShortcutBusinessImpl 95 9 0 1
gboat2.web.business.impl.LoginBusinessImpl 90 11 0 5
gboat2.web.model.Resource 90 35 0 1
gboat2.web.business.impl.SystemConfigBusinessImpl 77 9 0 1
gboat2.web.business.impl.DataLevelAuthorityBusinessImpl 74 11 0 2
gboat2.web.action.PreferenceAction 71 5 0 5
gboat2.web.action.WidgetAuthorityConfigAction 70 12 0 3
gboat2.web.service.impl.ResourceOperationProvider 63 4 0 1
gboat2.web.model.User 61 24 0 1
gboat2.web.action.PropertyAction 59 8 0 1
gboat2.web.business.impl.GroupBusinessImpl 59 5 0 1
gboat2.web.action.SystemConfigAction 57 6 0 1
gboat2.web.business.impl.GroupRoleBusinessImpl 52 8 0 1
gboat2.web.action.ProfileAction 47 7 0 1
gboat2.web.action.WidgetAction 46 6 0 1
gboat2.web.model.UserGroupOrganMapper 46 18 0 1

TOP 30 classes containing the most methods.

Object NCSS Methods Classes Javadocs
gboat2.web.action.UserAction 316 55 0 13
gboat2.web.business.impl.AuthorityBusinessImpl 466 52 0 23
gboat2.web.action.LoginAction 334 44 0 16
gboat2.web.model.Resource 90 35 0 1
gboat2.web.action.ResourceAction 174 34 0 11
gboat2.web.action.GroupAction 207 32 0 7
gboat2.web.action.GIndexAction 201 31 0 4
gboat2.web.business.IAuthorityBusiness 30 29 0 30
gboat2.web.action.MetadataAction 134 28 0 1
gboat2.web.model.User 61 24 0 1
gboat2.web.business.impl.ResourceBusinessImpl 196 20 0 4
gboat2.web.action.RoleAction 107 19 0 7
gboat2.web.action.AuthorityAction 103 18 0 5
gboat2.web.model.UserGroupOrganMapper 46 18 0 1
gboat2.web.service.impl.UserServiceImpl 104 17 0 3
gboat2.web.business.impl.UserBusinessImpl 121 16 0 1
gboat2.web.business.IUserBusiness 17 16 0 17
gboat2.web.model.OrganDefine 41 16 0 1
gboat2.web.model.SystemConfig 41 16 0 1
gboat2.web.service.IUserService 17 16 0 17
gboat2.web.business.IResourceBusiness 15 14 0 12
gboat2.web.model.AuthorityShortcutResourceVO 36 14 0 1
gboat2.web.model.PreferenceConfig 36 14 0 1
gboat2.web.model.Shortcut 36 14 0 1
gboat2.web.service.impl.SessionServiceImpl 199 14 0 4
gboat2.web.action.ShortcutAction 97 12 0 3
gboat2.web.action.WidgetAuthorityConfigAction 70 12 0 3
gboat2.web.model.Authority 31 12 0 1
gboat2.web.model.DataLevelAuthority 31 12 0 1
gboat2.web.model.Profile 31 12 0 1

Averages.

NCSS average Program NCSS Classes average Methods average Javadocs average
38.23 7,207.00 0.00 8.18 2.99

Methods

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

TOP 30 Methods containing the most NCSS.

Methods NCSS CCN Javadocs
gboat2.web.action.GIndexAction.initUserInfo() 51 16 1
gboat2.web.action.GroupAction.findInfoOfGroup() 46 14 1
gboat2.web.service.impl.SessionServiceImpl.login(User,UserGroupOrganMapper) 46 10 0
gboat2.web.action.LoginAction.login() 44 13 1
gboat2.web.action.UserAction.saveUser() 37 3 1
gboat2.web.action.AuthorityAction.authorityLog(boolean,String,String,String) 35 9 1
gboat2.web.action.PreferenceAction.preferences() 35 7 0
gboat2.web.action.PropertyAction.view() 35 7 0
gboat2.web.service.impl.UserServiceImpl.addUser(User,String,String,String,String) 35 10 0
gboat2.web.service.impl.SessionServiceImpl.login(User,UserGroupOrganMapper,String) 33 4 0
gboat2.web.business.impl.ShortcutBusinessImpl.getSuperTree(URL) 30 12 0
gboat2.web.action.GroupAction.groupAuthority() 29 6 0
gboat2.web.action.ProfileAction.saveOrUpdateProfile() 29 8 0
gboat2.web.action.UserAction.initEditUserAuth() 28 4 1
gboat2.web.business.impl.ResourceBusinessImpl.getAnnotatedResources(String,String,String) 27 6 0
gboat2.web.action.OrganDefineAction.showService() 26 10 0
gboat2.web.service.impl.ResourceOperationProvider.getOperations(BaseActionSupport) 26 13 0
gboat2.web.action.SystemConfigAction.systemsOfUser() 25 10 0
gboat2.web.business.impl.AuthorityBusinessImpl.findResourceTreeForRoleOfGroupForRes(String,String,boolean) 25 6 0
gboat2.web.validators.NomalUserValidator.validate(String) 25 17 0
gboat2.web.action.ShortcutAction.menuTree() 24 7 1
gboat2.web.business.impl.SystemConfigBusinessImpl.findThemeCfg() 24 10 0
gboat2.web.action.WidgetAction.widgetsMeta() 23 9 0
gboat2.web.business.impl.AuthorityBusinessImpl.cascadeSetAuthAtFirstDel(String,String,String) 23 8 1
gboat2.web.service.impl.MetadataEditSystemButtonProviderImpl.getSystemButtons(BaseActionSupport,String) 23 3 1
gboat2.web.service.impl.SessionServiceImpl.buildPriority(String,Group,String,String) 23 9 1
gboat2.web.action.UserAction.userExist() 22 5 1
gboat2.web.action.WidgetAuthorityConfigAction.postList(Page) 22 6 1
gboat2.web.business.impl.DataLevelBusinessImpl.initDataLevels() 22 1 1
gboat2.web.action.MetadataAction.design() 21 6 0

Averages.

Program NCSS NCSS average CCN average Javadocs average
7,207.00 4.14 1.69 0.25

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