facebookexperimental / Recoil
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 451 units with 8,375 lines of code in units (58.0% of code).
    • 7 very long units (1,703 lines of code)
    • 17 long units (1,179 lines of code)
    • 74 medium size units (2,414 lines of code)
    • 122 small units (1,772 lines of code)
    • 231 very small units (1,307 lines of code)
20% | 14% | 28% | 21% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js20% | 14% | 28% | 21% | 15%
ts0% | 0% | 58% | 0% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages-ext/recoil-devtools/src36% | 7% | 32% | 15% | 7%
packages/recoil/recoil_values34% | 26% | 12% | 18% | 7%
packages/recoil-sync20% | 35% | 32% | 6% | 5%
packages/recoil/core9% | 0% | 42% | 26% | 21%
packages/recoil/hooks0% | 28% | 36% | 16% | 17%
packages/shared/util0% | 15% | 13% | 39% | 30%
packages/recoil/contrib0% | 0% | 82% | 0% | 17%
packages/shared/__test_utils__0% | 0% | 26% | 54% | 19%
packages/refine0% | 0% | 18% | 46% | 34%
packages/recoil-sync/__test_utils__0% | 0% | 70% | 0% | 29%
typescript0% | 0% | 58% | 0% | 41%
packages/recoil/caches0% | 0% | 19% | 37% | 42%
eslint-rules0% | 0% | 85% | 0% | 14%
packages/recoil/adt0% | 0% | 0% | 16% | 83%
packages/shared/polyfill0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
packages-ext/recoil-devtools/utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
344 49 1
341 49 1
302 34 1
300 33 26
155 35 3
134 26 5
127 15 5
95 8 1
93 17 5
84 5 0
82 12 1
77 15 6
71 7 1
69 9 6
68 10 3
68 7 1
68 14 1
65 24 3
63 6 1
59 10 1
59 8 1
54 5 1
53 13 1
51 7 1
50 16 1
50 2 2
49 9 1
49 11 1
48 9 1
48 2 7
47 6 1
47 6 5
45 7 6
45 6 1
42 6 2
42 9 3
42 3 3
41 6 1
40 9 0
40 4 1
39 5 5
39 4 3
39 10 2
39 4 6
38 1 4
38 6 3
38 5 2
38 6 7
38 9 3
37 13 1