facebook / react-native-website
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 64 units with 1,354 lines of code in units (31.9% of code).
    • 1 very long units (144 lines of code)
    • 7 long units (405 lines of code)
    • 14 medium size units (367 lines of code)
    • 20 small units (301 lines of code)
    • 22 very small units (137 lines of code)
10% | 29% | 27% | 22% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js10% | 29% | 27% | 22% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
sync-api-docs20% | 16% | 35% | 18% | 8%
website/src/pages0% | 39% | 25% | 26% | 8%
website0% | 75% | 0% | 16% | 8%
website/src/theme/NavbarItem0% | 75% | 0% | 24% | 0%
website/src/pages/animations0% | 0% | 0% | 37% | 62%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
144 43 1
71 2 0
61 6 1
56 12 2
55 1 0
55 1 0
54 8 1
53 9 6
39 4 1
38 6 1
35 8 1
29 9 1
26 1 0
24 6 1
24 3 0
23 1 0
22 3 1
22 5 2
22 5 2
21 3 1
21 1 0
21 1 0
19 5 1
18 1 0
18 2 0
17 6 1
17 5 1
17 2 0
17 1 0
17 2 1
16 3 2
16 1 0
15 1 0
14 2 3
13 3 1
13 4 1
13 4 1
13 1 0
12 1 3
12 6 1
12 1 1
12 1 3
10 1 1
10 2 0
9 2 1
9 2 2
9 1 3
9 1 5
9 1 0
8 2 1