aws-samples / reinvent2021-tsa-bot
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 90 units with 1,650 lines of code in units (80.6% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (511 lines of code)
    • 2 medium complex units (74 lines of code)
    • 7 simple units (226 lines of code)
    • 79 very simple units (839 lines of code)
0% | 30% | 4% | 13% | 50%
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% | 34% | 4% | 15% | 45%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
TSA-demo/TSA_mecha0% | 67% | 0% | 10% | 21%
TSA-demo/TSA_voice_assistant0% | 0% | 16% | 24% | 59%
TSA-demo/TSA_rekognition0% | 0% | 0% | 28% | 71%
cloudformation-templates/lib0% | 0% | 0% | 0% | 100%
TSA-demo/TSA_flight_status0% | 0% | 0% | 0% | 100%
cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad220% | 0% | 0% | 0% | 100%
cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def getTFminiData()
in TSA-demo/TSA_mecha/finalflow-mqtt-dev-rasp.py
254 45 0
def getTFminiData()
in TSA-demo/TSA_mecha/finalflow-mqtt-dev-local.py
257 44 0
def record_phrase()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant_local.py
37 17 0
def record_phrase()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant.py
37 16 0
def word()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant_local.py
31 8 0
def main()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant_local.py
24 8 0
def word()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant.py
31 8 0
def main()
in TSA-demo/TSA_voice_assistant/raspberry_voice_assistant.py
24 8 0
def initialAvaIntroServo()
in TSA-demo/TSA_mecha/servo_actions_local.py
39 8 1
def initialAvaIntroServo()
in TSA-demo/TSA_mecha/servo_actions.py
39 8 1
def mqtt_subscribe()
in TSA-demo/TSA_rekognition/iot_sub_reko.py
38 7 0
def detect_labels_local_file()
in TSA-demo/TSA_rekognition/detect_labels_image.py
22 5 1
def processCheck()
in TSA-demo/TSA_mecha/finalflow-mqtt-dev-local.py
12 5 0
def processCheck()
in TSA-demo/TSA_mecha/finalflow-mqtt-dev-rasp.py
12 5 0
def loadflights()
in cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad22/flight.py
25 4 2
def scanflights()
in cloudformation-templates/cdk.out/asset.34e613cbed9fe6d92140a799a0714c454ff967fe816d79cb9e5cef24fdb8ad22/flight.py
16 4 2
def loadflights()
in cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture/flight.py
25 4 2
def scanflights()
in cloudformation-templates/resources/Lambda/update-flight-LasVegasdeparture/flight.py
16 4 2
def get_tsaimage()
in TSA-demo/TSA_rekognition/connect_dynamo.py
18 4 2
def on_connection_resumed()
in TSA-demo/TSA_rekognition/iot_sub_reko.py
6 4 4