Linux / Arch / Nios2
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 217 units with 2,688 lines of code in units (43.8% of code).
    • 2 very long units (254 lines of code)
    • 3 long units (205 lines of code)
    • 27 medium size units (839 lines of code)
    • 33 small units (513 lines of code)
    • 152 very small units (877 lines of code)
9% | 7% | 31% | 19% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c10% | 8% | 34% | 19% | 27%
h0% | 0% | 7% | 14% | 78%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
mm18% | 0% | 27% | 24% | 28%
kernel7% | 14% | 36% | 17% | 23%
lib0% | 0% | 76% | 0% | 23%
include0% | 0% | 7% | 14% | 78%
platform0% | 0% | 100% | 0% | 0%
boot0% | 0% | 0% | 26% | 73%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
146 41 3
108 17 2
78 13 5
67 18 1
60 8 1
50 1 1
49 3 4
45 15 1
45 7 2
37 5 6
36 1 2
35 3 3
35 8 4
35 4 5
35 10 3
32 8 1
31 3 3
29 5 3
29 5 4
28 2 1
28 4 1
27 2 1
26 6 5
26 4 1
26 3 3
24 3 1
23 6 3
23 6 5
22 8 3
21 1 5
21 4 1
21 3 1
20 1 3
20 1 1
19 3 2
18 4 3
18 5 1
18 5 1
18 3 2
18 3 1
18 4 1
17 1 2
17 1 1
17 2 3
16 2 1
16 4 3
16 3 2
16 3 1
16 3 1
16 4 6