awslabs / amazon-s3-glacier-refreezer
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 134 units with 3,202 lines of code in units (80.8% of code).
    • 6 very long units (897 lines of code)
    • 5 long units (379 lines of code)
    • 29 medium size units (844 lines of code)
    • 52 small units (833 lines of code)
    • 42 very small units (249 lines of code)
28% | 11% | 26% | 26% | 7%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts54% | 21% | 9% | 13% | 1%
js5% | 3% | 40% | 36% | 12%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/lib54% | 21% | 9% | 13% | 1%
source/lambda/requestArchives41% | 0% | 31% | 21% | 5%
source/lambda/requestInventory0% | 34% | 37% | 15% | 12%
source/lambda/calculateTreehash0% | 0% | 36% | 47% | 15%
source/lambda/copyChunk0% | 0% | 39% | 42% | 17%
source/lambda/postMetrics0% | 0% | 80% | 19% | 0%
source/lambda/copyToDestinationBucket0% | 0% | 32% | 47% | 20%
source/lambda/sendAnonymousStats0% | 0% | 85% | 0% | 14%
source/lambda/splitArchive0% | 0% | 31% | 51% | 17%
source/lambda/deployGlueJobScript0% | 0% | 49% | 28% | 22%
source/lambda/toLowercase0% | 0% | 65% | 34% | 0%
source/lambda/generateUuid0% | 0% | 65% | 34% | 0%
source/lambda/calculateMetrics0% | 0% | 36% | 45% | 18%
source/lambda/downloadInventory0% | 0% | 0% | 72% | 27%
source/lambda/downloadInventoryPart0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/lib/stage-two-orchestrator.ts
222 3 3
constructor()
in source/lib/monitoring.ts
164 2 3
constructor()
in source/lib/amazon-s3-glacier-refreezer-stack.ts
159 1 3
constructor()
in source/lib/stage-two.ts
128 1 3
constructor()
in source/lib/glue-data-catalog.ts
123 2 3
async function handler()
in source/lambda/requestArchives/index.js
101 11 1
constructor()
in source/lib/stage-three.ts
97 1 3
constructor()
in source/lib/stage-four.ts
90 1 3
constructor()
in source/lib/stage-one.ts
70 1 3
async function handler()
in source/lambda/requestInventory/index.js
67 13 2
constructor()
in source/lib/ddb-data-catalog.ts
55 1 2
async function handler()
in source/lambda/postMetrics/index.js
50 40 0
async function failArchiveAndRetry()
in source/lambda/calculateTreehash/index.js
47 3 2
async function processAndSendChunkMessage()
in source/lambda/splitArchive/index.js
37 3 3
constructor()
in source/lib/solution-builders-anonymous-statistics.ts
36 1 3
constructor()
in source/lib/s3-staging-bucket.ts
35 1 2
async function multiChunkCopy()
in source/lambda/copyChunk/index.js
34 5 9
async function copyMultiPart()
in source/lambda/copyToDestinationBucket/lib/copy.js
34 6 6
async function handler()
in source/lambda/calculateTreehash/index.js
32 9 1
for await()
in source/lambda/calculateTreehash/lib/treehash.js
31 5 1