microsoft / plcrashreporter
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 303 units with 6,833 lines of code in units (35.7% of code).
    • 11 very long units (2,005 lines of code)
    • 19 long units (1,410 lines of code)
    • 61 medium size units (1,864 lines of code)
    • 46 small units (706 lines of code)
    • 166 very small units (848 lines of code)
29% | 20% | 27% | 10% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp62% | 18% | 8% | 5% | 4%
c20% | 21% | 34% | 8% | 13%
m22% | 17% | 28% | 17% | 14%
mm0% | 42% | 36% | 13% | 8%
hpp0% | 0% | 49% | 18% | 31%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Source30% | 20% | 26% | 9% | 12%
Other Sources0% | 29% | 35% | 28% | 6%
Dependencies0% | 0% | 67% | 26% | 5%
Tools0% | 0% | 0% | 61% | 38%
include0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
468 146 10
276 72 9
191 45 5
190 36 3
162 31 6
142 21 4
124 18 6
120 22 5
120 16 6
107 21 8
105 23 4
99 29 4
96 16 5
94 25 5
94 16 6
87 16 6
83 19 5
83 15 6
80 12 5
77 22 3
71 17 4
68 14 3
66 14 5
65 10 2
63 13 3
60 17 3
59 13 5
58 12 5
55 11 9
52 8 2
50 9 7
50 22 2
49 22 3
46 13 2
45 9 1
45 12 5
41 9 6
41 5 2
41 6 2
41 5 6
40 17 2
39 35 2
39 35 3
39 17 3
37 10 1
36 16 2
35 10 2
35 6 6
34 4 2
33 6 3