facebookincubator / memory-analyzer
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 41 units with 374 lines of code in units (60.0% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (104 lines of code)
    • 8 small units (113 lines of code)
    • 29 very small units (157 lines of code)
0% | 0% | 27% | 30% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 27% | 30% | 41%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
memory_analyzer0% | 0% | 47% | 13% | 38%
memory_analyzer/frontend0% | 0% | 0% | 52% | 47%
Alternative Visuals
Longest Units
Top 41 longest units
Unit# linesMcCabe index# params
32 3 2
26 6 2
25 7 2
21 4 1
18 8 1
18 6 2
15 7 1
13 8 2
13 7 2
13 3 2
12 5 3
11 1 4
10 1 1
10 3 2
10 1 0
9 3 2
9 4 1
9 3 1
8 2 1
8 1 0
7 1 3
7 2 1
7 3 1
6 1 2
6 2 3
6 2 5
5 2 2
5 2 2
4 2 2
4 2 2
4 2 0
3 1 1
3 1 1
3 1 2
2 1 1
2 1 1
2 1 3
2 1 3
2 1 1
2 1 0
2 1 0