aws-samples / amazon-sagemaker-model-serving-using-aws-cdk
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 30 units with 292 lines of code in units (72.3% 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)
    • 1 simple units (25 lines of code)
    • 29 very simple units (267 lines of code)
0% | 0% | 0% | 8% | 91%
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% | 10% | 89%
ts0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
codes/lambda/api-testing-tester/src0% | 0% | 0% | 15% | 84%
codes/lambda/api-hosting-predictor/src0% | 0% | 0% | 0% | 100%
models/model-a/src/code0% | 0% | 0% | 0% | 100%
lib/base0% | 0% | 0% | 0% | 100%
lib/utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def execute_tests()
in codes/lambda/api-testing-tester/src/http_request_tester.py
25 7 2
def request_post()
in codes/lambda/api-testing-tester/src/http_request_tester.py
27 4 7
def handle()
in codes/lambda/api-hosting-predictor/src/handler.py
12 3 2
def put_metric()
in codes/lambda/api-testing-tester/src/http_request_tester.py
46 3 6
def start_loop()
in codes/lambda/api-testing-tester/src/http_request_tester.py
7 3 2
def input_fn()
in models/model-a/src/code/inference.py
9 3 2
def get_client()
in codes/lambda/api-hosting-predictor/src/handler.py
5 2 2
def load_sm_client()
in codes/lambda/api-hosting-predictor/src/handler.py
5 2 0
def decimal_default()
in codes/lambda/api-hosting-predictor/src/handler.py
4 2 1
def predict()
in codes/lambda/api-hosting-predictor/src/handler.py
12 2 3
def get_client()
in codes/lambda/api-testing-tester/src/http_request_tester.py
5 2 2
def get_resource()
in codes/lambda/api-testing-tester/src/http_request_tester.py
5 2 2
def handle()
in codes/lambda/api-testing-tester/src/handler.py
27 2 2
function addProjectPrefix()
in lib/utils/config-loaders.ts
7 2 1
def predict_fn()
in models/model-a/src/code/inference.py
11 2 2
def output_fn()
in models/model-a/src/code/inference.py
9 2 2
def set_profile()
in codes/lambda/api-hosting-predictor/src/handler.py
3 1 1
def create_success_response()
in codes/lambda/api-hosting-predictor/src/handler.py
3 1 2
def create_error_response()
in codes/lambda/api-hosting-predictor/src/handler.py
5 1 2
def __init__()
in codes/lambda/api-testing-tester/src/http_request_tester.py
2 1 2