aws-samples / amazon-sagemaker-build-train-deploy
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 32 units with 587 lines of code in units (36.7% of code).
    • 1 very long units (166 lines of code)
    • 1 long units (53 lines of code)
    • 5 medium size units (172 lines of code)
    • 8 small units (103 lines of code)
    • 17 very small units (93 lines of code)
28% | 9% | 29% | 17% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py28% | 9% | 29% | 17% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
08_projects/modelbuild/pipelines/endtoendmlsm83% | 0% | 0% | 5% | 10%
04_deploy_model0% | 55% | 25% | 0% | 18%
03_train_model/source_dir0% | 0% | 75% | 25% | 0%
08_projects/modelbuild/pipelines/endtoendmlsm/train0% | 0% | 74% | 25% | 0%
02_data_exploration_and_feature_eng0% | 0% | 100% | 0% | 0%
08_projects/modelbuild/pipelines/endtoendmlsm/deploy0% | 0% | 0% | 48% | 51%
04_deploy_model/xgboost_source_dir0% | 0% | 0% | 53% | 46%
04_deploy_model/sklearn_source_dir0% | 0% | 0% | 42% | 57%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_pipeline()
in 08_projects/modelbuild/pipelines/endtoendmlsm/workflow.py
166 8 7
def run_model_monitor_job_processor()
in 04_deploy_model/monitoringjob_utils.py
53 3 11
def main()
in 03_train_model/source_dir/training_debug.py
44 1 0
def main()
in 08_projects/modelbuild/pipelines/endtoendmlsm/train/train.py
40 1 0
def main()
in 03_train_model/source_dir/training.py
40 1 0
def get_model_monitor_container_uri()
in 04_deploy_model/monitoringjob_utils.py
24 1 1
def cleanup_glue_resources()
in 02_data_exploration_and_feature_eng/notebook_utilities.py
24 8 0
def parse_args()
in 08_projects/modelbuild/pipelines/endtoendmlsm/train/train.py
14 1 0
def output_fn()
in 08_projects/modelbuild/pipelines/endtoendmlsm/deploy/xgboost/inference.py
14 5 2
def parse_args()
in 03_train_model/source_dir/training_debug.py
14 1 0
def parse_args()
in 03_train_model/source_dir/training.py
14 1 0
def output_fn()
in 04_deploy_model/xgboost_source_dir/inference.py
14 5 2
def output_fn()
in 08_projects/modelbuild/pipelines/endtoendmlsm/deploy/sklearn/inference.py
11 4 2
def get_pipeline_custom_tags()
in 08_projects/modelbuild/pipelines/endtoendmlsm/workflow.py
11 3 3
def output_fn()
in 04_deploy_model/sklearn_source_dir/inference.py
11 4 2
def get_session()
in 08_projects/modelbuild/pipelines/endtoendmlsm/workflow.py
10 1 2
def input_fn()
in 08_projects/modelbuild/pipelines/endtoendmlsm/deploy/sklearn/inference.py
9 3 2
def input_fn()
in 04_deploy_model/sklearn_source_dir/inference.py
9 3 2
def input_fn()
in 08_projects/modelbuild/pipelines/endtoendmlsm/deploy/xgboost/inference.py
8 2 2
def get_latest_training_job_name()
in 04_deploy_model/notebook_utilities.py
8 2 1