facebookresearch / uimnet
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 378 units with 3,966 lines of code in units (49.2% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 11 medium complex units (581 lines of code)
    • 24 simple units (603 lines of code)
    • 343 very simple units (2,782 lines of code)
0% | 0% | 14% | 15% | 70%
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% | 0% | 14% | 15% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
uimnet/workers0% | 0% | 47% | 22% | 29%
scripts0% | 0% | 17% | 13% | 69%
uimnet/modules0% | 0% | 15% | 26% | 58%
uimnet/utils0% | 0% | 5% | 15% | 79%
uimnet/algorithms0% | 0% | 0% | 9% | 90%
uimnet/evaluation0% | 0% | 0% | 34% | 65%
uimnet/measures0% | 0% | 0% | 23% | 76%
uimnet/datasets0% | 0% | 0% | 7% | 92%
uimnet/metrics0% | 0% | 0% | 0% | 100%
uimnet/ensembles0% | 0% | 0% | 0% | 100%
benchmarks0% | 0% | 0% | 0% | 100%
profiles0% | 0% | 0% | 0% | 100%
uimnet/numerics0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __call__()
in uimnet/workers/evaluator2.py
83 18 7
def __call__()
in uimnet/workers/evaluator.py
86 18 7
def forward()
in uimnet/modules/spectral_normalization/spectral_bn.py
32 17 2
def __call__()
in uimnet/workers/mog.py
67 13 5
def __call__()
in uimnet/workers/calibrator.py
88 13 5
def run_evaluation()
in scripts/run_evaluation.py
49 13 5
def maybe_setup_distributed()
in uimnet/workers/base.py
54 12 2
def run_ensembles()
in scripts/run_ensembles.py
64 12 5
def command()
in uimnet/utils/__init__.py
17 11 5
def apply_fun()
in uimnet/utils/__init__.py
13 11 2
def select_models()
in scripts/recordify.py
28 11 3
def stack_tables_measurements()
in uimnet/evaluation/oodomain.py
19 9 1
def _collect_oodomain_records()
in uimnet/evaluation/oodomain.py
31 9 2
def __call__()
in uimnet/workers/trainer.py
49 9 4
def print()
in uimnet/utils/__init__.py
10 8 2
def __call__()
in uimnet/workers/predictor.py
73 8 6
def monkey_patch_layers()
in uimnet/modules/spectral_normalization/utils.py
44 8 4
def run_calibration()
in scripts/run_calibration.py
41 8 2
def make_random_splits()
in uimnet/datasets/base.py
16 7 3
def get_l2_reg()
in uimnet/algorithms/base.py
10 7 1