aws / sagemaker-pytorch-inference-toolkit
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 28 units with 238 lines of code in units (45.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 0 medium complex units (0 lines of code)
    • 2 simple units (66 lines of code)
    • 26 very simple units (172 lines of code)
0% | 0% | 0% | 27% | 72%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | 0% | 29% | 70%
c0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/sagemaker_pytorch_serving_container0% | 0% | 0% | 29% | 70%
artifacts0% | 0% | 0% | 0% | 100%
docker/build_artifacts0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def default_model_fn()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
30 10 2
def _generate_ts_config_properties()
in src/sagemaker_pytorch_serving_container/torchserve.py
36 6 0
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 start_torchserve()
in src/sagemaker_pytorch_serving_container/torchserve.py
28 4 1
def default_input_fn()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
6 3 3
def default_predict_fn()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
16 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
def _is_model_file()
in src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py
6 2 1
def _adapt_to_ts_format()
in src/sagemaker_pytorch_serving_container/torchserve.py
19 2 1
def _set_python_path()
in src/sagemaker_pytorch_serving_container/torchserve.py
5 2 0
def _add_sigterm_handler()
in src/sagemaker_pytorch_serving_container/torchserve.py
7 2 1
def _install_requirements()
in src/sagemaker_pytorch_serving_container/torchserve.py
8 2 0
int gethostname()
in artifacts/changehostname.c
6 1 2
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 __init__()
in src/sagemaker_pytorch_serving_container/ts_environment.py
8 1 1
def batch_size()
in src/sagemaker_pytorch_serving_container/ts_environment.py
2 1 1
def max_batch_delay()
in src/sagemaker_pytorch_serving_container/ts_environment.py
2 1 1