aws-samples / ds-dashboard
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 18 units with 323 lines of code in units (76.7% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (156 lines of code)
    • 2 medium size units (55 lines of code)
    • 3 small units (43 lines of code)
    • 11 very small units (69 lines of code)
0% | 48% | 17% | 13% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 48% | 17% | 13% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ds_dashboard0% | 100% | 0% | 0% | 0%
lambda_function_code0% | 0% | 32% | 25% | 41%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
def __init__()
in ds_dashboard/hub.py
80 3 4
def __init__()
in ds_dashboard/spoke.py
76 5 4
def lambda_handler()
in lambda_function_code/dashboard_connection.py
34 5 2
def lambda_handler()
in lambda_function_code/retrieve_values.py
21 3 2
def forward_events()
in lambda_function_code/dashboard_connection.py
19 2 3
def lambda_handler()
in lambda_function_code/fetch_metric_values.py
13 1 2
def emit_event()
in lambda_function_code/metric.py
11 1 2
def get_iam_permissions()
in lambda_function_code/metric.py
10 2 3
def extract()
in lambda_function_code/metric.py
9 1 1
def _compute_value()
in lambda_function_code/metric.py
9 1 1
def flatten_parameters()
in lambda_function_code/dashboard_connection.py
8 3 1
def lambda_handler()
in lambda_function_code/dynamo_write.py
7 1 2
def allow_event_puts()
in lambda_function_code/dashboard_connection.py
7 1 1
def __init__()
in lambda_function_code/metric.py
5 1 5
def _compute_value()
in lambda_function_code/metric.py
5 1 1
def _compute_value()
in lambda_function_code/metric.py
5 1 1
def _compute_value()
in lambda_function_code/metric.py
2 1 1
def _compute_value()
in lambda_function_code/metric.py
2 1 1