facebook / fbzmq
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 523 units with 5,430 lines of code in units (45.3% of code).
    • 1 very long units (128 lines of code)
    • 9 long units (606 lines of code)
    • 62 medium size units (1,943 lines of code)
    • 85 small units (1,218 lines of code)
    • 366 very small units (1,535 lines of code)
2% | 11% | 35% | 22% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py2% | 11% | 35% | 22% | 28%
c0% | 0% | 100% | 0% | 0%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
build/fbcode_builder7% | 23% | 29% | 16% | 21%
build/fbcode_builder/getdeps0% | 4% | 38% | 25% | 31%
build/fbcode_builder/CMake0% | 9% | 41% | 20% | 28%
fbzmq/py0% | 0% | 0% | 88% | 11%
fbzmq/zmq0% | 0% | 0% | 0% | 100%
build0% | 0% | 0% | 0% | 100%
fbzmq/async0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
128 13 3
78 1 1
78 7 0
76 25 4
73 19 2
64 1 2
63 1 1
62 22 1
57 1 2
55 16 4
50 12 4
50 6 3
47 5 0
47 8 2
46 8 2
44 16 3
43 1 2
43 6 3
43 10 2
43 7 3
41 9 1
41 15 2
41 17 1
40 19 2
40 5 0
38 6 3
37 6 3
37 17 5
36 1 2
34 9 3
33 1 1
33 2 1
33 4 3
32 3 1
32 4 3
31 4 1
31 12 3
31 11 4
31 11 2
30 4 1
29 9 2
29 10 3
29 3 1
29 6 3
27 9 2
27 8 3
27 7 0
26 6 2
26 6 3
26 6 4