aws-samples / amazon-sagemaker-edge-manager-demo
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 54 units with 806 lines of code in units (77.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (155 lines of code)
    • 4 simple units (151 lines of code)
    • 47 very simple units (500 lines of code)
0% | 0% | 19% | 18% | 62%
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
ino0% | 0% | 68% | 30% | <1%
py0% | 0% | 10% | 16% | 72%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
02_Firmware/windturbine0% | 0% | 68% | 30% | <1%
04_EdgeApplication/report0% | 0% | 75% | 0% | 25%
04_EdgeApplication/turbine0% | 0% | 0% | 20% | 79%
04_EdgeApplication0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
ino
void loop()
in 02_Firmware/windturbine/windturbine.ino
80 16 0
def lambda_handler()
in 04_EdgeApplication/report/lambda_ingest_logs_cloudwatch.py
31 12 2
def lambda_handler()
in 04_EdgeApplication/report/lambda_ingest_logs_elasticsearch.py
44 12 2
def __on_message__()
in 04_EdgeApplication/turbine/ota.py
25 9 4
def __init__()
in 04_EdgeApplication/turbine/ota.py
41 7 7
def __process_job__()
in 04_EdgeApplication/turbine/ota.py
49 7 3
ino
void setup()
in 02_Firmware/windturbine/windturbine.ino
36 6 0
def predict()
in 04_EdgeApplication/turbine/edgeagentclient.py
25 5 4
def publish_logs()
in 04_EdgeApplication/turbine/logger.py
11 3 2
def create_tensor()
in 04_EdgeApplication/turbine/edgeagentclient.py
9 3 3
def load_model()
in 04_EdgeApplication/turbine/edgeagentclient.py
13 3 3
def unload_model()
in 04_EdgeApplication/turbine/edgeagentclient.py
12 3 2
def euler_from_quaternion()
in 04_EdgeApplication/turbine/util.py
12 3 4
def put_events()
in 04_EdgeApplication/report/lambda_ingest_logs_cloudwatch.py
14 2 2
def put_record()
in 04_EdgeApplication/report/lambda_ingest_logs_elasticsearch.py
11 2 2
def model_update_callback()
in 04_EdgeApplication/run.py
10 2 2
def readline()
in 04_EdgeApplication/run.py
7 2 1
def __upload_logs__()
in 04_EdgeApplication/turbine/logger.py
15 2 1
def model_update_check()
in 04_EdgeApplication/turbine/ota.py
6 2 1
def __init__()
in 04_EdgeApplication/turbine/edgeagentclient.py
5 2 2