aws-samples / simple-smart-mirror
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 226 units with 1,569 lines of code in units (58.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (186 lines of code)
    • 9 simple units (200 lines of code)
    • 213 very simple units (1,183 lines of code)
0% | 0% | 11% | 12% | 75%
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% | 11% | 12% | 75%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
smart-mirror-full/extracted/device/script/src/agt0% | 0% | 32% | 15% | 52%
smart-mirror-full/extracted/device/script0% | 0% | 20% | 28% | 50%
smart-mirror-full/extracted/device/script/src/agt/ble0% | 0% | 0% | 5% | 94%
smart-mirror-full/extracted/device/script/src/agt/bt_classic0% | 0% | 0% | 4% | 95%
smart-mirror-full/extracted/lambda/custom0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __init__()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
54 24 2
def on_alexa_discovery_discover()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
48 14 2
def loop()
in smart-mirror-full/extracted/device/script/agt_smart_mirror.py
32 13 1
def intro()
in smart-mirror-full/extracted/device/script/smart_mirror.py
52 13 1
def blink_color()
in smart-mirror-full/extracted/device/script/smart_mirror.py
25 10 4
def _main_thread()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
15 8 1
def main()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
33 7 1
def readParameters()
in smart-mirror-full/extracted/device/script/parameter_store_helper.py
28 7 1
def __init__()
in smart-mirror-full/extracted/device/script/agt_smart_mirror.py
20 6 1
def on_alerts_setalert()
in smart-mirror-full/extracted/device/script/agt_smart_mirror.py
27 6 2
def property_changed()
in smart-mirror-full/extracted/device/script/src/agt/ble/adapter.py
20 6 5
def _state_get_data()
in smart-mirror-full/extracted/device/script/src/agt/bt_classic/adapter.py
14 6 2
def wheel()
in smart-mirror-full/extracted/device/script/smart_mirror.py
18 6 2
def on_alexa_gadget_statelistener_stateupdate()
in smart-mirror-full/extracted/device/script/agt_smart_mirror.py
10 5 2
def _create_eir()
in smart-mirror-full/extracted/device/script/src/agt/bt_classic/adapter.py
15 5 1
def _load_gadget_config()
in smart-mirror-full/extracted/device/script/src/agt/alexa_gadget.py
11 5 2
def initializePixels()
in smart-mirror-full/extracted/device/script/smart_mirror.py
7 5 1
def _find_device()
in smart-mirror-full/extracted/device/script/src/agt/base_adapter.py
9 4 2
def GetManagedObjects()
in smart-mirror-full/extracted/device/script/src/agt/ble/adapter.py
12 4 1
def get_scan_resp_data()
in smart-mirror-full/extracted/device/script/src/agt/ble/adapter.py
13 4 1