aws-quickstart / quickstart-aws-utility-meter-data-analytics-platform
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 78 units with 988 lines of code in units (21.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (107 lines of code)
    • 4 simple units (190 lines of code)
    • 72 very simple units (691 lines of code)
0% | 0% | 10% | 19% | 69%
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% | 10% | 19% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
meter-data0% | 0% | 32% | 12% | 55%
assets/functions/adapter0% | 0% | 94% | 0% | 5%
assets/functions/ml_pipeline0% | 0% | 0% | 20% | 80%
assets/functions/meter_forecast0% | 0% | 0% | 52% | 47%
assets/functions/get_anomaly0% | 0% | 0% | 100% | 0%
assets/glue/scripts0% | 0% | 0% | 0% | 100%
assets/functions/redshift0% | 0% | 0% | 0% | 100%
cis-data0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def generate_records()
in meter-data/generate_meter_data.py
57 13 5
def lambda_handler()
in assets/functions/adapter/mrasco/app.py
50 12 2
def lambda_handler()
in assets/functions/ml_pipeline/prepare_training/app.py
81 9 2
def load_db()
in meter-data/generate_meter_data.py
22 8 1
def lambda_handler()
in assets/functions/get_anomaly/app.py
41 7 2
def lambda_handler()
in assets/functions/meter_forecast/app.py
46 7 2
def lambda_handler()
in assets/functions/ml_pipeline/prepare_batch/app.py
50 5 2
def create_db()
in meter-data/generate_meter_data.py
20 5 2
def generate()
in cis-data/generate_cis_data.py
19 5 0
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
18 4 0
def lambda_handler()
in assets/functions/redshift/consumption/app.py
25 4 2
def process_batch()
in assets/functions/ml_pipeline/batch_anomaly_detection/app.py
26 4 5
def encode_request()
in assets/functions/meter_forecast/app.py
19 4 2
def initialize_error_record_generation()
in meter-data/generate_meter_data.py
9 4 4
def lambda_handler()
in assets/functions/ml_pipeline/upload_result/app.py
31 3 2
def lambda_handler()
in assets/functions/ml_pipeline/load_pipeline_parameter/app.py
32 3 2
def calculate_dates_for_week_of_year()
in assets/glue/scripts/business_aggregate_weekly.py
6 3 1
def schema_contains_field()
in assets/glue/scripts/transform_raw_to_clean_london.py
2 3 2
def get_error_code()
in meter-data/generate_meter_data.py
10 3 2