aws-samples / amazon-sagemaker-drift-detection
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 72 units with 757 lines of code in units (17.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (67 lines of code)
    • 4 medium size units (114 lines of code)
    • 20 small units (287 lines of code)
    • 47 very small units (289 lines of code)
0% | 8% | 15% | 37% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 15% | 37% | 38%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambda/build0% | 45% | 21% | 32% | 0%
build_pipeline/pipelines0% | 0% | 38% | 23% | 38%
deployment_pipeline/infra0% | 0% | 28% | 28% | 43%
infra0% | 0% | 0% | 66% | 33%
batch_pipeline/pipelines0% | 0% | 0% | 53% | 46%
batch_pipeline/infra0% | 0% | 0% | 31% | 68%
batch_pipeline0% | 0% | 0% | 0% | 100%
deployment_pipeline0% | 0% | 0% | 0% | 100%
build_pipeline/infra0% | 0% | 0% | 0% | 100%
build_pipeline0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def check_pipeline()
in lambda/build/lambda_start_pipeline.py
67 7 3
def get_model_monitor_mapping()
in deployment_pipeline/infra/sagemaker_stack.py
34 2 1
def update_pipeline_rules()
in lambda/build/lambda_pipeline_change.py
31 4 1
def enrich_data()
in build_pipeline/pipelines/preprocess.py
26 4 2
def clean_data()
in build_pipeline/pipelines/preprocess.py
23 1 1
def remove_policy()
in infra/clean_template.py
20 10 2
def lambda_handler()
in lambda/build/lambda_pipeline_change.py
20 5 2
def __init__()
in infra/batch_pipeline_construct.py
19 1 0
def __init__()
in infra/build_pipeline_construct.py
19 1 0
def upload_assets()
in infra/upload_assets.py
18 4 1
def main()
in build_pipeline/pipelines/preprocess.py
16 4 1
def put_cloudwatch_metric()
in batch_pipeline/pipelines/postprocess_monitor_script.py
16 2 2
def __init__()
in infra/deploy_pipeline_construct.py
16 1 0
def update_cloudwatch_rule()
in lambda/build/lambda_pipeline_change.py
16 4 2
def load_data()
in build_pipeline/pipelines/preprocess.py
13 3 1
def __init__()
in deployment_pipeline/infra/sagemaker_stack.py
12 1 0
def __init__()
in batch_pipeline/infra/sagemaker_pipeline_stack.py
12 1 0
def get_baseline_drift()
in batch_pipeline/pipelines/postprocess_monitor_script.py
12 5 1
def lambda_handler()
in lambda/build/lambda_start_pipeline.py
12 2 2
def get_data_check_baseline_uri()
in deployment_pipeline/infra/model_registry.py
11 3 2