aws-samples / aws-shadow-deployment
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 143 lines of code in units (13.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (86 lines of code)
    • 2 small units (35 lines of code)
    • 4 very small units (22 lines of code)
0% | 0% | 60% | 24% | 15%
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% | 60% | 24% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda/performance_comparison0% | 0% | 100% | 0% | 0%
lambda/processor0% | 0% | 56% | 37% | 6%
lambda/sfn_trigger0% | 0% | 100% | 0% | 0%
lambda/traffic_update0% | 0% | 0% | 100% | 0%
lambda/traffic_simulator0% | 0% | 0% | 0% | 100%
lambda/endpoint_update0% | 0% | 0% | 0% | 100%
lambda/endpoint_status_check0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 9 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in lambda/performance_comparison/handler.py
32 8 2
def lambda_handler()
in lambda/sfn_trigger/handler.py
27 6 2
def lambda_handler()
in lambda/processor/handler.py
27 6 2
def update_result()
in lambda/processor/handler.py
18 3 3
def lambda_handler()
in lambda/traffic_update/handler.py
17 3 2
def lambda_handler()
in lambda/traffic_simulator/handler.py
7 2 2
def lambda_handler()
in lambda/endpoint_update/handler.py
6 1 2
def lambda_handler()
in lambda/endpoint_status_check/handler.py
6 1 2
def prediction()
in lambda/processor/handler.py
3 1 2