facebookincubator / gloo
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 752 units with 9,373 lines of code in units (35.2% of code).
    • 6 very long units (905 lines of code)
    • 23 long units (1,520 lines of code)
    • 88 medium size units (2,661 lines of code)
    • 139 small units (2,042 lines of code)
    • 496 very small units (2,245 lines of code)
9% | 16% | 28% | 21% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cc11% | 16% | 31% | 25% | 14%
h4% | 13% | 17% | 11% | 52%
py0% | 31% | 46% | 5% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
gloo18% | 19% | 23% | 16% | 22%
gloo/benchmark16% | 15% | 18% | 29% | 20%
gloo/transport/tcp0% | 20% | 38% | 24% | 16%
gloo/transport/uv0% | 7% | 30% | 27% | 33%
tools/amd_build/pyHIPIFY0% | 31% | 46% | 5% | 17%
gloo/transport/ibverbs0% | 10% | 45% | 26% | 17%
gloo/rendezvous0% | 15% | 27% | 35% | 21%
gloo/common0% | 0% | 29% | 13% | 57%
gloo/mpi0% | 0% | 60% | 15% | 23%
gloo/nccl0% | 0% | 0% | 73% | 26%
gloo/mpi/example0% | 0% | 0% | 62% | 37%
gloo/transport0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
224 42 2
180 24 3
137 23 1
133 17 3
128 40 0
103 27 0
93 23 0
88 2 1
85 2 2
85 21 0
84 13 1
83 23 1
71 11 2
67 10 0
66 14 0
63 15 0
62 10 0
61 12 1
61 1 1
61 9 1
57 11 1
56 15 0
56 9 1
55 12 2
55 14 0
54 14 1
53 5 1
53 9 2
51 14 0
50 11 1
48 11 1
48 9 3
47 4 1
47 9 1
46 9 1
46 9 1
44 6 4
42 3 0
42 2 1
41 8 2
41 9 0
40 8 4
39 7 2
38 10 2
38 7 1
38 12 0
38 5 4
38 8 1
36 2 3
35 3 1