facebookresearch / OnlineAttacks
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 221 units with 2,247 lines of code in units (53.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (279 lines of code)
    • 13 simple units (504 lines of code)
    • 204 very simple units (1,464 lines of code)
0% | 0% | 12% | 22% | 65%
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% | 12% | 22% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
online_attacks/classifiers/cifar0% | 0% | 29% | 0% | 70%
online_attacks/utils/optimizer0% | 0% | 47% | 11% | 41%
online_attacks/scripts0% | 0% | 10% | 48% | 40%
online_attacks/online_algorithms0% | 0% | 11% | 37% | 50%
online_attacks/experiments0% | 0% | 0% | 44% | 55%
online_attacks/classifiers0% | 0% | 0% | 71% | 28%
online_attacks/utils0% | 0% | 0% | 0% | 100%
online_attacks/datastream0% | 0% | 0% | 0% | 100%
online_attacks/classifiers/mnist0% | 0% | 0% | 0% | 100%
online_attacks/classifiers/madry0% | 0% | 0% | 0% | 100%
online_attacks0% | 0% | 0% | 0% | 100%
online_attacks/attacks0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in online_attacks/classifiers/cifar/models/wide_resnet.py
149 19 2
def step()
in online_attacks/utils/optimizer/sls/sls.py
66 13 2
def run()
in online_attacks/scripts/train_classifiers.py
39 12 2
def action()
in online_attacks/online_algorithms/stochastic_virtual.py
25 12 3
def eval_comp_ratio()
in online_attacks/scripts/eval_all.py
98 10 4
def compute_hist()
in online_attacks/scripts/compute_hist_all.py
58 9 4
def action()
in online_attacks/online_algorithms/stochastic_optimistic.py
19 9 3
def action()
in online_attacks/online_algorithms/stochastic_virtual_ref.py
24 9 3
def action()
in online_attacks/online_algorithms/stochastic_modified_virtual.py
23 9 3
def main()
in online_attacks/experiments/stochastic_toy.py
68 7 0
def main()
in online_attacks/experiments/toy.py
59 7 0
def test()
in online_attacks/classifiers/trainer.py
39 7 2
def action()
in online_attacks/online_algorithms/stochastic_single_ref.py
17 7 3
def run_experiment()
in online_attacks/experiments/stochastic_toy.py
29 6 3
def step()
in online_attacks/utils/optimizer/extragradient.py
16 6 2
def random_model()
in online_attacks/scripts/random_eval.py
18 6 3
def train()
in online_attacks/classifiers/trainer.py
36 6 2
def __init__()
in online_attacks/datastream/toy_data.py
18 5 3
def __init__()
in online_attacks/datastream/toy_data.py
25 5 4
def run_experiment()
in online_attacks/experiments/hyper_search_stochastic_toy.py
29 5 3