aws-samples / aws-saas-parallel-deployments
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 17 units with 384 lines of code in units (82.2% of code).
    • 1 very long units (135 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (120 lines of code)
    • 7 small units (93 lines of code)
    • 5 very small units (36 lines of code)
35% | 0% | 31% | 24% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts39% | 0% | 27% | 23% | 10%
js0% | 0% | 65% | 34% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib39% | 0% | 27% | 23% | 10%
lib/lambdas/stream-lambda0% | 0% | 65% | 34% | 0%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
constructor()
in lib/toolchain-stack.ts
135 1 3
39 9 3
constructor()
in lib/workload-pipeline-stack.ts
33 1 3
async function startBuildCommand()
in lib/lambdas/stream-lambda/index.js
25 5 1
23 10 2
15 2 0
export function readConfig()
in lib/configtools.ts
14 3 1
14 1 0
14 3 1
exports.handler = function()
in lib/lambdas/stream-lambda/index.js
13 4 1
constructor()
in lib/component-resources-stack.ts
12 1 3
for await()
in lib/apitools.ts
11 2 1
9 1 0
constructor()
in lib/component-resources-stack.ts
8 1 3
export function saveConfig()
in lib/configtools.ts
7 2 2
7 1 1
for await()
in lib/apitools.ts
5 3 1