facebookresearch / vocoder-benchmark
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 320 units with 2,854 lines of code in units (46.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (72 lines of code)
    • 21 simple units (545 lines of code)
    • 297 very simple units (2,237 lines of code)
0% | 0% | 2% | 19% | 78%
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% | 2% | 19% | 78%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
models0% | 0% | 7% | 12% | 80%
models/src/wavenet_vocoder/tfcompat0% | 0% | 10% | 30% | 58%
models/src/wavenet_vocoder0% | 0% | 0% | 27% | 72%
models/src/ptflops0% | 0% | 0% | 33% | 66%
ROOT0% | 0% | 0% | 53% | 46%
models/src/parallel_wavegan/optimizers0% | 0% | 0% | 90% | 9%
models/src/parallel_wavegan/layers0% | 0% | 0% | 9% | 90%
models/src/wavegrad0% | 0% | 0% | 0% | 100%
models/src/parallel_wavegan/models0% | 0% | 0% | 0% | 100%
models/src/diffwave0% | 0% | 0% | 0% | 100%
models/src/parallel_wavegan/losses0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _cast_to_type_if_compatible()
in models/src/wavenet_vocoder/tfcompat/hparam.py
21 12 3
def generate()
in models/wavenet.py
51 11 3
def _get_kind_name()
in models/src/wavenet_vocoder/tfcompat/hparam.py
13 10 2
def start_flops_count()
in models/src/ptflops/flops_counter.py
33 9 2
def rnn_flops()
in models/src/ptflops/flops_counter.py
18 9 5
def mix_gaussian_loss()
in models/src/wavenet_vocoder/mixture.py
35 9 4
def __init__()
in models/src/wavenet_vocoder/tfcompat/hparam.py
8 9 4
def step()
in models/src/parallel_wavegan/optimizers/radam.py
58 9 2
def generate()
in models/diffwave.py
52 8 3
def flops_to_string()
in models/src/ptflops/flops_counter.py
19 8 3
def forward()
in models/src/wavenet_vocoder/wavenet.py
22 8 5
def _process_scalar_value()
in models/src/wavenet_vocoder/tfcompat/hparam.py
19 8 6
def get()
in models/src/wavenet_vocoder/tfcompat/hparam.py
22 8 3
def __iter__()
in datasets.py
18 7 1
def split_command()
in datasets.py
65 7 2
def sample_from_mix_gaussian()
in models/src/wavenet_vocoder/mixture.py
29 7 2
def forward()
in models/src/parallel_wavegan/layers/residual_block.py
16 7 3
def raw_iter()
in datasets.py
21 6 1
def load_model_from_checkpoint()
in models/framework.py
17 6 2
def rtf()
in models/framework.py
18 6 2