aws-samples / aws-marketplace-machine-learning
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 22 units with 436 lines of code in units (89.7% 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)
    • 4 simple units (140 lines of code)
    • 18 very simple units (296 lines of code)
0% | 0% | 0% | 32% | 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% | 0% | 32% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
right_size_your_sagemaker_endpoints0% | 0% | 0% | 34% | 65%
listing_torchserve_models/src0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_pricing()
in right_size_your_sagemaker_endpoints/load_test_helper.py
32 9 2
def generate_plots()
in right_size_your_sagemaker_endpoints/load_test_helper.py
57 9 4
def deploy_single_endpoint()
in right_size_your_sagemaker_endpoints/sagemaker_helper.py
32 7 3
def get_min_max_instances()
in right_size_your_sagemaker_endpoints/load_test_helper.py
19 6 3
def run_load_tests()
in right_size_your_sagemaker_endpoints/load_test_helper.py
13 5 2
def input_fn()
in right_size_your_sagemaker_endpoints/inference.py
15 4 2
def generate_latency_plot()
in right_size_your_sagemaker_endpoints/load_test_helper.py
18 4 2
def clean_up_endpoints()
in right_size_your_sagemaker_endpoints/sagemaker_helper.py
12 4 1
def get_inference_specification_json()
in listing_torchserve_models/src/inference_specification.py
9 3 5
def delete_infra()
in right_size_your_sagemaker_endpoints/api_helper.py
24 3 4
def checker()
in right_size_your_sagemaker_endpoints/locust_file.py
7 3 1
def predict()
in right_size_your_sagemaker_endpoints/locust_file.py
18 3 1
def deploy_endpoints()
in right_size_your_sagemaker_endpoints/sagemaker_helper.py
10 3 3
def get_existing_endpoints()
in right_size_your_sagemaker_endpoints/sagemaker_helper.py
8 3 0
def get_supported_instances()
in listing_torchserve_models/src/inference_specification.py
7 2 2
def predict_fn()
in right_size_your_sagemaker_endpoints/inference.py
6 2 2
def create_infra()
in right_size_your_sagemaker_endpoints/api_helper.py
130 2 3
def get_validation_specification_dict()
in listing_torchserve_models/src/modelpackage_validation_specification.py
2 1 7
def get_validation_specification_json()
in listing_torchserve_models/src/modelpackage_validation_specification.py
7 1 7
def get_inference_specification_dict()
in listing_torchserve_models/src/inference_specification.py
2 1 5