aws / sagemaker-pytorch-inference-toolkit
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 28 units with 238 lines of code in units (45.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (94 lines of code)
    • 2 small units (35 lines of code)
    • 23 very small units (109 lines of code)
0% | 0% | 39% | 14% | 45%
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% | 41% | 15% | 42%
c0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/sagemaker_pytorch_serving_container0% | 0% | 41% | 15% | 42%
artifacts0% | 0% | 0% | 0% | 100%
docker/build_artifacts0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _generate_ts_config_properties()
in src/sagemaker_pytorch_serving_container/torchserve.py
36 6 0
def default_model_fn()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
30 10 2
def start_torchserve()
in src/sagemaker_pytorch_serving_container/torchserve.py
28 4 1
def _adapt_to_ts_format()
in src/sagemaker_pytorch_serving_container/torchserve.py
19 2 1
def default_predict_fn()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
16 3 3
def default_output_fn()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
10 5 3
def _retrieve_ts_server_process()
in src/sagemaker_pytorch_serving_container/torchserve.py
10 5 0
def _install_requirements()
in src/sagemaker_pytorch_serving_container/torchserve.py
8 2 0
def __init__()
in src/sagemaker_pytorch_serving_container/ts_environment.py
8 1 1
def _add_sigterm_handler()
in src/sagemaker_pytorch_serving_container/torchserve.py
7 2 1
int gethostname()
in artifacts/changehostname.c
6 1 2
def _is_model_file()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
6 2 1
def default_input_fn()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
6 3 3
def initialize()
in src/sagemaker_pytorch_serving_container/handler_service.py
6 3 2
def is_env_set()
in src/sagemaker_pytorch_serving_container/ts_environment.py
6 3 1
int gethostname()
in docker/build_artifacts/changehostname.c
6 1 2
def _set_python_path()
in src/sagemaker_pytorch_serving_container/torchserve.py
5 2 0
def __init__()
in src/sagemaker_pytorch_serving_container/handler_service.py
4 1 1
def _create_torchserve_config_file()
in src/sagemaker_pytorch_serving_container/torchserve.py
3 1 0
def batch_size()
in src/sagemaker_pytorch_serving_container/ts_environment.py
2 1 1