aws-samples / aws-saas-factory-bootcamp
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 140 units with 2,942 lines of code in units (25.9% of code).
    • 3 very long units (620 lines of code)
    • 4 long units (328 lines of code)
    • 40 medium size units (1,176 lines of code)
    • 37 small units (538 lines of code)
    • 56 very small units (280 lines of code)
21% | 11% | 39% | 18% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js21% | 11% | 39% | 18% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/web-client40% | 0% | 29% | 14% | 15%
source/user-manager19% | 18% | 40% | 17% | 4%
source/shared-modules0% | 13% | 45% | 30% | 10%
source/tenant-registration0% | 0% | 100% | 0% | 0%
source/auth-manager0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
module.exports = function()
in source/web-client/Gruntfile.js
364 2 1
module.exports.createUserPool = function()
in source/user-manager/cognito-user.js
129 2 1
lookupUserPoolData()
in source/user-manager/server.js
127 2 6
function getSystemUserPolicy()
in source/user-manager/cognito-user.js
96 1 1
module.exports.configure = function()
in source/shared-modules/config-helper/config.js
80 11 1
function getTenantAdminPolicy()
in source/user-manager/cognito-user.js
80 1 1
function getTenantUserPolicy()
in source/user-manager/cognito-user.js
72 1 1
function getSystemAdminPolicy()
in source/user-manager/cognito-user.js
47 1 1
module.exports.createUser = function()
in source/user-manager/cognito-user.js
44 2 3
module.exports.createUserPoolClient = function()
in source/user-manager/cognito-user.js
44 2 1
module.exports.addRoleToIdentity = function()
in source/user-manager/cognito-user.js
44 2 1
function lookupUserPoolData()
in source/user-manager/server.js
42 5 5
$scope.saveOrder = function()
in source/web-client/app/scripts/controllers/order-edit.js
41 3 0
module.exports.getUsersFromPool = function()
in source/user-manager/cognito-user.js
37 2 3
module.exports.updateUser = function()
in source/user-manager/cognito-user.js
37 2 4
$scope.formSubmit = function()
in source/web-client/app/scripts/controllers/confirm.js
36 6 0
function saveTenantData()
in source/tenant-registration/server.js
35 3 1
$scope.formSubmit = function()
in source/web-client/app/scripts/controllers/login.js
34 2 0
module.exports.updateUserEnabledStatus = function()
in source/user-manager/cognito-user.js
33 4 4
lookupUserPoolData()
in source/user-manager/server.js
32 3 6