facebookresearch / dora
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 199 units with 1,814 lines of code in units (80.3% of code).
    • 1 very long units (155 lines of code)
    • 3 long units (211 lines of code)
    • 13 medium size units (379 lines of code)
    • 28 small units (418 lines of code)
    • 154 very small units (651 lines of code)
8% | 11% | 20% | 23% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 11% | 20% | 23% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dora8% | 11% | 20% | 23% | 35%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run_grid()
in dora/grid.py
155 57 4
def get_parser()
in dora/__main__.py
93 2 0
def _submit()
in dora/shep.py
65 20 2
def launch_action()
in dora/launch.py
53 19 2
def monitor()
in dora/grid.py
46 14 5
def get_trainer()
in dora/lightning.py
42 13 4
37 7 4
def info_action()
in dora/info.py
37 15 2
def __init__()
in dora/hydra.py
27 6 4
def main()
in dora/__main__.py
27 8 0
def start_ddp_workers()
in dora/executor.py
27 5 3
def get_distrib_spec()
in dora/distrib.py
26 3 0
def _get_explore()
in dora/grid.py
24 8 1
def __exit__()
in dora/executor.py
23 10 4
21 7 3
21 9 4
def _compare_config()
in dora/hydra.py
21 4 3
def run_action()
in dora/run.py
20 6 2
def __init__()
in dora/log.py
20 2 9
def _get_base_config()
in dora/hydra.py
20 7 2