aws / sagemaker-huggingface-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 31 units with 325 lines of code in units (55.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (24 lines of code)
    • 4 simple units (81 lines of code)
    • 26 very simple units (220 lines of code)
0% | 0% | 7% | 24% | 67%
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% | 7% | 24% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/sagemaker_huggingface_inference_toolkit0% | 0% | 7% | 24% | 67%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def validate_and_initialize_user_module()
in src/sagemaker_huggingface_inference_toolkit/handler_service.py
24 11 1
def handle()
in src/sagemaker_huggingface_inference_toolkit/handler_service.py
20 7 3
def start_model_server()
in src/sagemaker_huggingface_inference_toolkit/mms_model_server.py
39 6 1
def decode_csv()
in src/sagemaker_huggingface_inference_toolkit/decoder_encoder.py
12 6 1
def _build_storage_path()
in src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
10 6 3
def preprocess()
in src/sagemaker_huggingface_inference_toolkit/handler_service.py
11 5 3
def default()
in src/sagemaker_huggingface_inference_toolkit/decoder_encoder.py
11 5 2
def _is_gpu_available()
in src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
11 4 0
def infer_task_from_model_architecture()
in src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
16 4 2
def load()
in src/sagemaker_huggingface_inference_toolkit/handler_service.py
11 3 2
def predict()
in src/sagemaker_huggingface_inference_toolkit/handler_service.py
8 3 3
def decode()
in src/sagemaker_huggingface_inference_toolkit/decoder_encoder.py
8 3 2
def _get_framework()
in src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
11 3 0
def get_pipeline()
in src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
9 3 4
def get_device()
in src/sagemaker_huggingface_inference_toolkit/handler_service.py
5 2 1
def _adapt_to_mms_format()
in src/sagemaker_huggingface_inference_toolkit/mms_model_server.py
20 2 2
def _retry_if_error()
in src/sagemaker_huggingface_inference_toolkit/serving.py
2 2 1
def encode_csv()
in src/sagemaker_huggingface_inference_toolkit/decoder_encoder.py
9 2 1
def encode()
in src/sagemaker_huggingface_inference_toolkit/decoder_encoder.py
6 2 2
def infer_task_from_hub()
in src/sagemaker_huggingface_inference_toolkit/transformers_utils.py
10 2 3