aws-samples / connected-vehicle-lab
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 899 units with 12,063 lines of code in units (76.4% of code).
    • 3 very complex units (1,085 lines of code)
    • 5 complex units (398 lines of code)
    • 52 medium complex units (2,282 lines of code)
    • 93 simple units (1,860 lines of code)
    • 746 very simple units (6,438 lines of code)
8% | 3% | 18% | 15% | 53%
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
js9% | 3% | 18% | 15% | 53%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
digital-shadow/demo-car/js/aws-iot9% | 3% | 19% | 15% | 51%
digital-shadow/demo-car/js0% | 0% | 0% | 7% | 92%
vehicle-command/lambda/custom0% | 0% | 0% | 0% | 100%
digital-shadow/connected-vehicle-app-cdk/lib0% | 0% | 0% | 0% | 100%
digital-shadow/tcu0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
(function (global)()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
712 211 1
Url.prototype.resolveObject = function()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
201 105 1
Url.prototype.parse = function()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
172 65 3
function connect()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
112 48 1
(function (global)()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
108 38 1
function formatValue()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
80 31 3
Url.prototype.format = function()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
44 30 0
Readable.prototype.read = function()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
54 26 1
Readable.prototype.read = function()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
49 25 1
function utf8Slice()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
63 24 3
function readableAddChunk()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
38 23 5
module.exports = function()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
61 22 1
function byteLength()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
40 22 2
function slowToString()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
46 22 3
function utf8ToBytes()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
60 22 2
(function (global)()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
65 22 1
BufferList.prototype.copy = function()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
48 21 4
_doProcessBlock: function()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
128 21 2
function bidirectionalIndexOf()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
44 20 5
function arrayIndexOf()
in digital-shadow/demo-car/js/aws-iot/aws-iot.js
37 19 5