aws-samples / service-screener
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 546 units with 7,543 lines of code in units (52.7% of code).
    • 5 very long units (637 lines of code)
    • 13 long units (803 lines of code)
    • 83 medium size units (2,473 lines of code)
    • 136 small units (1,954 lines of code)
    • 309 very small units (1,676 lines of code)
8% | 10% | 32% | 25% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js10% | 12% | 28% | 24% | 23%
php6% | 8% | 37% | 27% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
adminlte/html10% | 12% | 28% | 24% | 23%
services15% | 0% | 32% | 34% | 17%
services/ec210% | 6% | 34% | 27% | 21%
ROOT0% | 60% | 21% | 15% | 1%
tools0% | 15% | 30% | 35% | 19%
services/dashboard0% | 32% | 55% | 9% | 2%
services/rds0% | 0% | 54% | 14% | 31%
services/iam0% | 0% | 47% | 19% | 32%
services/s30% | 0% | 34% | 40% | 24%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Defaults.prototype.apply = function()
in adminlte/html/plugins/select2/js/select2.full.js
164 33 1
Results.prototype.bind = function()
in adminlte/html/plugins/select2/js/select2.full.js
142 22 2
function addSummaryControl_default()
in services/pageBuilder.class.php
113 8 0
x: $()
in adminlte/html/plugins/select2/js/select2.full.js
111 19 1
function advise()
in services/ec2/ec2.class.php
107 22 0
function handler()
in adminlte/html/plugins/select2/js/select2.full.js
77 28 1
Options.prototype.fromElement = function()
in adminlte/html/plugins/select2/js/select2.full.js
69 22 1
function normalize()
in adminlte/html/plugins/select2/js/select2.full.js
68 32 2
Search.prototype.bind = function()
in adminlte/html/plugins/select2/js/select2.full.js
68 7 3
Select2.prototype._registerEvents = function()
in adminlte/html/plugins/select2/js/select2.full.js
65 16 0
function __checkLowEBSLowUtilization()
in services/ec2/drivers/ec2_ebs.class.php
64 10 0
function getSummary()
in tools/reporter.class.php
63 16 0
AttachBody.prototype._positionDropdown = function()
in adminlte/html/plugins/select2/js/select2.full.js
63 16 0
Results.prototype.option = function()
in adminlte/html/plugins/select2/js/select2.full.js
57 14 1
function buildContentSummary_dashboard()
in services/dashboard/dashboard.pageBuilder.php
54 9 0
52 8 1
Search.prototype.bind = function()
in adminlte/html/plugins/select2/js/select2.full.js
52 6 3
51 8 1
Select2.prototype._registerDomEvents = function()
in adminlte/html/plugins/select2/js/select2.full.js
49 6 0
element: $()
in adminlte/html/plugins/select2/js/select2.full.js
48 2 1