aws-solutions / iot-device-simulator
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 123 units with 3,180 lines of code in units (54.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (149 lines of code)
    • 8 medium complex units (636 lines of code)
    • 12 simple units (478 lines of code)
    • 102 very simple units (1,917 lines of code)
0% | 4% | 20% | 15% | 60%
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% | 10% | 13% | 27% | 47%
tsx0% | 0% | 45% | 13% | 41%
ts0% | 0% | 12% | 0% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
microservices/lib0% | 28% | 0% | 34% | 37%
console/src0% | 0% | 51% | 10% | 38%
simulator/lib0% | 0% | 22% | 24% | 53%
infrastructure/lib0% | 0% | 0% | 0% | 100%
custom-resource0% | 0% | 0% | 0% | 100%
microservices/metrics0% | 0% | 0% | 0% | 100%
infrastructure/utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
static async _processRequest()
in source/microservices/lib/responseManager.js
149 32 1
export default function SimulationCreate()
in source/console/src/views/SimulationCreate.tsx
209 25 1
_processSpecAttribute()
in source/simulator/lib/device/generators/random/generator.js
99 24 1
iterate()
in source/simulator/lib/device/generators/vehicle/dynamics/route-calc.js
96 22 1
export default function ModalForm()
in source/console/src/components/DeviceTypeCreate/ModalForm.tsx
97 19 1
export function verifyAttributeField()
in source/console/src/util/Utils.ts
24 15 2
export function validateFileContents()
in source/console/src/util/Utils.ts
36 13 1
export function validatePayload()
in source/console/src/util/Utils.ts
47 13 1
export function validateField()
in source/console/src/util/Utils.ts
28 13 2
async getDeviceType()
in source/microservices/lib/simulationManager.js
47 9 2
async _initializeData()
in source/simulator/lib/device/generators/vehicle/dynamics/dynamics-model.js
44 9 1
export default function DeviceTypeCreate()
in source/console/src/views/DeviceTypeCreate.tsx
87 9 1
async createDeviceType()
in source/microservices/lib/deviceTypeManager.js
40 8 1
async createSimulation()
in source/microservices/lib/simulationManager.js
50 8 1
async updateSimulation()
in source/microservices/lib/simulationManager.js
45 8 2
generateMessagePayload()
in source/simulator/lib/device/generators/vehicle/generator.js
36 8 3
constructor()
in source/simulator/lib/device/generators/vehicle/generator.js
13 6 1
async getRoute()
in source/simulator/lib/device/generators/vehicle/dynamics/dynamics-model.js
23 6 1
_getSnapshotData()
in source/simulator/lib/device/generators/vehicle/dynamics/dynamics-model.js
33 6 0
iterate()
in source/simulator/lib/device/generators/vehicle/dynamics/oil-temp-calc.js
24 6 1