facebookincubator / Bowler
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 90 units with 1,045 lines of code in units (52.1% of code).
    • 1 very long units (164 lines of code)
    • 3 long units (157 lines of code)
    • 9 medium size units (256 lines of code)
    • 13 small units (198 lines of code)
    • 64 very small units (270 lines of code)
15% | 15% | 24% | 18% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py16% | 15% | 26% | 17% | 24%
js0% | 0% | 0% | 45% | 54%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
bowler16% | 15% | 26% | 17% | 24%
website/pages/en0% | 0% | 0% | 57% | 42%
website/core0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
164 12 2
54 12 3
52 26 2
51 19 4
45 17 2
42 18 3
38 12 2
23 12 4
23 6 3
22 5 2
21 4 1
21 7 3
21 6 1
20 4 1
20 12 3
18 9 3
18 6 4
17 5 2
16 3 3
15 2 0
14 6 1
13 1 0
12 5 3
12 7 4
12 3 3
11 1 0
10 3 1
10 4 3
9 1 0
9 2 3
8 2 3
8 2 3
8 3 1
8 4 2
8 2 1
8 5 1
7 1 0
7 3 3
7 3 3
6 1 0
6 1 0
6 3 2
6 3 1
6 2 1
6 3 2
5 1 0
5 2 1
5 2 1
5 1 0
5 6 1