facebookresearch / SING
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 85 units with 1,018 lines of code in units (86.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (39 lines of code)
    • 7 simple units (188 lines of code)
    • 77 very simple units (791 lines of code)
0% | 0% | 3% | 18% | 77%
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% | 3% | 18% | 77%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sing0% | 0% | 9% | 14% | 75%
sing/nsynth0% | 0% | 0% | 53% | 46%
sing/sequence0% | 0% | 0% | 34% | 65%
sing/fondation0% | 0% | 0% | 16% | 83%
sing/ae0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in sing/generate.py
39 11 0
def main()
in sing/train.py
59 9 0
def __init__()
in sing/nsynth/__init__.py
20 8 2
def make_datasets()
in sing/nsynth/__init__.py
28 7 4
def forward()
in sing/sequence/models.py
23 7 5
def _eval_dataset()
in sing/fondation/trainer.py
18 6 4
def train()
in sing/fondation/trainer.py
18 6 1
def generate_embeddings_dataset()
in sing/sequence/utils.py
22 6 5
def __getitem__()
in sing/fondation/batch.py
17 5 2
def download_file()
in sing/fondation/utils.py
21 5 3
def __init__()
in sing/fondation/trainer.py
35 5 13
def progress_iterator()
in sing/fondation/utils.py
10 4 2
def _train_epoch()
in sing/fondation/trainer.py
20 4 3
def train_autoencoder()
in sing/train.py
24 4 2
41 4 8
def _train_batch()
in sing/sequence/trainer.py
27 4 2
def get_window()
in sing/dsp.py
8 3 3
def __init__()
in sing/dsp.py
9 3 4
def __init__()
in sing/ae/models.py
40 3 9
def __init__()
in sing/ae/models.py
29 3 8