Linux / Drivers / Nvme
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 686 units with 11,311 lines of code in units (66.2% of code).
    • 3 very long units (537 lines of code)
    • 28 long units (1,856 lines of code)
    • 136 medium size units (4,067 lines of code)
    • 186 small units (2,715 lines of code)
    • 333 very small units (2,136 lines of code)
4% | 16% | 35% | 24% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c4% | 16% | 36% | 24% | 17%
h0% | 0% | 0% | 11% | 88%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
host4% | 16% | 35% | 24% | 18%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
300 67 2
123 17 3
114 26 1
95 21 1
90 26 2
86 18 3
86 12 3
85 23 1
78 16 2
77 17 1
76 11 2
71 11 5
69 6 4
68 13 2
67 10 2
67 20 1
66 15 2
64 13 3
63 8 1
58 9 1
57 9 2
57 11 2
56 10 4
55 10 3
55 15 1
53 8 3
53 12 2
51 10 1
51 14 2
51 18 9
51 13 2
49 7 4
49 11 5
49 13 4
49 15 2
48 13 3
47 10 2
47 10 2
46 4 5
46 12 2
44 10 2
43 9 4
43 11 3
43 9 2
43 10 4
43 12 1
42 11 3
42 6 4
41 8 5
41 25 1