facebookincubator / sks
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 98 units with 1,565 lines of code in units (81.9% of code).
    • 1 very long units (108 lines of code)
    • 2 long units (114 lines of code)
    • 21 medium size units (591 lines of code)
    • 38 small units (547 lines of code)
    • 36 very small units (205 lines of code)
6% | 7% | 37% | 34% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go9% | 4% | 27% | 41% | 16%
c0% | 15% | 66% | 14% | 3%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
linux16% | 8% | 43% | 25% | 7%
macos0% | 11% | 50% | 35% | 2%
diskio0% | 0% | 29% | 38% | 32%
ROOT0% | 0% | 7% | 57% | 35%
utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
108 16 1
62 8 6
52 10 1
49 6 5
38 9 1
35 5 1
33 5 7
33 5 4
33 1 4
33 6 1
32 7 6
30 6 1
29 8 1
25 4 5
25 4 1
23 4 1
23 3 1
22 3 0
22 3 3
22 5 1
21 4 5
21 5 4
21 5 4
21 6 1
20 4 5
19 3 4
19 6 4
19 4 1
18 4 4
18 3 1
18 5 1
17 3 4
17 3 4
16 4 1
16 4 1
16 3 3
16 3 3
16 3 3
15 2 5
15 4 1
14 2 4
14 4 3
14 1 0
13 2 1
13 3 1
13 4 1
13 4 1
13 4 1
13 1 0
13 3 1