aws-samples / smart-cooler
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 150 units with 1,246 lines of code in units (39.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (245 lines of code)
    • 8 simple units (177 lines of code)
    • 138 very simple units (824 lines of code)
0% | 0% | 19% | 14% | 66%
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% | 25% | 8% | 66%
js0% | 0% | 0% | 34% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
detection-function0% | 0% | 24% | 11% | 63%
purchase-function0% | 0% | 34% | 0% | 65%
qr-reader-function0% | 0% | 54% | 0% | 45%
SmartCoolerCharge0% | 0% | 0% | 34% | 65%
SmartCoolerScan0% | 0% | 0% | 34% | 65%
door-sensor-function0% | 0% | 0% | 100% | 0%
authentication-function0% | 0% | 0% | 0% | 100%
qr-monitoring-function0% | 0% | 0% | 0% | 100%
update-product-function0% | 0% | 0% | 0% | 100%
update-product-local-function0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def print_()
in detection-function/src/six.py
50 22 2
def transaction()
in purchase-function/src/purchase.py
96 17 2
def extract_bounding_boxes()
in detection-function/src/run.py
57 13 1
def reading_qr_run()
in qr-reader-function/src/qr_reader.py
42 11 0
def get_iou()
in detection-function/src/run.py
22 8 2
def ensure_str()
in detection-function/src/six.py
10 8 3
def run_loop()
in door-sensor-function/src/door_sensor.py
34 7 0
exports.prepareOptions = function()
in SmartCoolerCharge/clientHelper.js
14 7 2
exports.prepareOptions = function()
in SmartCoolerScan/clientHelper.js
14 7 2
def __init__()
in detection-function/src/six.py
17 6 6
exports.signHeaders = function()
in SmartCoolerCharge/clientHelper.js
33 6 2
exports.signHeaders = function()
in SmartCoolerScan/clientHelper.js
33 6 2
def add_metaclass()
in detection-function/src/six.py
15 5 1
exports.retryLogic = function()
in SmartCoolerCharge/clientHelper.js
19 5 2
exports.retryLogic = function()
in SmartCoolerScan/clientHelper.js
19 5 2
def exec_()
in detection-function/src/six.py
10 4 3
def _update_wrapper()
in detection-function/src/six.py
14 4 4
def with_metaclass()
in detection-function/src/six.py
14 4 2
request()
in SmartCoolerCharge/clientHelper.js
9 4 4
def activate()
in authentication-function/src/components.py
8 4 3