aws-samples / aws-iot-things-graph-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 34 units with 695 lines of code in units (22.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (112 lines of code)
    • 0 medium complex units (0 lines of code)
    • 2 simple units (161 lines of code)
    • 31 very simple units (422 lines of code)
0% | 16% | 0% | 23% | 60%
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% | 16% | 0% | 23% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
services0% | 16% | 0% | 23% | 59%
scripts0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def get_current_value()
in services/read-gauge.py
112 29 11
def calibrate_gauge()
in services/read-gauge.py
86 10 4
def handler()
in services/create-iot-thing.py
75 6 2
def handler()
in services/read-gauge.py
39 5 2
def changeLights()
in services/lights.py
16 5 2
def main()
in scripts/stringify-model.py
14 5 1
def process_image()
in services/read-gauge-ml.py
21 4 1
def handler()
in services/s3-new-image-event.py
21 3 2
def buttonListener()
in services/button.py
10 3 1
def handler()
in services/publish-reading.py
24 3 2
def avg_circles()
in services/read-gauge.py
12 3 2
def handler()
in services/button.py
9 2 2
def main()
in services/button.py
3 2 0
def handler()
in services/identify-gauge-type.py
10 2 2
def get_image()
in services/read-gauge.py
13 2 3
def handler()
in services/lambda-proxy.py
28 2 2
def handler()
in services/read-sqs-payload.py
18 2 2
def handler()
in services/lights.py
10 2 2
def handler()
in services/read-gauge-ml.py
22 2 2
def get_image()
in services/read-gauge-ml.py
5 2 2