Linux / Drivers / Target
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,367 units with 29,556 lines of code in units (63.8% of code).
    • 18 very long units (2,604 lines of code)
    • 100 long units (6,682 lines of code)
    • 367 medium size units (11,342 lines of code)
    • 383 small units (5,771 lines of code)
    • 499 very small units (3,157 lines of code)
8% | 22% | 38% | 19% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c8% | 22% | 38% | 19% | 10%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
iscsi13% | 26% | 36% | 16% | 6%
ROOT4% | 20% | 40% | 22% | 12%
sbp10% | 19% | 40% | 17% | 12%
tcm_fc10% | 15% | 33% | 19% | 21%
loopback0% | 9% | 43% | 22% | 24%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
228 38 5
192 72 3
191 33 1
188 43 2
170 45 3
160 40 3
159 22 3
155 16 3
150 27 1
140 32 1
114 27 3
111 42 3
110 22 2
110 17 1
110 20 3
109 16 2
104 26 1
103 20 2
100 11 4
96 14 1
96 14 2
95 19 2
95 24 2
94 14 2
92 22 1
90 23 1
89 6 3
88 21 2
87 11 3
84 9 1
84 10 1
82 12 3
82 24 1
79 15 2
79 15 1
78 14 2
78 18 2
78 10 6
78 34 2
77 37 2
77 16 3
77 12 3
76 18 3
76 10 1
75 11 1
74 13 1
74 6 3
73 10 4
73 9 5
72 10 1