aws-samples / amazon-eventbridge-resource-policy-samples
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 76 units with 491 lines of code in units (20.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 13 medium size units (300 lines of code)
    • 1 small units (20 lines of code)
    • 62 very small units (171 lines of code)
0% | 0% | 61% | 4% | 34%
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% | 61% | 4% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
blog/account-c-invoice-processing/invoice_processing0% | 0% | 45% | 6% | 47%
blog/account-a-web-store/order_function0% | 0% | 100% | 0% | 0%
patterns/single-bus-multi-account-pattern/purple-service-account0% | 0% | 78% | 0% | 21%
patterns/multi-bus-multi-account-pattern/purple-service-account0% | 0% | 78% | 0% | 21%
patterns/single-bus-multi-account-pattern/orange-service-account0% | 0% | 88% | 0% | 12%
patterns/single-bus-multi-account-pattern/blue-service-account0% | 0% | 88% | 0% | 12%
patterns/multi-bus-multi-account-pattern/orange-service-account0% | 0% | 88% | 0% | 12%
patterns/multi-bus-multi-account-pattern/blue-service-account0% | 0% | 88% | 0% | 12%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in blog/account-a-web-store/order_function/app.py
28 2 2
def unmarshall()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/marshaller.py
26 12 3
def __unmarshall_model()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/marshaller.py
24 15 3
def to_dict()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/NewOrderCreated.py
23 9 1
def to_dict()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/NewOrderCreatedItem.py
23 9 1
def to_dict()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/AWSEvent.py
23 9 1
def lambda_handler()
in patterns/single-bus-multi-account-pattern/orange-service-account/orange-service-app/orange_p_e3/app.py
22 2 2
def lambda_handler()
in patterns/single-bus-multi-account-pattern/purple-service-account/purple-service-app/purple_p_e2/app.py
22 2 2
def lambda_handler()
in patterns/single-bus-multi-account-pattern/blue-service-account/blue-service-app/blue_p_e1/app.py
22 2 2
def lambda_handler()
in patterns/multi-bus-multi-account-pattern/orange-service-account/orange-service-app/orange_p_e3/app.py
22 2 2
def lambda_handler()
in patterns/multi-bus-multi-account-pattern/purple-service-account/purple-service-app/purple_p_e2/app.py
22 2 2
def lambda_handler()
in patterns/multi-bus-multi-account-pattern/blue-service-account/blue-service-app/blue_p_e1/app.py
22 2 2
def marshall()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/marshaller.py
21 12 2
def __init__()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/AWSEvent.py
20 1 10
def __init__()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/NewOrderCreated.py
10 1 5
def __init__()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/NewOrderCreatedItem.py
10 1 5
def __unmarshall_primitive()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/marshaller.py
7 3 3
def lambda_handler()
in blog/account-c-invoice-processing/invoice_processing/invoice_processing_function/app.py
6 2 2
def __unmarshall_date()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/marshaller.py
6 2 2
def __unmarshall_datatime()
in blog/account-c-invoice-processing/invoice_processing/schema/com_examplecorp_webstore/newordercreated/marshaller.py
6 2 2