Linux / Drivers / Dma-buf
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 224 units with 3,634 lines of code in units (66.2% of code).
    • 1 very long units (118 lines of code)
    • 5 long units (305 lines of code)
    • 51 medium size units (1,543 lines of code)
    • 77 small units (1,117 lines of code)
    • 90 very small units (551 lines of code)
3% | 8% | 42% | 30% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c3% | 8% | 42% | 30% | 14%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT3% | 9% | 43% | 28% | 15%
heaps0% | 0% | 29% | 57% | 13%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
118 26 3
70 12 1
66 12 2
61 13 2
56 9 2
52 14 1
49 12 2
46 10 1
46 3 2
46 11 3
45 11 2
44 8 2
43 7 3
43 7 1
42 7 2
40 5 2
39 10 3
38 9 2
37 6 2
36 7 1
36 10 4
35 9 2
33 3 1
31 8 3
30 5 1
30 6 1
28 6 1
27 7 1
27 2 1
27 7 1
27 2 1
27 5 2
26 5 1
26 5 1
26 6 1
26 6 1
26 3 2
26 4 2
25 5 1
25 4 1
24 4 1
24 4 1
24 1 2
24 3 2
24 8 1
23 4 1
23 4 1
23 3 2
23 3 2
22 4 1