aws-samples / aws-utility-meter-data-analytics-platform-cn
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 53 units with 709 lines of code in units (12.2% 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)
    • 2 simple units (117 lines of code)
    • 51 very simple units (592 lines of code)
0% | 0% | 0% | 16% | 83%
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% | 16% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
assets/functions/prepare_training0% | 0% | 0% | 76% | 23%
assets/functions/get_anomaly0% | 0% | 0% | 100% | 0%
assets/glue/scripts0% | 0% | 0% | 0% | 100%
assets/functions/meter_forecast0% | 0% | 0% | 0% | 100%
assets/functions/batch_anomaly_detection0% | 0% | 0% | 0% | 100%
assets/functions/prepare_batch0% | 0% | 0% | 0% | 100%
assets/functions/redshift0% | 0% | 0% | 0% | 100%
assets/functions/check_initial_pipeline_run0% | 0% | 0% | 0% | 100%
assets/functions/upload_result0% | 0% | 0% | 0% | 100%
assets/functions/split_batch0% | 0% | 0% | 0% | 100%
assets/functions/state_topic_subscription0% | 0% | 0% | 0% | 100%
assets/functions/crawler0% | 0% | 0% | 0% | 100%
assets/functions/load_pipeline_parameter0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in assets/functions/prepare_training/app.py
73 9 2
def lambda_handler()
in assets/functions/get_anomaly/app.py
44 7 2
def lambda_handler()
in assets/functions/prepare_batch/app.py
53 5 2
def lambda_handler()
in assets/functions/meter_forecast/app.py
44 5 2
def process_batch()
in assets/functions/batch_anomaly_detection/app.py
26 4 5
def get_sql_statement()
in assets/functions/redshift/consumption/app.py
7 4 1
def load_redshift_cred()
in assets/functions/redshift/consumption/app.py
19 4 0
def lambda_handler()
in assets/functions/redshift/consumption/app.py
25 4 2
def encode_request()
in assets/functions/meter_forecast/app.py
19 4 2
def lambda_handler()
in assets/functions/upload_result/app.py
31 3 2
def lambda_handler()
in assets/functions/state_topic_subscription/app.py
10 3 2
def calculate_dates_for_week_of_year()
in assets/glue/scripts/business_aggregate_weekly.py
6 3 1
def weekend()
in assets/functions/batch_anomaly_detection/app.py
6 2 1
def default()
in assets/functions/redshift/consumption/app.py
5 2 2
def trigger_state_machine()
in assets/functions/state_topic_subscription/app.py
14 2 0
def write_upload_file()
in assets/functions/prepare_batch/app.py
6 2 3
def lambda_handler()
in assets/functions/crawler/trigger_glue_crawler/app.py
11 2 2
def write_upload_file()
in assets/functions/prepare_training/app.py
6 2 3
def check_if_file_exist()
in assets/functions/check_initial_pipeline_run/app.py
9 2 2
def lambda_handler()
in assets/functions/check_initial_pipeline_run/app.py
26 2 2