awslabs / lambda-streams-to-firehose
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 28 units with 520 lines of code in units (82.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (62 lines of code)
    • 10 medium size units (345 lines of code)
    • 3 small units (47 lines of code)
    • 14 very small units (66 lines of code)
0% | 11% | 66% | 9% | 12%
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% | 66% | 9% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 11% | 66% | 9% | 12%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
62 12 4
46 12 1
function init()
in index.js
43 11 1
41 8 5
41 9 4
40 6 4
29 6 1
28 6 5
28 6 5
26 9 2
23 6 4
init()
in index.js
19 5 1
14 3 1
14 4 5
9 2 1
8 2 4
8 3 2
setTimeout()
in index.js
7 2 5
6 3 3
5 1 3