cdklabs / aws-delivlib
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 188 units with 2,524 lines of code in units (70.2% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (417 lines of code)
    • 28 medium size units (805 lines of code)
    • 47 small units (698 lines of code)
    • 107 very small units (604 lines of code)
0% | 16% | 31% | 27% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 17% | 32% | 26% | 24%
js0% | 0% | 25% | 56% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib0% | 15% | 25% | 28% | 29%
lib/registry-sync0% | 48% | 14% | 16% | 20%
lib/pull-request0% | 35% | 11% | 23% | 28%
lib/code-signing0% | 32% | 51% | 12% | 3%
lib/custom-resource-handlers0% | 0% | 38% | 45% | 16%
lib/chime-notifier0% | 0% | 100% | 0% | 0%
lib/pipeline-watcher0% | 0% | 63% | 25% | 10%
lib/change-control-lambda0% | 0% | 41% | 14% | 43%
lib/publishing0% | 0% | 25% | 56% | 17%
lib/pipeline-notifications0% | 0% | 0% | 48% | 51%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in lib/registry-sync/ecr-mirror.ts
86 7 3
constructor()
in lib/pull-request/pr.ts
76 14 3
constructor()
in lib/open-pgp-key-pair.ts
71 3 3
constructor()
in lib/code-signing/private-key.ts
68 2 3
constructor()
in lib/shellable.ts
61 10 3
constructor()
in lib/change-controller.ts
55 7 3
constructor()
in lib/pipeline.ts
50 8 3
constructor()
in lib/pipeline-watcher/watcher.ts
50 2 3
constructor()
in lib/code-signing/certificate-signing-request.ts
39 3 3
async function _createNewKey()
in lib/custom-resource-handlers/src/pgp-secret.ts
38 2 2
async function handleEvent()
in lib/custom-resource-handlers/src/pgp-secret.ts
36 9 2
constructor()
in lib/publishing.ts
36 8 3
constructor()
in lib/code-signing/code-signing-certificate.ts
35 6 3
public prebuildCommands()
in lib/shellable.ts
34 6 2
public grantGetSecretValue()
in lib/code-signing/private-key.ts
33 2 1
constructor()
in lib/chime-notifier/chime-notifier.ts
31 2 3
export async function handler()
in lib/chime-notifier/handler/notifier-handler.ts
29 9 1
resourceVersion: hashFileOrDirectory()
in lib/open-pgp-key-pair.ts
27 3 1
constructor()
in lib/auto-build.ts
26 6 3
public bind()
in lib/registry-sync/mirror-source.ts
25 3 1