aws-samples / aws-jp-iot-samples
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 29 units with 413 lines of code in units (77.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)
    • 1 simple units (12 lines of code)
    • 28 very simple units (401 lines of code)
0% | 0% | 0% | 2% | 97%
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% | 2% | 97%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
aws-iot-events-for-beginners0% | 0% | 0% | 11% | 88%
aws-iot-greengrass-for-beginners/alert0% | 0% | 0% | 0% | 100%
aws-iot-greengrass-for-beginners/sensor0% | 0% | 0% | 0% | 100%
aws-iot-core-raspberrypi-gpio0% | 0% | 0% | 0% | 100%
amazon-kinesis-video-streams-workshop-jp0% | 0% | 0% | 0% | 100%
aws-iot-greengrass-for-beginners/lambda0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def find_certs_file()
in aws-iot-events-for-beginners/main.py
12 6 0
def discover_gg_host()
in aws-iot-greengrass-for-beginners/alert/main.py
45 5 0
def discover_gg_host()
in aws-iot-greengrass-for-beginners/sensor/main.py
45 5 0
def arg_check()
in aws-iot-events-for-beginners/main.py
39 5 0
def find_cert_file()
in aws-iot-greengrass-for-beginners/alert/main.py
6 4 1
def on_connection_resumed()
in aws-iot-greengrass-for-beginners/alert/main.py
9 4 4
def find_cert_file()
in aws-iot-greengrass-for-beginners/sensor/main.py
6 4 1
def main()
in aws-iot-core-raspberrypi-gpio/main.py
27 4 0
def file_exist_check()
in aws-iot-events-for-beginners/main.py
5 4 1
def on_resubscribe_complete()
in aws-iot-greengrass-for-beginners/alert/main.py
6 3 1
def device_main()
in aws-iot-greengrass-for-beginners/alert/main.py
12 3 0
def exit_sample()
in aws-iot-greengrass-for-beginners/alert/main.py
14 3 1
def exit_sample()
in aws-iot-greengrass-for-beginners/sensor/main.py
14 3 1
def process_record()
in amazon-kinesis-video-streams-workshop-jp/lambda_function.py
16 3 1
def exit_sample()
in aws-iot-events-for-beginners/main.py
10 3 1
def arg_check()
in aws-iot-greengrass-for-beginners/alert/main.py
31 2 0
def arg_check()
in aws-iot-greengrass-for-beginners/sensor/main.py
31 2 0
def device_main()
in aws-iot-greengrass-for-beginners/sensor/main.py
15 2 0
def lambda_handler()
in aws-iot-greengrass-for-beginners/lambda/lambda_function.py
8 2 2
def lambda_handler()
in amazon-kinesis-video-streams-workshop-jp/lambda_function.py
4 2 2