reactjs / server-components-demo
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 32 units with 436 lines of code in units (27.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (85 lines of code)
    • 6 medium size units (155 lines of code)
    • 7 small units (88 lines of code)
    • 18 very small units (108 lines of code)
0% | 19% | 35% | 20% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 19% | 35% | 20% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 27% | 42% | 8% | 21%
scripts0% | 0% | 83% | 0% | 16%
server0% | 0% | 0% | 63% | 36%
Alternative Visuals
Longest Units
Top 32 longest units
Unit# linesMcCabe index# params
85 8 3
36 1 0
26 1 0
26 1 0
25 2 0
21 1 3
21 3 1
13 1 2
13 3 0
13 2 1
13 1 0
12 2 3
12 1 2
12 1 2
10 1 0
10 1 0
9 2 1
9 1 1
9 1 1
8 1 2
7 1 1
6 1 2
6 1 0
6 1 0
5 1 2
5 1 2
4 1 2
4 1 1
3 1 0
3 1 0
2 1 2
2 1 2