microsoft / Tx
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 584 units with 8,229 lines of code in units (24.0% of code).
    • 2 very long units (309 lines of code)
    • 14 long units (983 lines of code)
    • 94 medium size units (2,962 lines of code)
    • 139 small units (2,026 lines of code)
    • 335 very small units (1,949 lines of code)
3% | 11% | 35% | 24% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs3% | 11% | 35% | 24% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Source3% | 11% | 35% | 24% | 23%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
167 27 1
142 30 1
96 22 3
95 15 1
84 7 5
84 13 3
76 12 5
74 6 3
72 7 1
62 7 1
61 33 1
60 25 3
57 15 1
57 11 1
53 4 4
52 11 1
50 4 6
50 3 1
50 8 0
50 8 0
49 4 6
49 7 1
47 9 4
47 4 1
47 10 1
47 6 2
47 9 0
46 6 1
46 7 1
45 6 1
44 5 2
44 2 5
44 7 2
43 8 6
43 8 6
42 6 3
41 5 1
41 8 3
40 4 2
39 5 1
38 7 3
38 6 2
37 7 0
37 7 0
35 4 2
34 5 1
34 5 3
34 6 1
34 5 0
34 8 0