aws-samples / digital-user-engagement-reference-architectures
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 43 units with 655 lines of code in units (7.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (73 lines of code)
    • 7 medium size units (233 lines of code)
    • 18 small units (254 lines of code)
    • 17 very small units (95 lines of code)
0% | 11% | 35% | 38% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 11% | 35% | 38% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
integrations/amplitude-sam/src/handlers/s3-trigger-processor0% | 41% | 21% | 34% | 2%
lambda/Message_Archiver/archiver/lib0% | 0% | 43% | 44% | 11%
integrations/amplitude-sam/src/handlers/sqs-queue-processor0% | 0% | 77% | 22% | 0%
lambda/Message_Archiver/queuer/lib0% | 0% | 0% | 38% | 61%
lambda/Message_Archiver/queuer0% | 0% | 0% | 0% | 100%
lambda/Message_Archiver/archiver0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest 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
getCampaignContent()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
43 2 3
async function createSegment()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
38 2 2
getJourneyContent()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
35 1 3
generateMimeBody()
in lambda/Message_Archiver/archiver/lib/archiver.js
26 3 3
constructor()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
22 1 1
archive()
in lambda/Message_Archiver/archiver/lib/archiver.js
21 2 4
async function getFile()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
20 2 2
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
getCompilers()
in lambda/Message_Archiver/archiver/lib/renderer.js
16 3 2
getEmailTemplateContent()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
16 2 1
async function sendMessageToQueue()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
15 2 4
async function decompressFile()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
14 2 2
async function getUserEndpoints()
in integrations/amplitude-sam/src/handlers/sqs-queue-processor/index.js
14 2 2
getInlineCampaignContent()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
14 2 1
getVoiceTemplate()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
14 2 1
async function getSegments()
in integrations/amplitude-sam/src/handlers/s3-trigger-processor/index.js
13 2 1
getPushContent()
in lambda/Message_Archiver/archiver/lib/pinpoint.js
13 2 1