apple / swift-evolution
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 29 units with 656 lines of code in units (48.6% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (231 lines of code)
    • 10 medium size units (296 lines of code)
    • 3 small units (47 lines of code)
    • 12 very small units (82 lines of code)
0% | 35% | 45% | 7% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 35% | 45% | 7% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 35% | 45% | 7% | 12%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
67 16 1
58 11 0
55 11 0
51 2 0
45 8 1
40 10 0
39 8 1
31 2 1
30 5 0
function init()
in index.js
25 2 0
function html()
in index.js
23 7 3
21 3 1
21 2 0
21 6 1
19 2 1
16 3 1
12 1 0
10 2 1
10 1 1
10 1 1