microsoft / PowerShell-DSC-for-Linux
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 8,679 units with 123,579 lines of code in units (53.1% of code).
    • 91 very long units (14,017 lines of code)
    • 260 long units (17,648 lines of code)
    • 931 medium size units (29,172 lines of code)
    • 2,378 small units (32,349 lines of code)
    • 5,019 very small units (30,393 lines of code)
11% | 14% | 23% | 26% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c27% | 23% | 23% | 14% | 10%
py6% | 17% | 31% | 26% | 19%
cpp9% | 3% | 52% | 34% | <1%
rb10% | 16% | 32% | 20% | 20%
cs19% | 29% | 38% | 8% | 3%
h0% | 0% | <1% | 40% | 59%
hpp0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
LCM26% | 22% | 19% | 17% | 13%
Providers3% | 10% | 25% | 30% | 30%
ext0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
533 92 4
386 78 5
302 53 2
302 53 2
256 41 2
249 26 10
245 41 1
242 42 5
231 62 7
229 73 3
229 73 3
212 38 10
200 28 5
197 59 2
197 59 2
197 59 2
194 55 1
187 25 1
187 25 1
187 69 1
185 38 3
185 24 8
182 24 6
179 30 2
171 42 1
171 25 1
169 40 1
169 23 1
169 23 1
164 45 2
151 22 1
151 17 8
149 18 6
141 21 4
141 32 3
140 19 2
140 8 2
139 35 3
139 15 3
136 16 9
134 26 1
134 39 5
133 25 1
133 15 1
133 12 3
131 29 1
130 18 1
130 21 1
130 12 1
129 19 7