aws-samples / aws-cost-control-approval-workflow
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 34 units with 702 lines of code in units (44.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (61 lines of code)
    • 12 medium size units (444 lines of code)
    • 8 small units (114 lines of code)
    • 13 very small units (83 lines of code)
0% | 8% | 63% | 16% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 9% | 59% | 18% | 12%
js0% | 0% | 95% | 0% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
get-ec2-pricing0% | 38% | 41% | 9% | 10%
process-requests0% | 0% | 75% | 9% | 14%
save-request0% | 0% | 82% | 12% | 4%
linux-ami-lookup0% | 0% | 95% | 0% | 4%
approve-request0% | 0% | 47% | 40% | 11%
rebase-budgets0% | 0% | 41% | 33% | 25%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def getPrice_from_API()
in get-ec2-pricing/app.py
61 7 4
def lambda_handler()
in approve-request/app.py
49 10 2
49 10 1
def lambda_handler()
in save-request/app.py
47 4 2
def lambda_handler()
in process-requests/app.py
39 14 2
function sendResponse()
in linux-ami-lookup/index.js
37 1 4
def process_requests()
in process-requests/app.py
37 15 2
def notify_admin()
in process-requests/app.py
35 1 2
exports.handler = function()
in linux-ami-lookup/index.js
33 6 2
def lambda_handler()
in get-ec2-pricing/app.py
33 5 2
def region_lookup()
in get-ec2-pricing/app.py
32 16 1
def lambda_handler()
in rebase-budgets/app.py
31 12 2
def update_accrued_amt()
in process-requests/app.py
22 3 1
def update_request_status()
in process-requests/app.py
17 2 3
def update_accrued_amt()
in approve-request/app.py
15 1 4
def sendResponse()
in get-ec2-pricing/app.py
15 2 4
def sendResponse()
in save-request/app.py
15 2 4
def update_rejection_request_status()
in approve-request/app.py
14 1 1
def update_pricing_info()
in rebase-budgets/app.py
14 1 5
def update_approval_request_status()
in approve-request/app.py
13 1 1