facebook / facebook360_dep
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 1,580 units with 20,795 lines of code in units (55.8% of code).
    • 8 very long units (1,294 lines of code)
    • 44 long units (2,807 lines of code)
    • 239 medium size units (7,135 lines of code)
    • 343 small units (5,089 lines of code)
    • 946 very small units (4,470 lines of code)
6% | 13% | 34% | 24% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp12% | 14% | 39% | 20% | 12%
py2% | 6% | 25% | 29% | 35%
h0% | 14% | 32% | 26% | 26%
js0% | 28% | 38% | 23% | 8%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/util16% | 0% | 23% | 25% | 34%
source/viewer47% | 10% | 7% | 22% | 11%
source/rig14% | 11% | 41% | 23% | 9%
source/calibration9% | 11% | 40% | 24% | 14%
source/render4% | 10% | 46% | 21% | 16%
scripts/render7% | 10% | 38% | 27% | 15%
source/depth_estimation6% | 30% | 40% | 17% | 5%
website/static0% | 30% | 35% | 25% | 8%
source/isp0% | 33% | 30% | 15% | 20%
scripts/ui0% | 6% | 16% | 29% | 47%
source/conversion0% | 22% | 39% | 22% | 16%
source/mesh_stream0% | 19% | 49% | 19% | 11%
scripts/util0% | 0% | 32% | 22% | 45%
source/gpu0% | 0% | 19% | 46% | 34%
scripts/aws0% | 0% | 24% | 49% | 25%
website/pages0% | 0% | 100% | 0% | 0%
scripts/applications0% | 0% | 0% | 0% | 100%
website/core0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
239 14 3
238 52 1
177 42 5
174 9 0
138 17 1
114 10 2
111 30 2
103 14 2
100 22 7
92 17 6
88 14 2
87 11 1
80 16 6
76 10 10
76 22 2
76 22 2
75 21 3
73 12 3
71 14 1
70 13 2
69 8 0
68 4 0
66 7 2
66 19 0
66 13 0
64 13 5
64 13 11
60 12 1
60 16 3
60 7 0
58 13 5
58 10 3
57 7 2
57 9 6
56 10 2
56 13 1
56 5 0
56 13 1
56 5 0
55 9 6
55 10 4
55 10 2
54 6 3
54 9 3
54 6 0
54 6 0
52 8 2
52 2 0
52 8 1
51 11 5