facebookresearch / GAN-optimization-landscape
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 83 units with 1,363 lines of code in units (73.6% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (272 lines of code)
    • 2 medium complex units (101 lines of code)
    • 15 simple units (395 lines of code)
    • 64 very simple units (595 lines of code)
0% | 19% | 7% | 28% | 43%
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% | 19% | 7% | 28% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 36% | 7% | 30% | 25%
lib/optim0% | 0% | 20% | 54% | 24%
lib/models0% | 0% | 0% | 17% | 82%
lib0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in train_mnist.py
157 44 1
def compute_path_stats()
in plot_path_tools.py
115 34 15
def step()
in lib/optim/omd.py
42 14 2
def compute_eigenvalues()
in plot_path_tools.py
59 13 10
def plot_path_stats()
in plot_path_tools.py
78 10 4
def visualize_interpolation()
in plot_path_tools.py
39 10 12
def update()
in lib/optim/extragradient.py
32 10 3
def plot_eigenvalues()
in plot_path_tools.py
24 8 7
def train_mnist_classifier()
in gan_eval_metrics.py
45 8 3
def __init__()
in lib/optim/extragradient.py
13 8 7
def extrapolation()
in lib/optim/extragradient.py
10 7 1
def normalize_module2D()
in train_mnist.py
13 6 3
def mnist_inception_score()
in gan_eval_metrics.py
31 6 5
def step()
in lib/optim/omd.py
15 6 2
def step()
in lib/optim/extragradient.py
16 6 2
def update()
in lib/optim/extragradient.py
23 6 3
def __init__()
in lib/models/mlp.py
17 6 9
def __init__()
in lib/models/wgangp.py
23 6 5
def get_penalty()
in lib/models/discriminator.py
16 6 4
def __init__()
in lib/optim/omd.py
13 5 5