aws-samples / aws-iot-kickstart
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 696 units with 7,665 lines of code in units (31.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (433 lines of code)
    • 27 simple units (1,166 lines of code)
    • 664 very simple units (6,066 lines of code)
0% | 0% | 5% | 15% | 79%
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
js0% | 0% | 18% | 22% | 58%
py0% | 0% | 3% | 31% | 65%
ts0% | 0% | 0% | 7% | 92%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/services/deployments0% | 0% | 55% | 16% | 27%
source/services/devices0% | 0% | 25% | 6% | 68%
source/cf/defaults0% | 0% | 3% | 31% | 65%
source/console/src0% | 0% | 0% | 7% | 92%
source/services/just-in-time-on-boarding0% | 0% | 0% | 100% | 0%
source/services/systems0% | 0% | 0% | 65% | 34%
source/services/admin0% | 0% | 0% | 22% | 77%
source/resources/cf-helper-s30% | 0% | 0% | 12% | 87%
source/resources/utils0% | 0% | 0% | 0% | 100%
source/resources/usage-metrics0% | 0% | 0% | 0% | 100%
source/services/settings0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
module.exports = function()
in source/services/deployments/lib/addDeployment.js
195 22 2
function extend()
in source/services/deployments/lib/merge-sputnik-specs.js
68 17 3
def set_pixel()
in source/cf/defaults/lambdas/sputnik-rpi-sense-hat-demo-python/sense_hat/sense_hat.py
21 11 4
def lambda_handler()
in source/cf/defaults/lambdas/sputnik-rpi-sense-hat-demo-python/lambda_function.py
21 11 2
module.exports = function()
in source/services/devices/lib/updateDevice.js
128 11 2
function handler()
in source/services/admin/index.js
40 10 3
function handler()
in source/services/just-in-time-on-boarding/index.js
161 10 3
def parseIncomingShadow()
in source/cf/defaults/lambdas/sputnik-rpi-sense-hat-demo-python/lambda_function.py
17 9 1
def __init__()
in source/cf/defaults/lambdas/sputnik-gg-ml-inference-squeezenet-demo-python/load_model.py
22 9 7
def set_pixels()
in source/cf/defaults/lambdas/sputnik-rpi-sense-hat-demo-python/sense_hat/sense_hat.py
14 8 2
def greengrass_run()
in source/cf/defaults/lambdas/sputnik-simple-greengrass-device-demo-python/lambda_function.py
55 8 0
submit()
in source/console/src/app/secure/systems/systems.modal.component.ts
57 8 0
function handler()
in source/services/devices/index.js
34 8 3
function _isStrongEnough()
in source/services/admin/lib/generatePassword.js
18 8 1
module.exports = function()
in source/services/deployments/lib/createGreengrassXDefinitionVersion.js
77 8 3
def __init__()
in source/cf/defaults/lambdas/sputnik-rpi-sense-hat-demo-python/sense_hat/sense_hat.py
51 7 3
def set_imu_config()
in source/cf/defaults/lambdas/sputnik-rpi-sense-hat-demo-python/sense_hat/sense_hat.py
15 7 4
ngOnInit()
in source/console/src/app/secure/child-views/devices/default-device/default-device.component.ts
51 7 0
ngOnInit()
in source/console/src/app/secure/child-views/systems/default-system/default-system.component.ts
40 7 0
ngOnInit()
in source/console/src/app/common/modules/graph-line/graph-line.component.ts
91 7 0