Linux / Drivers / Ntb
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 414 units with 7,468 lines of code in units (74.2% of code).
    • 5 very long units (798 lines of code)
    • 22 long units (1,459 lines of code)
    • 76 medium size units (2,305 lines of code)
    • 113 small units (1,634 lines of code)
    • 198 very small units (1,272 lines of code)
10% | 19% | 30% | 21% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c10% | 19% | 30% | 22% | 16%
h0% | 0% | 35% | 0% | 64%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
hw11% | 18% | 28% | 23% | 17%
ROOT6% | 21% | 38% | 18% | 14%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
225 18 4
197 42 3
128 8 4
126 11 4
122 25 2
94 6 4
83 8 4
82 14 1
82 44 1
76 3 4
75 11 5
75 12 3
74 19 5
74 17 1
71 16 5
65 15 5
64 7 2
58 15 2
57 12 1
57 9 5
56 6 1
56 6 1
53 9 4
52 13 2
52 10 2
52 7 2
51 12 5
50 9 2
50 8 2
49 6 2
49 8 1
47 6 2
46 9 4
46 7 1
46 8 3
43 5 3
42 8 5
42 7 3
40 8 2
40 9 2
39 6 1
39 7 2
38 6 1
38 5 4
38 8 1
38 9 1
37 7 2
37 5 2
36 6 2
35 6 6