Linux / Drivers / Leds
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,091 units with 20,710 lines of code in units (70.9% of code).
    • 4 very long units (518 lines of code)
    • 62 long units (4,034 lines of code)
    • 278 medium size units (8,655 lines of code)
    • 314 small units (4,628 lines of code)
    • 433 very small units (2,875 lines of code)
2% | 19% | 41% | 22% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c2% | 19% | 41% | 22% | 13%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT3% | 20% | 42% | 21% | 12%
flash0% | 25% | 41% | 20% | 12%
trigger0% | 4% | 34% | 33% | 27%
simple0% | 65% | 0% | 14% | 20%
blink0% | 0% | 48% | 27% | 23%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
163 33 1
148 24 2
106 13 3
101 16 1
100 19 3
98 32 1
95 10 2
95 25 1
88 16 3
79 13 2
79 11 1
78 7 1
74 15 3
74 9 2
74 14 3
73 9 1
73 9 2
72 16 1
71 19 2
71 17 1
71 13 1
71 8 1
71 9 1
68 12 1
68 14 1
67 8 1
66 11 3
65 13 2
65 14 1
65 12 1
63 13 3
63 10 2
63 10 2
62 9 4
62 15 3
62 10 1
61 8 3
61 11 1
61 14 1
60 9 1
60 13 1
60 10 2
59 11 1
59 10 3
59 13 2
58 15 1
58 11 3
57 14 3
57 12 3
57 8 5