facebookresearch / demucs
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 175 units with 2,943 lines of code in units (80.3% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (356 lines of code)
    • 14 medium complex units (825 lines of code)
    • 27 simple units (674 lines of code)
    • 131 very simple units (1,088 lines of code)
0% | 12% | 28% | 22% | 36%
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% | 12% | 28% | 22% | 36%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
demucs0% | 14% | 29% | 20% | 35%
tools0% | 0% | 26% | 38% | 35%
demucs/grids0% | 0% | 0% | 29% | 70%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _run_one_epoch()
in demucs/solver.py
100 33 3
def train()
in demucs/solver.py
100 28 1
def __init__()
in demucs/hdemucs.py
156 27 36
def forward()
in demucs/hdemucs.py
67 21 2
def apply_model()
in demucs/apply.py
91 19 10
def evaluate()
in demucs/evaluate.py
89 17 2
def svd_penalty()
in demucs/svd.py
35 15 10
def forward()
in demucs/hdemucs.py
57 15 4
def main()
in tools/automix.py
51 14 0
def get_solver()
in demucs/train.py
55 14 2
def forward()
in demucs/hdemucs.py
30 13 3
def __init__()
in demucs/demucs.py
99 13 26
def read()
in demucs/audio.py
47 13 4
def main()
in demucs/separate.py
96 12 0
def align_stems()
in tools/automix.py
44 11 1
def __init__()
in demucs/solver.py
34 11 5
def forward()
in demucs/hdemucs.py
30 11 4
def transform()
in tools/convert.py
18 10 3
29 10 1
def process_history()
in demucs/grids/_explorers.py
27 9 2