aws-solutions / smart-product-solution
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 133 units with 4,696 lines of code in units (27.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 10 medium complex units (984 lines of code)
    • 20 simple units (880 lines of code)
    • 103 very simple units (2,832 lines of code)
0% | 0% | 20% | 18% | 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% | 0% | 21% | 28% | 50%
ts0% | 0% | 20% | 0% | 79%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/services/api0% | 0% | 36% | 34% | 28%
deployment/custom-deployment/lib0% | 0% | 20% | 0% | 79%
source/services/notification0% | 0% | 40% | 34% | 24%
source/resources/helper0% | 0% | 0% | 21% | 78%
source/services/event-proxy0% | 0% | 0% | 81% | 19%
source/services/jitr0% | 0% | 0% | 46% | 53%
source/resources/authorizer0% | 0% | 0% | 0% | 100%
source/resources/cicd0% | 0% | 0% | 0% | 100%
source/services/command-status0% | 0% | 0% | 0% | 100%
source/resources/usage-metrics0% | 0% | 0% | 0% | 100%
deployment/manifest-generator0% | 0% | 0% | 0% | 100%
source/resources/logger0% | 0% | 0% | 0% | 100%
source/services/telemetry0% | 0% | 0% | 0% | 100%
source/resources/cognito0% | 0% | 0% | 0% | 100%
source/resources/utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
async createCommand()
in source/services/api/command/lib/command.js
87 22 3
async createRegistration()
in source/services/api/registration/lib/registration.js
91 16 2
async sendAlert()
in source/services/notification/lib/alert.js
79 15 1
async _getAlertsPage()
in source/services/api/event/lib/event.js
80 13 6
async getDeviceStatus()
in source/services/api/status/lib/status.js
68 12 2
constructor()
in deployment/custom-deployment/lib/smart-product-solution-stack.ts
334 12 3
async deleteDevice()
in source/services/api/device/lib/device.js
80 11 2
async getEvent()
in source/services/api/event/lib/event.js
49 11 3
async _getEventHistoryPage()
in source/services/api/event/lib/event.js
67 11 6
async getCommand()
in source/services/api/command/lib/command.js
49 11 3
async createEvent()
in source/services/event-proxy/lib/message.js
55 10 1
async _getEventsPage()
in source/services/api/event/lib/event.js
54 9 4
async _getCommandsPage()
in source/services/api/command/lib/command.js
54 9 4
async _registrationUpdate()
in source/services/jitr/lib/jitrHelper.js
67 9 1
async updateEvent()
in source/services/api/event/lib/event.js
45 8 3
async _getAlertsCount()
in source/services/api/event/lib/event.js
59 8 3
async _getDeviceRegistration()
in source/services/notification/lib/alert.js
36 8 1
_setContentType()
in source/resources/helper/lib/s3-helper.js
17 7 1
async _getRegistrationPage()
in source/services/api/registration/lib/registration.js
41 7 2
async _validateUserDeviceRegistration()
in source/services/api/status/lib/status.js
29 7 2