facebookresearch / DomainBed
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 231 units with 2,364 lines of code in units (65.1% of code).
    • 1 very long units (106 lines of code)
    • 4 long units (246 lines of code)
    • 21 medium size units (609 lines of code)
    • 51 small units (766 lines of code)
    • 154 very small units (637 lines of code)
4% | 10% | 25% | 32% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py4% | 10% | 25% | 32% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
domainbed6% | 4% | 31% | 35% | 21%
domainbed/scripts0% | 47% | 15% | 17% | 19%
domainbed/lib0% | 0% | 11% | 35% | 53%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _hparams()
in domainbed/hparams_registry.py
106 35 3
def update()
in domainbed/algorithms.py
69 19 2
def print_results_tables()
in domainbed/scripts/collect_results.py
62 22 3
def todo_rename()
in domainbed/scripts/list_top_hparams.py
62 22 3
def download_terra_incognita()
in domainbed/scripts/download.py
53 12 1
def update()
in domainbed/algorithms.py
50 9 3
def update()
in domainbed/algorithms.py
43 8 3
def update()
in domainbed/algorithms.py
41 8 3
def update()
in domainbed/algorithms.py
34 11 3
def update()
in domainbed/algorithms.py
33 6 3
def __init__()
in domainbed/datasets.py
31 6 5
def make_args_list()
in domainbed/scripts/sweep.py
31 10 11
def __init__()
in domainbed/datasets.py
30 4 6
def update()
in domainbed/algorithms.py
29 6 3
def update()
in domainbed/algorithms.py
29 5 3
def __init__()
in domainbed/algorithms.py
28 1 7
def neum()
in domainbed/algorithms.py
27 3 3
def update()
in domainbed/algorithms.py
26 5 3
def print_table()
in domainbed/scripts/collect_results.py
25 9 6
def accuracy()
in domainbed/lib/misc.py
23 4 4