Linux / Drivers / Hwtracing
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 1,100 units with 17,170 lines of code in units (67.8% of code).
    • 3 very long units (670 lines of code)
    • 28 long units (1,919 lines of code)
    • 191 medium size units (5,666 lines of code)
    • 370 small units (5,548 lines of code)
    • 508 very small units (3,367 lines of code)
3% | 11% | 32% | 32% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c3% | 11% | 33% | 32% | 18%
h0% | 0% | 0% | 10% | 89%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
coresight4% | 12% | 30% | 32% | 19%
intel_th0% | 5% | 43% | 33% | 17%
stm0% | 0% | 47% | 25% | 27%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
290 95 2
278 91 2
102 18 1
98 37 4
96 19 1
95 12 2
92 23 1
84 18 3
81 15 3
79 13 2
77 25 3
72 12 4
72 15 1
70 9 2
67 13 2
66 15 3
65 18 4
63 15 7
63 17 4
61 11 2
61 14 2
61 14 2
60 6 1
59 12 4
57 11 3
57 13 2
56 10 2
53 10 1
52 15 1
51 10 2
51 7 1
50 8 3
49 11 3
48 16 2
47 13 2
47 13 5
45 11 3
45 10 4
44 8 3
44 11 2
44 8 2
43 8 1
43 13 5
42 11 1
42 8 1
42 8 1
42 8 1
42 10 7
42 6 2
41 8 5