aws-samples / amazon-sagemaker-safe-deployment-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 47 units with 751 lines of code in units (26.2% of code).
    • 1 very long units (128 lines of code)
    • 1 long units (59 lines of code)
    • 9 medium size units (288 lines of code)
    • 11 small units (162 lines of code)
    • 25 very small units (114 lines of code)
17% | 7% | 38% | 21% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py17% | 7% | 38% | 21% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
custom_resource27% | 0% | 35% | 20% | 16%
model0% | 39% | 0% | 46% | 14%
api0% | 0% | 94% | 0% | 5%
scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_processing_request()
in custom_resource/sagemaker_suggest_baseline.py
128 10 2
def create_baseline_step()
in model/run_pipeline.py
59 2 4
def lambda_handler()
in api/pre_traffic_hook.py
45 8 2
def lambda_handler()
in custom_resource/sagemaker_create_experiment.py
43 9 2
def lambda_handler()
in api/post_traffic_hook.py
42 7 2
36 5 2
def lambda_handler()
in custom_resource/sagemaker_query_drift.py
33 5 2
def get_model_monitor_container_uri()
in custom_resource/sagemaker_suggest_baseline.py
24 1 1
def lambda_handler()
in custom_resource/sagemaker_add_transform_header.py
23 5 2
def stop_processing_job()
in custom_resource/sagemaker_suggest_baseline.py
21 5 1
def stop_training_job()
in custom_resource/sagemaker_training_job.py
21 5 1
def is_training_job_ready()
in custom_resource/sagemaker_training_job.py
20 4 1
def lambda_handler()
in custom_resource/sagemaker_query_training.py
18 3 2
def is_processing_job_ready()
in custom_resource/sagemaker_suggest_baseline.py
17 5 1
def get_dev_config()
in model/run_pipeline.py
16 1 6
def main()
in model/run_pipeline.py
16 1 0
def get_baseline_drift()
in custom_resource/sagemaker_query_drift.py
15 5 1
def create_experiment_step()
in model/run_pipeline.py
13 1 1
def create_graph()
in model/run_pipeline.py
13 3 3
def get_training_request()
in custom_resource/sagemaker_training_job.py
12 4 1