facebookincubator / fbc-mobile-app-core
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 75 units with 985 lines of code in units (18.2% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (126 lines of code)
    • 13 medium size units (401 lines of code)
    • 14 small units (207 lines of code)
    • 46 very small units (251 lines of code)
0% | 12% | 40% | 21% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 28% | 32% | 23% | 15%
js0% | 0% | 47% | 18% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/@fbcmobile-signalscan/android/src0% | 28% | 32% | 23% | 15%
packages/@fbcmobile-ui/Utils0% | 0% | 57% | 6% | 35%
packages/@fbcmobile-ui/Logging0% | 0% | 50% | 20% | 28%
packages/@fbcmobile-ui/Components0% | 0% | 86% | 13% | 0%
packages/@fbcmobile-ui/Hooks0% | 0% | 0% | 76% | 23%
packages/@fbcmobile-ui/Services0% | 0% | 0% | 31% | 68%
packages/@fbcmobile-ui/Components/FormInput0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
packages/@fbcmobile-ui/Screens0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
74 12 2
52 28 1
49 1 1
42 5 1
42 6 1
34 9 3
31 6 0
29 6 1
28 3 2
28 3 1
26 7 2
26 10 1
24 2 3
21 7 1
21 4 1
20 2 0
20 4 1
20 4 1
18 2 1
15 9 1
14 1 1
14 1 2
14 3 2
13 3 2
12 3 1
12 2 1
12 3 1
12 5 1
11 1 1
10 1 0
10 1 0
10 1 0
9 3 1
9 1 1
9 2 1
8 1 2
8 1 2
8 2 1
7 2 1
7 2 1
7 2 1
7 1 0
6 1 0
6 4 1
6 2 2
6 1 2
6 1 2
6 1 1
6 1 1
6 1 1