facebook / FAI-PEP
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 641 units with 8,606 lines of code in units (70.1% of code).
    • 5 very long units (773 lines of code)
    • 14 long units (881 lines of code)
    • 106 medium size units (3,322 lines of code)
    • 126 small units (1,852 lines of code)
    • 390 very small units (1,778 lines of code)
8% | 10% | 38% | 21% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 10% | 38% | 21% | 20%
js0% | 0% | 64% | 0% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
benchmarking/frameworks24% | 29% | 25% | 14% | 6%
ailab/benchmark54% | 0% | 28% | 2% | 14%
benchmarking13% | 13% | 41% | 17% | 14%
benchmarking/platforms0% | 8% | 36% | 32% | 22%
benchmarking/utils0% | 11% | 39% | 26% | 23%
benchmarking/data_converters0% | 45% | 0% | 26% | 28%
libraries/python0% | 0% | 59% | 28% | 12%
benchmarking/reporters0% | 0% | 67% | 9% | 23%
benchmarking/benchmarks0% | 0% | 57% | 28% | 14%
benchmarking/driver0% | 0% | 42% | 35% | 22%
benchmarking/remote0% | 0% | 37% | 26% | 36%
benchmarking/profilers0% | 0% | 53% | 12% | 34%
benchmarking/regression_detectors0% | 0% | 69% | 6% | 24%
benchmarking/download_benchmarks0% | 0% | 54% | 19% | 26%
specifications/models0% | 0% | 56% | 35% | 7%
benchmarking/bridge0% | 0% | 0% | 35% | 64%
ailab/file_storage0% | 0% | 0% | 100% | 0%
benchmarking/repos0% | 0% | 0% | 0% | 100%
benchmarking/degrade0% | 0% | 0% | 0% | 100%
ailab/ailab0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
306 74 4
127 28 1
123 37 1
112 29 1
105 20 1
93 18 4
88 15 3
83 15 4
63 9 1
62 18 4
60 27 2
59 17 2
55 11 1
54 7 3
53 13 4
53 18 4
53 23 1
53 14 3
52 8 3
50 14 3
49 2 5
48 11 1
47 9 2
47 19 4
47 19 2
46 8 2
45 12 3
45 5 7
45 6 2
44 7 1
43 8 1
43 8 3
43 13 2
43 12 2
43 3 4
42 11 1
42 13 2
42 10 4
41 11 1
40 4 1
40 9 3
40 6 1
39 6 4
37 12 1
37 15 2
37 11 3
37 7 4
37 8 2
37 18 2
35 10 6