facebookincubator / pystemd
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 194 units with 789 lines of code in units (30.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 8 medium size units (220 lines of code)
    • 12 small units (152 lines of code)
    • 174 very small units (417 lines of code)
0% | 0% | 27% | 19% | 52%
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% | 32% | 26% | 40%
pyx0% | 0% | 35% | 27% | 37%
pyi0% | 0% | 12% | 0% | 87%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pystemd0% | 0% | 37% | 23% | 39%
pystemd/systemd10% | 0% | 0% | 7% | 92%
pystemd/machine10% | 0% | 0% | 0% | 100%
pystemd/DBus0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
40 6 6
33 6 1
29 1 6
29 1 0
24 2 6
22 4 2
22 8 2
21 4 4
15 1 3
14 11 1
14 5 4
13 6 2
13 3 1
13 1 1
12 9 2
12 3 1
12 1 1
12 7 3
11 4 2
11 2 1
10 3 1
10 1 2
9 1 4
9 1 4
8 5 1
8 3 3
8 1 5
8 2 5
8 1 1
8 2 1
8 1 0
7 3 0
7 1 3
7 1 0
7 1 0
7 1 3
7 1 0
7 1 3
7 3 1
6 1 0
6 2 0
6 1 0
6 1 0
6 2 3
6 1 2
6 1 1
5 3 2
4 2 2
4 1 2
4 1 3