reactjs / react-docgen
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 237 units with 4,308 lines of code in units (80.9% of code).
    • 1 very long units (101 lines of code)
    • 12 long units (735 lines of code)
    • 58 medium size units (1,770 lines of code)
    • 71 small units (1,077 lines of code)
    • 95 very small units (625 lines of code)
2% | 17% | 41% | 25% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts2% | 17% | 41% | 25% | 13%
js0% | 0% | 16% | 24% | 58%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/utils3% | 18% | 39% | 26% | 13%
src/handlers0% | 27% | 45% | 19% | 6%
src/resolver0% | 0% | 59% | 26% | 13%
src/importer0% | 0% | 61% | 0% | 38%
src0% | 0% | 29% | 44% | 25%
website/src/components0% | 0% | 20% | 29% | 49%
benchmark/fixtures0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
101 35 2
87 23 3
68 1 1
67 26 3
67 10 4
64 13 2
61 17 3
57 11 4
55 12 3
53 20 3
53 14 1
52 15 3
51 12 3
47 14 1
44 17 2
43 14 2
43 9 1
43 8 4
42 11 1
42 15 3
41 16 2
40 12 2
39 13 2
37 7 3
37 11 1
36 10 3
36 7 3
36 7 3
35 4 3
34 16 3
34 1 1
33 8 1
32 3 1
32 10 2
31 10 3
31 9 4
30 8 2
30 8 5
30 12 2
30 5 1
30 7 2
30 6 1
29 12 1
29 6 2
29 8 3
29 7 2
28 7 3
28 3 3
27 6 3
27 6 1