facebookresearch / radioactive_data
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 112 units with 1,657 lines of code in units (81.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (110 lines of code)
    • 10 medium complex units (550 lines of code)
    • 12 simple units (213 lines of code)
    • 89 very simple units (784 lines of code)
0% | 6% | 33% | 12% | 47%
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% | 33% | 12% | 47%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 21% | 44% | 0% | 34%
src0% | 0% | 41% | 11% | 47%
src/datasets0% | 0% | 0% | 33% | 66%
src/data_augmentations0% | 0% | 0% | 33% | 67%
src/model0% | 0% | 0% | 61% | 38%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in make_data_radioactive.py
110 30 1
def get_optimizer()
in src/utils.py
58 21 2
def main()
in train-classif.py
74 20 1
def get_data_loader()
in src/dataset.py
42 18 6
def main()
in train-logistic.py
81 16 1
30 16 5
def get_dump_path()
in src/utils.py
29 16 1
72 15 1
def main()
in train-distillation.py
77 14 1
48 14 6
def __init__()
in src/trainer.py
39 12 5
def sample_params()
in src/data_augmentations/__init__.py
33 10 3
def _find_classes()
in src/datasets/folder.py
8 9 2
def end_epoch()
in src/trainer.py
22 8 2
def eval_classif()
in src/evaluator.py
14 8 4
def __init__()
in src/datasets/folder.py
38 7 6
def create_logger()
in src/logger.py
22 7 2
def print_stats()
in src/trainer.py
18 7 1
def make_dataset()
in src/datasets/folder.py
14 6 3
def __init__()
in src/datasets/sampler.py
17 6 5