aws-samples / digital-user-engagement-reference-architectures
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 43 units with 655 lines of code in units (7.6% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (73 lines of code)
    • 2 simple units (60 lines of code)
    • 40 very simple units (522 lines of code)
0% | 0% | 11% | 9% | 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% | 11% | 9% | 79%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
integrations/amplitude-sam/src/handlers/s3-trigger-processor0% | 0% | 41% | 0% | 58%
integrations/amplitude-sam/src/handlers/sqs-queue-processor0% | 0% | 0% | 77% | 22%
lambda/Message_Archiver/archiver/lib0% | 0% | 0% | 3% | 96%
lambda/Message_Archiver/queuer/lib0% | 0% | 0% | 0% | 100%
lambda/Message_Archiver/queuer0% | 0% | 0% | 0% | 100%
lambda/Message_Archiver/archiver0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
async function main()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
73 12 1
async function upsertEndpoints()
in integrations/amplitude-sam/src/handlers/sqs-queue-processor/index.js
48 8 1
getCampaignTemplateContent()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
12 7 1
getCompilers()
in lambda/Message_Archiver/archiver/lib/renderer.js
16 3 2
generateMimeBody()
in lambda/Message_Archiver/archiver/lib/archiver.js
26 3 3
async function decompressFile()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
14 2 2
async function getSegments()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
13 2 1
async function getFile()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
20 2 2
async function createSegment()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
38 2 2
async function sendMessageToQueue()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
15 2 4
async function getUserEndpoints()
in integrations/amplitude-sam/src/handlers/sqs-queue-processor/index.js
14 2 2
const generateFilePath = function()
in lambda/Message_Archiver/queuer/lib/s3Path.js
9 2 2
function uuidv4()
in lambda/Message_Archiver/queuer/lib/s3Path.js
6 2 0
promiseFromRecord()
in lambda/Message_Archiver/queuer/lib/processor.js
18 2 2
async render()
in lambda/Message_Archiver/archiver/lib/renderer.js
18 2 4
archive()
in lambda/Message_Archiver/archiver/lib/archiver.js
21 2 4
parseS3FilePath()
in lambda/Message_Archiver/archiver/lib/archiver.js
8 2 1
determineTemplateOrCampaign()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
5 2 1
getCachedCampaignContent()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
11 2 3
getCampaignContent()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
43 2 3