aws-samples / amazon-sagemaker-mlops-workshop
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 11 units with 130 lines of code in units (13.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (53 lines of code)
    • 1 medium size units (24 lines of code)
    • 0 small units (0 lines of code)
    • 9 very small units (53 lines of code)
0% | 40% | 18% | 0% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 40% | 18% | 0% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
labs/05_model_monitor0% | 66% | 30% | 0% | 3%
labs/04_workflow_sm_pipelines/code0% | 0% | 0% | 0% | 100%
labs/03_manual_sagemaker_process_train/code0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 11 longest units
Unit# linesMcCabe index# params
def run_model_monitor_job_processor()
in labs/05_model_monitor/monitoringjob_utils.py
53 3 11
def get_model_monitor_container_uri()
in labs/05_model_monitor/monitoringjob_utils.py
24 1 1
def parse_args()
in labs/04_workflow_sm_pipelines/code/train.py
9 1 0
def parse_args()
in labs/03_manual_sagemaker_process_train/code/train.py
9 1 0
def get_model()
in labs/04_workflow_sm_pipelines/code/model_def.py
6 1 0
def get_model()
in labs/03_manual_sagemaker_process_train/code/model_def.py
6 1 0
def get_train_data()
in labs/04_workflow_sm_pipelines/code/train.py
5 1 1
def get_test_data()
in labs/04_workflow_sm_pipelines/code/train.py
5 1 1
def get_train_data()
in labs/03_manual_sagemaker_process_train/code/train.py
5 1 1
def get_test_data()
in labs/03_manual_sagemaker_process_train/code/train.py
5 1 1
def get_file_name()
in labs/05_model_monitor/monitoringjob_utils.py
3 1 1