reactjs / react-a11y
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 50 units with 527 lines of code in units (25.7% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (117 lines of code)
    • 4 medium size units (125 lines of code)
    • 4 small units (52 lines of code)
    • 40 very small units (233 lines of code)
0% | 22% | 23% | 9% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 22% | 23% | 9% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 30% | 59% | 5% | 3%
src/util0% | 56% | 0% | 0% | 43%
ROOT0% | 0% | 0% | 93% | 6%
src/rules0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
64 11 4
53 4 3
40 9 1
39 13 2
25 5 3
21 11 3
15 3 1
13 2 2
12 3 1
12 1 1
9 1 1
9 5 2
9 1 1
9 6 2
9 1 1
8 2 1
8 4 2
8 5 2
8 5 4
8 6 2
7 4 2
7 4 2
7 4 2
7 5 4
6 2 2
6 3 2
6 4 2
6 3 2
6 2 2
5 3 2
5 3 1
5 2 2
5 4 2
5 2 2
5 2 2
5 2 2
5 2 2
5 2 2
5 2 2
4 2 2
4 1 0
4 1 0
4 2 2
4 2 2
4 2 2
4 1 2
3 1 1
3 1 2
3 1 1
3 1 1