Linux / Drivers / Perf
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 740 units with 10,262 lines of code in units (64.7% of code).
    • 1 very long units (130 lines of code)
    • 16 long units (1,174 lines of code)
    • 108 medium size units (3,229 lines of code)
    • 212 small units (3,113 lines of code)
    • 403 very small units (2,616 lines of code)
1% | 11% | 31% | 30% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c1% | 11% | 31% | 30% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT1% | 14% | 32% | 29% | 22%
hisilicon0% | 0% | 28% | 34% | 37%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
130 40 2
98 27 1
93 21 1
89 12 1
87 14 1
85 9 1
82 19 2
81 20 1
80 11 1
74 10 1
65 13 1
61 7 1
60 10 1
56 9 1
56 8 1
55 13 2
52 10 2
50 6 1
50 17 2
49 16 1
47 10 3
46 10 2
45 14 1
45 6 1
45 6 1
45 8 1
45 10 1
44 13 2
43 5 1
43 5 1
42 12 1
42 6 2
42 8 1
41 6 2
40 1 1
40 12 4
39 10 2
38 19 2
38 4 2
37 18 2
36 9 2
35 8 3
35 7 2
35 8 1
34 2 2
34 6 2
34 15 1
33 12 1
33 9 1
33 7 1