aws-samples / amazon-frauddetector-mlops-multiaccount-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 126 units with 1,172 lines of code in units (72.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (54 lines of code)
    • 3 simple units (57 lines of code)
    • 122 very simple units (1,061 lines of code)
0% | 0% | 4% | 4% | 90%
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% | 4% | 4% | 90%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/core0% | 0% | 17% | 15% | 66%
src0% | 0% | 0% | 7% | 92%
infra/src/stages0% | 0% | 0% | 0% | 100%
infra/src/custom_constructs0% | 0% | 0% | 0% | 100%
infra/src0% | 0% | 0% | 0% | 100%
infra/src/lambda_poller0% | 0% | 0% | 0% | 100%
src/features0% | 0% | 0% | 0% | 100%
infra/src/stacks0% | 0% | 0% | 0% | 100%
src/rules0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def deploy()
in src/core/fraud_detector_model_based_deploy.py
54 13 7
def try_create_variable()
in src/core/fraud_detector_utils.py
30 9 7
def undeploy()
in src/main_demo_fraud_detector_undeploy.py
8 7 3
def wait_until_model_status()
in src/core/fraud_detector_utils.py
19 7 6
def create_or_retrieve_features()
in src/features/feature_variables_dynamic.py
24 5 1
def _get_max_rule_version()
in src/core/fraud_detector_utils.py
19 5 3
def run()
in src/core/fraud_detector_train.py
45 5 9
def lambda_handler()
in infra/src/lambda_poller/lambda_function.py
18 5 2
def generate_random_email()
in src/main_demo_data_transformer.py
5 4 3
def create_or_retrieve_label()
in src/features/feature_variables_dynamic.py
11 4 1
def _is_email()
in src/features/feature_variables_dynamic.py
10 4 4
def _is_ip()
in src/features/feature_variables_dynamic.py
10 4 4
def delete_all_rules()
in src/core/fraud_detector_undeploy.py
21 4 2
def delete_all_detector_versions()
in src/core/fraud_detector_undeploy.py
23 4 2
def poll_training_status()
in infra/src/lambda_poller/frauddetector_poller.py
15 4 3
def put_continuation_token()
in infra/src/lambda_poller/lambda_function.py
11 4 2
def parse_design()
in infra/src/app_config_parser.py
14 4 2
def parse_deploy_params()
in infra/src/app_config_parser.py
17 4 2
def _variable_substitute()
in infra/src/app_config_parser.py
6 4 3
def __init__()
in infra/src/custom_constructs/ml_pipeline_construct.py
16 4 8