aws-samples / appstream-data-tools-isolation-blog
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 9 units with 487 lines of code in units (71.6% of code).
    • 1 very long units (234 lines of code)
    • 2 long units (110 lines of code)
    • 4 medium size units (110 lines of code)
    • 2 small units (33 lines of code)
    • 0 very small units (0 lines of code)
48% | 22% | 22% | 6% | 0%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py48% | 22% | 22% | 6% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
stacks54% | 25% | 11% | 7% | 0%
lambda0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 9 longest units
Unit# linesMcCabe index# params
def __init__()
in stacks/data_sandbox_appstream.py
234 1 7
def __init__()
in stacks/data_sandbox_notebook.py
56 2 8
def __init__()
in stacks/data_sandbox_service_roles.py
54 1 5
def lambda_handler()
in lambda/appstream_service_roles_lambda.py
37 1 2
def __init__()
in stacks/data_sandbox_saml.py
27 2 5
def __init__()
in stacks/data_sandbox_start_fleet.py
24 1 6
def lambda_handler()
in lambda/data_sandbox_lambda.py
22 3 2
def __init__()
in stacks/data_sandbox_vpc.py
17 1 5
def __init__()
in stacks/data_sandbox_s3.py
16 1 5