facebookresearch / ic_gan
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 580 units with 10,444 lines of code in units (51.6% of code).
    • 1 very complex units (345 lines of code)
    • 7 complex units (846 lines of code)
    • 24 medium complex units (1,716 lines of code)
    • 60 simple units (1,777 lines of code)
    • 488 very simple units (5,760 lines of code)
3% | 8% | 16% | 17% | 55%
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
py3% | 8% | 16% | 16% | 55%
cpp0% | 0% | 37% | 62% | 0%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
stylegan2_ada_pytorch/training31% | 0% | 11% | 11% | 45%
data_utils0% | 20% | 7% | 11% | 60%
stylegan2_ada_pytorch/torch_utils0% | 18% | 5% | 26% | 48%
inference0% | 33% | 56% | 0% | 9%
BigGAN_PyTorch0% | 1% | 24% | 12% | 61%
stylegan2_ada_pytorch0% | 0% | 19% | 39% | 40%
ROOT0% | 0% | 57% | 0% | 42%
stylegan2_ada_pytorch/dnnlib0% | 0% | 8% | 22% | 69%
stylegan2_ada_pytorch/metrics0% | 0% | 0% | 32% | 67%
BigGAN_PyTorch/TFHub0% | 0% | 0% | 20% | 79%
BigGAN_PyTorch/sync_batchnorm0% | 0% | 0% | 5% | 94%
BigGAN_PyTorch/logs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def forward()
in stylegan2_ada_pytorch/training/augment.py
345 51 3
def run()
in data_utils/inception_tf13.py
195 42 1
def __call__()
in inference/test.py
202 39 1
def print_module_summary()
in stylegan2_ada_pytorch/torch_utils/misc.py
73 37 4
def _bias_act_cuda()
in stylegan2_ada_pytorch/torch_utils/ops/bias_act.py
87 37 5
def run()
in data_utils/make_hdf5.py
171 34 1
def get_plugin()
in stylegan2_ada_pytorch/torch_utils/custom_ops.py
69 31 3
def name_from_config()
in BigGAN_PyTorch/utils.py
49 27 1
def train()
in BigGAN_PyTorch/train_fns.py
121 25 3
def predict()
in predict.py
122 24 6
def run()
in data_utils/calculate_inception_moments.py
110 23 1
static torch::Tensor bias_act()
in stylegan2_ada_pytorch/torch_utils/ops/bias_act.cpp
48 23 11
def G_arch()
in BigGAN_PyTorch/BigGAN.py
53 21 4
def train()
in BigGAN_PyTorch/trainer.py
382 20 4
def __call__()
in inference/sample.py
84 18 1
def G_arch()
in BigGAN_PyTorch/BigGANdeep.py
43 17 4
def D_arch()
in BigGAN_PyTorch/BigGANdeep.py
43 17 4
def D_arch()
in BigGAN_PyTorch/BigGAN.py
43 17 4
def load_model_inference()
in inference/utils.py
112 17 2
def training_loop()
in stylegan2_ada_pytorch/training/training_loop.py
40 17 25