awslabs / sagemaker-purchase-modelling
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 24 units with 236 lines of code in units (28.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (63 lines of code)
    • 9 small units (123 lines of code)
    • 12 very small units (50 lines of code)
0% | 0% | 26% | 52% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 26% | 52% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source0% | 0% | 37% | 34% | 28%
deployment/solution-assistant/src0% | 0% | 18% | 75% | 5%
source/notebooks/src/package0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def bash()
in source/env_setup.py
21 4 1
def env_setup()
in source/env_setup.py
21 6 0
def on_delete()
in deployment/solution-assistant/src/lambda_function.py
21 5 2
def delete_sagemaker_endpoint_config()
in deployment/solution-assistant/src/lambda_function.py
18 3 1
def add_to_logbook()
in source/env_setup.py
16 7 2
def delete_sagemaker_endpoint()
in deployment/solution-assistant/src/lambda_function.py
16 3 1
def delete_sagemaker_model()
in deployment/solution-assistant/src/lambda_function.py
13 3 1
def delete_s3_objects()
in deployment/solution-assistant/src/lambda_function.py
13 2 1
def delete_s3_bucket()
in deployment/solution-assistant/src/lambda_function.py
13 2 1
def in_logbook()
in source/env_setup.py
12 5 2
def get_hostname()
in source/env_setup.py
11 2 0
def delete_monitoring_schedule()
in deployment/solution-assistant/src/lambda_function.py
11 3 1
def get_sagemaker_mode()
in source/env_setup.py
8 2 0
def get_current_folder()
in source/notebooks/src/package/utils.py
7 4 1
def parse_args()
in source/env_setup.py
6 1 0
def env_setup_notebook_instance()
in source/env_setup.py
5 1 0
def env_setup_studio()
in source/env_setup.py
5 1 0
def get_notebook_name()
in source/notebooks/src/package/utils.py
5 1 0
def read_file()
in source/env_setup.py
3 1 1
def logging_setup()
in source/env_setup.py
3 1 1