facebookincubator / SocketRocket
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 35 units with 340 lines of code in units (12.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (96 lines of code)
    • 6 small units (94 lines of code)
    • 26 very small units (150 lines of code)
0% | 0% | 28% | 27% | 44%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
m0% | 0% | 48% | 10% | 41%
go0% | 0% | 0% | 100% | 0%
h0% | 0% | 0% | 53% | 46%
py0% | 0% | 0% | 44% | 55%
js0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
SocketRocket/Internal/Utilities0% | 0% | 52% | 0% | 47%
SocketRocket0% | 0% | 39% | 40% | 20%
TestChatServer/go0% | 0% | 0% | 100% | 0%
TestChatServer/py0% | 0% | 0% | 44% | 55%
TestChatServer/static0% | 0% | 0% | 0% | 100%
SocketRocket/Internal0% | 0% | 0% | 0% | 100%
TestChat0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 35 longest units
Unit# linesMcCabe index# params
39 7 5
35 13 1
22 5 3
20 11 1
17 7 3
16 1 2
15 2 0
14 3 3
12 2 0
10 3 1
10 1 1
9 1 0
9 1 0
9 1 2
8 1 2
8 1 2
8 1 1
6 1 1
6 1 0
6 1 2
6 1 2
6 1 2
5 3 2
5 1 0
5 1 1
5 1 1
5 2 1
5 2 3
4 1 1
4 1 1
4 1 1
3 1 1
2 1 1
1 1 0
1 1 0