facebookresearch / ContextualBanditsAttacks
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 168 units with 1,681 lines of code in units (60.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (91 lines of code)
    • 6 simple units (233 lines of code)
    • 161 very simple units (1,357 lines of code)
0% | 0% | 5% | 13% | 80%
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% | 5% | 13% | 80%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
isoexp0% | 0% | 40% | 20% | 39%
isoexp/mab0% | 0% | 0% | 26% | 73%
isoexp/linear0% | 0% | 0% | 0% | 100%
isoexp/contextual0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def work()
in isoexp/devfair_reward_attack.py
91 22 12
def attacked_EXP3_P()
in isoexp/mab/smab_algs.py
49 9 7
def attacked_FTRL()
in isoexp/mab/smab_algs.py
55 8 7
def run_and_output()
in isoexp/devfair_reward_attack.py
21 6 1
def compute_relaxed_attack()
in isoexp/main_attack_one_user.py
24 6 4
def attacked_EXP3_IX()
in isoexp/mab/smab_algs.py
40 6 6
def attacked_UCB1()
in isoexp/mab/smab_algs.py
44 6 6
def __init__()
in isoexp/contextual/contextual_models.py
31 5 6
def __init__()
in isoexp/linear/linearmab_models.py
23 5 9
def get_action()
in isoexp/mab/contextual_mab_algs.py
12 5 3
def epsGREEDY()
in isoexp/mab/smab_algs.py
27 5 3
def quantile()
in isoexp/mab/smab_algs.py
18 5 6
def FTRL()
in isoexp/mab/smab_algs.py
33 5 4
def get_action()
in isoexp/contextual/contextual_linucb.py
12 4 2
def __init__()
in isoexp/linear/linearbandit.py
29 4 11
def solve_MLE()
in isoexp/linear/linearbandit.py
25 4 3
def work()
in isoexp/linear/linearbandit.py
13 4 2
def __init__()
in isoexp/linear/linearmab_models.py
15 4 7
def compute_attack()
in isoexp/main_attack_one_user.py
25 4 4
def __init__()
in isoexp/mab/contextual_mab_algs.py
16 4 5