facebookresearch / music-translation
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 141 units with 1,763 lines of code in units (36.0% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (92 lines of code)
    • 4 medium complex units (262 lines of code)
    • 10 simple units (228 lines of code)
    • 126 very simple units (1,181 lines of code)
0% | 5% | 14% | 12% | 66%
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% | 6% | 16% | 13% | 63%
cpp0% | 0% | 9% | 11% | 79%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/nv-wavenet0% | 17% | 6% | 8% | 67%
src0% | 0% | 18% | 14% | 66%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def build_extensions()
in src/nv-wavenet/setup.py
92 30 1
def main()
in src/run_on_files.py
85 22 1
def __init__()
in src/nv_wavenet_generator.py
111 19 6
31 12 2
void nvWavenetReference::run()
in src/nv-wavenet/nv_wavenet_reference.cpp
35 11 3
void matrix_compare()
in src/nv-wavenet/matrix.cpp
26 9 5
def __init__()
in src/train.py
51 9 2
def forward()
in src/wavenet.py
23 8 3
def main()
in src/data_samples.py
30 7 0
void matrix_softmax()
in src/nv-wavenet/matrix.cpp
17 6 2
def train_epoch()
in src/train.py
24 6 2
def evaluate_epoch()
in src/train.py
25 6 2
def init()
in src/wavenet_generator.py
12 6 2
def filter_paths()
in src/data.py
5 6 2
def __getitem__()
in src/data.py
15 6 2
def main()
in src/parse_musicnet.py
34 5 0
def column_major()
in src/nv_wavenet_generator.py
11 5 1
def train()
in src/train.py
22 5 1
def main()
in src/train.py
18 5 0
def __init__()
in src/wavenet_generator.py
18 5 5