aws-samples / amazon-sagemaker-drift-detection
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 72 units with 757 lines of code in units (17.8% 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)
    • 3 simple units (98 lines of code)
    • 69 very simple units (659 lines of code)
0% | 0% | 0% | 12% | 87%
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% | 12% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lambda/build0% | 0% | 0% | 45% | 54%
infra0% | 0% | 0% | 18% | 81%
build_pipeline/pipelines0% | 0% | 0% | 0% | 100%
deployment_pipeline/infra0% | 0% | 0% | 0% | 100%
batch_pipeline/pipelines0% | 0% | 0% | 0% | 100%
batch_pipeline/infra0% | 0% | 0% | 0% | 100%
batch_pipeline0% | 0% | 0% | 0% | 100%
deployment_pipeline0% | 0% | 0% | 0% | 100%
build_pipeline/infra0% | 0% | 0% | 0% | 100%
build_pipeline0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def remove_policy()
in infra/clean_template.py
20 10 2
def check_pipeline()
in lambda/build/lambda_start_pipeline.py
67 7 3
def zip_filter()
in infra/upload_assets.py
11 6 1
def get_baseline_drift()
in batch_pipeline/pipelines/postprocess_monitor_script.py
12 5 1
def lambda_handler()
in lambda/build/lambda_pipeline_change.py
20 5 2
def enrich_data()
in build_pipeline/pipelines/preprocess.py
26 4 2
def main()
in build_pipeline/pipelines/preprocess.py
16 4 1
def make_zipfile()
in infra/upload_assets.py
10 4 1
def upload_assets()
in infra/upload_assets.py
18 4 1
def update_cloudwatch_rule()
in lambda/build/lambda_pipeline_change.py
16 4 2
def update_pipeline_rules()
in lambda/build/lambda_pipeline_change.py
31 4 1
def get_data_check_baseline_uri()
in deployment_pipeline/infra/model_registry.py
11 3 2
def load_zones()
in build_pipeline/pipelines/preprocess.py
7 3 1
def load_data()
in build_pipeline/pipelines/preprocess.py
13 3 1
def get_data_check_baseline_uri()
in batch_pipeline/infra/model_registry.py
11 3 2
def get_model_monitor_mapping()
in deployment_pipeline/infra/sagemaker_stack.py
34 2 1
def upload_pipeline()
in build_pipeline/pipelines/pipeline.py
10 2 3
def load_data()
in batch_pipeline/pipelines/score.py
5 2 1
def put_cloudwatch_metric()
in batch_pipeline/pipelines/postprocess_monitor_script.py
16 2 2
def postprocess_handler()
in batch_pipeline/pipelines/postprocess_monitor_script.py
10 2 0