facebookresearch / FIND
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 36 units with 537 lines of code in units (80.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (116 lines of code)
    • 3 medium size units (77 lines of code)
    • 20 small units (270 lines of code)
    • 11 very small units (74 lines of code)
0% | 21% | 14% | 50% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 21% | 14% | 50% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ROOT0% | 44% | 29% | 18% | 7%
tasks/dax-compo0% | 0% | 0% | 100% | 0%
tasks/add-or-mul0% | 0% | 0% | 77% | 22%
tasks/count-or-mem0% | 0% | 0% | 77% | 22%
tasks/hierar-or-linear0% | 0% | 0% | 56% | 43%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in generate.py
61 9 1
def main()
in mdl.py
55 12 2
32 4 6
23 3 1
def train()
in mdl.py
22 5 4
def parse_json_sweep()
in local_grid.py
18 9 1
17 2 1
def put_train_mdl()
in tasks/dax-compo/generate_data.py
16 3 3
def generate_mdl()
in tasks/count-or-mem/generate_data.py
15 1 4
def main()
in tasks/dax-compo/generate_data.py
15 1 1
def generate_fpa()
in tasks/count-or-mem/generate_data.py
14 1 3
def put_test()
in tasks/dax-compo/generate_data.py
14 2 2
def generate_mdl()
in tasks/dax-compo/generate_data.py
14 1 3
def generate_fpa()
in tasks/add-or-mul/generate_data.py
14 1 3
def generate_mdl()
in tasks/add-or-mul/generate_data.py
14 1 4
def __call__()
in local_grid.py
14 2 2
def generate_fpa()
in tasks/dax-compo/generate_data.py
13 1 2
def main()
in tasks/add-or-mul/generate_data.py
13 1 2
def put_train_mdl()
in tasks/count-or-mem/generate_data.py
12 3 5
def put_train_mdl()
in tasks/add-or-mul/generate_data.py
12 3 5