aws-samples / amazon-sagemaker-edge-manager-workshop
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 165 units with 1,630 lines of code in units (54.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)
    • 9 simple units (239 lines of code)
    • 156 very simple units (1,391 lines of code)
0% | 0% | 0% | 14% | 85%
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% | 14% | 85%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lab/03-Package-Deploy/iot-jobs/app0% | 0% | 0% | 21% | 78%
lab/02-Training0% | 0% | 0% | 33% | 66%
lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference0% | 0% | 0% | 6% | 93%
lab/simulator0% | 0% | 0% | 3% | 96%
setup0% | 0% | 0% | 0% | 100%
lab/01-Data-Visualization0% | 0% | 0% | 0% | 100%
lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.00% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __detect_anomalies__()
in lab/03-Package-Deploy/iot-jobs/app/windfarm.py
29 10 1
def __on_message__()
in lab/03-Package-Deploy/iot-jobs/app/ota.py
21 9 4
def train()
in lab/02-Training/wind_turbine.py
39 8 1
def __init__()
in lab/03-Package-Deploy/iot-jobs/app/windfarm.py
21 7 4
def __process_job__()
in lab/03-Package-Deploy/iot-jobs/app/ota.py
42 7 3
def is_noise_enabled()
in lab/simulator/turbine.py
7 6 2
def __init__()
in lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference/windturbine.py
33 6 5
def __init__()
in lab/03-Package-Deploy/iot-jobs/app/ota.py
40 6 7
def is_noise_enabled()
in lab/03-Package-Deploy/iot-jobs/app/turbine.py
7 6 2
def setup_agent()
in setup/run.py
52 5 4
def __init__()
in lab/simulator/turbine.py
41 5 4
def __prep_turbine_sample__()
in lab/simulator/turbine.py
6 5 2
def train_epoch()
in lab/02-Training/wind_turbine.py
17 5 6
def predict()
in lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference/edgeagentclient.py
25 5 4
def predict()
in lab/03-Package-Deploy/iot-jobs/app/edgeagentclient.py
25 5 4
def __init__()
in lab/03-Package-Deploy/iot-jobs/app/simulator.py
17 5 2
def __prep_turbine_sample__()
in lab/03-Package-Deploy/iot-jobs/app/simulator.py
8 5 3
def start()
in lab/03-Package-Deploy/iot-jobs/app/simulator.py
7 5 1
def __update_dashboard__()
in lab/simulator/simulator.py
8 4 3
def notify_model_update()
in lab/03-Package-Deploy/iot-jobs/app/windfarm.py
17 4 4