aws-samples / amazon-sagemaker-ab-testing-pipeline
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 48 units with 542 lines of code in units (23.8% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (190 lines of code)
    • 2 medium size units (69 lines of code)
    • 8 small units (111 lines of code)
    • 35 very small units (172 lines of code)
0% | 35% | 12% | 20% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 35% | 12% | 20% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda/api0% | 40% | 14% | 21% | 24%
deployment_pipeline/infra0% | 0% | 0% | 21% | 78%
infra0% | 0% | 0% | 0% | 100%
notebook0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in lambda/api/lambda_invoke.py
70 18 2
def update_variant_metrics()
in lambda/api/experiment_metrics.py
65 10 3
def lambda_handler()
in lambda/api/lambda_register.py
55 14 2
def get_user_variant()
in lambda/api/lambda_invoke.py
40 18 2
def get_variant_metrics()
in lambda/api/experiment_metrics.py
29 4 2
def lambda_handler()
in lambda/api/lambda_metrics.py
20 6 2
def handle_register()
in lambda/api/lambda_register.py
19 2 4
def get_metrics()
in lambda/api/lambda_metrics.py
14 3 1
def get_assignment()
in lambda/api/experiment_assignment.py
12 2 3
def get_endpoint_variants()
in lambda/api/lambda_register.py
12 2 1
def handle_stats()
in lambda/api/lambda_invoke.py
12 2 1
def __init__()
in deployment_pipeline/infra/deployment_config.py
11 1 0
def select_variant()
in lambda/api/algorithm.py
11 3 1
def __init__()
in deployment_pipeline/infra/sagemaker_stack.py
10 1 0
def log_metrics()
in lambda/api/experiment_metrics.py
10 4 2
def select_variant()
in lambda/api/algorithm.py
10 3 1
def __init__()
in deployment_pipeline/infra/deployment_config.py
8 1 0
def create_variant_metrics()
in lambda/api/experiment_metrics.py
8 1 7
def select_variant()
in lambda/api/algorithm.py
8 2 1
def handle_delete()
in lambda/api/lambda_register.py
8 1 1