aws-samples / amazon-sagemaker-workshop-analytics-machine-learning
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 51 units with 733 lines of code in units (32.8% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (192 lines of code)
    • 8 medium size units (271 lines of code)
    • 7 small units (92 lines of code)
    • 33 very small units (178 lines of code)
0% | 26% | 36% | 12% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 26% | 36% | 12% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines0% | 58% | 35% | 0% | 5%
5. MLOps SageMaker Project/sagemaker-workshop-build-seedcode-v1/pipelines0% | 58% | 35% | 0% | 5%
5. MLOps SageMaker Project/sagemaker-workshop-deploy-seedcode-v1/pipelines0% | 58% | 35% | 0% | 5%
1. Amazon SageMaker Processing0% | 0% | 58% | 17% | 24%
5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/preprocess0% | 0% | 44% | 29% | 26%
5. MLOps SageMaker Project/sagemaker-workshop-deploy-seedcode-v1/pipelines/deploy0% | 0% | 0% | 15% | 84%
5. MLOps SageMaker Project/sagemaker-workshop-build-seedcode-v1/pipelines/train0% | 0% | 0% | 33% | 66%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in 5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/run_pipeline.py
64 4 0
def main()
in 5. MLOps SageMaker Project/sagemaker-workshop-build-seedcode-v1/pipelines/run_pipeline.py
64 4 0
def main()
in 5. MLOps SageMaker Project/sagemaker-workshop-deploy-seedcode-v1/pipelines/run_pipeline.py
64 4 0
def main()
in 5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/get_pipeline_definition.py
39 4 0
def main()
in 5. MLOps SageMaker Project/sagemaker-workshop-build-seedcode-v1/pipelines/get_pipeline_definition.py
39 4 0
def main()
in 5. MLOps SageMaker Project/sagemaker-workshop-deploy-seedcode-v1/pipelines/get_pipeline_definition.py
39 4 0
def clean_data()
in 5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/preprocess/preprocess.py
37 1 1
def clean_data()
in 1. Amazon SageMaker Processing/preprocess.py
37 1 1
def enrich_data()
in 5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/preprocess/preprocess.py
29 4 2
def enrich_data()
in 1. Amazon SageMaker Processing/preprocess.py
29 4 2
def main()
in 1. Amazon SageMaker Processing/preprocess.py
22 4 2
def main()
in 5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/preprocess/preprocess.py
20 4 2
def load_data()
in 5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/preprocess/preprocess.py
13 3 1
def load_data()
in 1. Amazon SageMaker Processing/preprocess.py
13 3 1
def save_files()
in 1. Amazon SageMaker Processing/preprocess.py
13 2 8
def save_files()
in 5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/preprocess/preprocess.py
11 1 6
def get_pipeline_custom_tags()
in 5. MLOps SageMaker Project/sagemaker-workshop-build-seedcode-v1/pipelines/train/pipeline.py
11 3 3
def get_data_check_baseline_uri()
in 5. MLOps SageMaker Project/sagemaker-workshop-deploy-seedcode-v1/pipelines/deploy/model_registry.py
11 3 2
def get_session()
in 5. MLOps SageMaker Project/sagemaker-workshop-preprocess-seedcode-v1/pipelines/preprocess/pipeline.py
10 1 2
def get_session()
in 5. MLOps SageMaker Project/sagemaker-workshop-build-seedcode-v1/pipelines/train/pipeline.py
10 1 2