facebookincubator / xar
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 205 units with 2,827 lines of code in units (64.7% of code).
    • 1 very long units (215 lines of code)
    • 9 long units (651 lines of code)
    • 26 medium size units (779 lines of code)
    • 40 small units (545 lines of code)
    • 129 very small units (637 lines of code)
7% | 23% | 27% | 19% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp22% | 14% | 28% | 18% | 15%
py0% | 19% | 26% | 23% | 31%
rs0% | 51% | 32% | 7% | 8%
h0% | 0% | 0% | 43% | 56%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
xar10% | 14% | 27% | 18% | 28%
xar/clean_xar_mounts/src0% | 51% | 32% | 7% | 8%
xar/deprecated0% | 52% | 9% | 29% | 8%
xar/commands0% | 0% | 38% | 56% | 4%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
215 55 2
95 13 1
94 17 1
91 12 0
74 2 0
73 5 3
63 22 4
57 12 1
53 17 1
51 13 2
49 17 3
46 1 0
46 17 1
40 2 2
37 8 2
37 16 2
34 11 4
32 3 0
32 16 4
31 5 2
30 7 3
28 11 0
28 8 1
28 10 3
28 19 5
27 2 3
26 7 1
25 9 1
23 9 3
23 3 2
23 8 2
22 4 1
21 6 2
21 5 3
21 3 1
21 7 1
20 8 2
20 4 2
19 4 3
18 5 4
18 6 2
16 4 0
16 4 0
16 8 0
16 8 1
16 6 0
15 5 2
15 1 2
14 2 3
14 4 0