facebookresearch / DomainBed
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 231 units with 2,364 lines of code in units (65.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (106 lines of code)
    • 5 medium complex units (280 lines of code)
    • 15 simple units (423 lines of code)
    • 210 very simple units (1,555 lines of code)
0% | 4% | 11% | 17% | 65%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 4% | 11% | 17% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
domainbed0% | 6% | 6% | 20% | 66%
domainbed/scripts0% | 0% | 47% | 20% | 32%
domainbed/lib0% | 0% | 0% | 5% | 94%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _hparams()
in domainbed/hparams_registry.py
106 35 3
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 update()
in domainbed/algorithms.py
69 19 2
def download_terra_incognita()
in domainbed/scripts/download.py
53 12 1
def update()
in domainbed/algorithms.py
34 11 3
def make_args_list()
in domainbed/scripts/sweep.py
31 10 11
def update()
in domainbed/algorithms.py
50 9 3
def print_table()
in domainbed/scripts/collect_results.py
25 9 6
def make_selector_fn()
in domainbed/lib/query.py
21 9 1
def update()
in domainbed/algorithms.py
43 8 3
def update()
in domainbed/algorithms.py
20 8 3
def update()
in domainbed/algorithms.py
41 8 3
def remove_batch_norm_from_resnet()
in domainbed/networks.py
20 8 1
def multi_gpu_launcher()
in domainbed/command_launchers.py
17 8 1
def update()
in domainbed/algorithms.py
20 7 3
def _step_acc()
in domainbed/model_selection.py
22 7 2
def __init__()
in domainbed/scripts/sweep.py
20 7 3
def update()
in domainbed/algorithms.py
29 6 3
def update()
in domainbed/algorithms.py
33 6 3