reactjs / tl.reactjs.org
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 190 units with 3,748 lines of code in units (29.7% of code).
    • 6 very long units (997 lines of code)
    • 8 long units (567 lines of code)
    • 25 medium size units (825 lines of code)
    • 63 small units (911 lines of code)
    • 88 very small units (448 lines of code)
26% | 15% | 22% | 24% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js36% | 12% | 8% | 26% | 15%
tsx19% | 17% | 31% | 22% | 8%
ts0% | 0% | 63% | 26% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
beta/src18% | 16% | 32% | 22% | 9%
src/components55% | 19% | 10% | 9% | 5%
src/pages94% | 0% | 0% | 4% | <1%
src/templates0% | 34% | 14% | 31% | 19%
src0% | 0% | 28% | 51% | 20%
beta/scripts0% | 0% | 0% | 83% | 16%
scripts0% | 0% | 0% | 93% | 6%
src/utils0% | 0% | 0% | 70% | 29%
ROOT0% | 0% | 0% | 100% | 0%
beta/plugins0% | 0% | 0% | 34% | 65%
gatsby0% | 0% | 0% | 52% | 47%
beta/public0% | 0% | 0% | 0% | 100%
static/js0% | 0% | 0% | 0% | 100%
beta0% | 0% | 0% | 0% | 100%
plugins/gatsby-remark-header-custom-ids0% | 0% | 0% | 0% | 100%
plugins/gatsby-transformer-versions-yaml0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
263 2 0
186 5 0
151 24 2
148 5 0
134 1 0
115 5 6
97 8 0
78 12 3
78 12 4
74 1 0
66 5 5
62 2 0
58 13 9
54 3 0
47 6 4
44 9 3
40 4 1
40 9 7
40 3 0
39 2 0
38 4 0
38 1 0
36 2 2
35 1 0
35 3 0
34 4 2
34 3 7
34 3 4
33 7 3
32 2 3
30 5 5
29 1 8
26 5 8
26 4 2
25 2 1
24 1 2
22 2 3
22 5 3
22 3 2
20 2 0
20 6 1
20 1 1
19 5 0
19 1 1
19 7 1
18 3 1
18 1 1
18 1 1
18 3 1
18 1 1