aws-samples / asynchronous-messaging-workshop
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 29 units with 276 lines of code in units (4.6% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (90 lines of code)
    • 10 small units (137 lines of code)
    • 16 very small units (49 lines of code)
0% | 0% | 32% | 49% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 32% | 49% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
code/lab-1/unicorn-management-service0% | 0% | 93% | 0% | 6%
code/lab-2/unicorn-management-service0% | 0% | 93% | 0% | 6%
code/lab-3/request-for-quotes-service0% | 0% | 93% | 0% | 6%
code/lab-3/query-for-quotes-service0% | 0% | 0% | 100% | 0%
code/lab-4/payment_charge0% | 0% | 0% | 51% | 48%
code/lab-3/generic-unicorn-management-service0% | 0% | 0% | 89% | 10%
code/lab-1/customer_notification_service0% | 0% | 0% | 100% | 0%
code/lab-1/extraordinary_rides_service0% | 0% | 0% | 100% | 0%
code/lab-1/customer_accounting_service0% | 0% | 0% | 100% | 0%
code/lab-4/payment_refund0% | 0% | 0% | 57% | 42%
code/lab-3/quotes-response-service0% | 0% | 0% | 100% | 0%
code/lab-2/generic-backend-microservice0% | 0% | 0% | 73% | 26%
code/lab-4/account_credit0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in code/lab-1/unicorn-management-service/app.py
30 2 2
def lambda_handler()
in code/lab-2/unicorn-management-service/app.py
30 2 2
def lambda_handler()
in code/lab-3/request-for-quotes-service/app.py
30 2 2
def lambda_handler()
in code/lab-4/payment_charge/charge.py
17 4 2
def lambda_handler()
in code/lab-3/generic-unicorn-management-service/app.py
17 5 2
def assemble()
in code/lab-3/query-for-quotes-service/app.py
16 3 1
def lambda_handler()
in code/lab-1/customer_notification_service/app.py
13 3 2
def lambda_handler()
in code/lab-1/extraordinary_rides_service/app.py
13 3 2
def lambda_handler()
in code/lab-1/customer_accounting_service/app.py
13 3 2
def lambda_handler()
in code/lab-3/query-for-quotes-service/app.py
13 1 2
def lambda_handler()
in code/lab-4/payment_refund/refund.py
12 3 2
def lambda_handler()
in code/lab-3/quotes-response-service/app.py
12 2 2
def process()
in code/lab-2/generic-backend-microservice/app.py
11 2 1
def lambda_handler()
in code/lab-4/account_credit/credit.py
6 3 2
def lambda_handler()
in code/lab-2/generic-backend-microservice/app.py
4 1 2
def __init__()
in code/lab-4/account_credit/credit.py
4 3 3
def __init__()
in code/lab-4/payment_charge/charge.py
4 3 3
def __init__()
in code/lab-4/payment_charge/charge.py
4 3 3
def __init__()
in code/lab-4/payment_refund/refund.py
4 3 3
def provider_auth()
in code/lab-4/payment_charge/charge.py
3 1 4