aws-samples / aws-alb-target-group-load-shedding
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 25 units with 427 lines of code in units (61.4% of code).
    • 1 very long units (187 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (116 lines of code)
    • 2 small units (36 lines of code)
    • 18 very small units (88 lines of code)
43% | 0% | 27% | 8% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py43% | 0% | 27% | 8% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk/cdk100% | 0% | 0% | 0% | 0%
source/lambda/shared/elb_load_monitor0% | 0% | 46% | 8% | 45%
source/lambda0% | 0% | 57% | 42% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __init__()
in cdk/cdk/alb_monitor_stack.py
187 14 4
def shed()
in source/lambda/shared/elb_load_monitor/elb_listener_rule.py
39 10 4
def save()
in source/lambda/shared/elb_load_monitor/elb_listener_rule.py
28 2 2
def lambda_handler()
in source/lambda/alb_alarm_lambda_handler.py
27 2 2
def restore()
in source/lambda/shared/elb_load_monitor/elb_listener_rule.py
22 5 3
def lambda_handler()
in source/lambda/alb_alarm_check_lambda_handler.py
20 2 2
def to_json()
in source/lambda/shared/elb_load_monitor/alb_alarm_messages.py
16 1 1
def from_json()
in source/lambda/shared/elb_load_monitor/alb_alarm_messages.py
10 1 2
def get_target_groups()
in source/lambda/shared/elb_load_monitor/elb_listener_rule.py
8 2 1
def is_restorable()
in source/lambda/shared/elb_load_monitor/elb_listener_rule.py
7 4 2
def is_sheddable()
in source/lambda/shared/elb_load_monitor/elb_listener_rule.py
6 2 3
def restore()
in source/lambda/shared/elb_load_monitor/alb_listener_rules_handler.py
6 3 4
def shed()
in source/lambda/shared/elb_load_monitor/alb_listener_rules_handler.py
6 3 5
def __init__()
in source/lambda/shared/elb_load_monitor/elb_listener_rule.py
5 1 4
def __init__()
in source/lambda/shared/elb_load_monitor/alb_alarm_messages.py
5 1 5
def is_restorable()
in source/lambda/shared/elb_load_monitor/alb_listener_rules_handler.py
5 3 2
def is_sheddable()
in source/lambda/shared/elb_load_monitor/alb_listener_rules_handler.py
5 3 3
def __init__()
in source/lambda/shared/elb_load_monitor/alb_alarm_messages.py
4 1 0
def datetime_handler()
in source/lambda/shared/elb_load_monitor/util.py
4 2 1
def __init__()
in source/lambda/shared/elb_load_monitor/alb_listener_rules_handler.py
4 1 0