facebookresearch / ContextualBanditsAttacks
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 168 units with 1,681 lines of code in units (60.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (146 lines of code)
    • 21 medium size units (594 lines of code)
    • 28 small units (398 lines of code)
    • 117 very small units (543 lines of code)
0% | 8% | 35% | 23% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 8% | 35% | 23% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
isoexp0% | 40% | 31% | 11% | 16%
isoexp/mab0% | 7% | 55% | 15% | 21%
isoexp/linear0% | 0% | 18% | 34% | 46%
isoexp/contextual0% | 0% | 15% | 36% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def work()
in isoexp/devfair_reward_attack.py
91 22 12
def attacked_FTRL()
in isoexp/mab/smab_algs.py
55 8 7
def attacked_EXP3_P()
in isoexp/mab/smab_algs.py
49 9 7
def attacked_UCB1()
in isoexp/mab/smab_algs.py
44 6 6
def attacked_EXP3_IX()
in isoexp/mab/smab_algs.py
40 6 6
def FTRL()
in isoexp/mab/smab_algs.py
33 5 4
def __init__()
in isoexp/contextual/contextual_models.py
31 5 6
def __init__()
in isoexp/linear/linearbandit.py
29 4 11
def BootstrapedUCB()
in isoexp/mab/smab_algs.py
29 3 4
def epsGREEDY()
in isoexp/mab/smab_algs.py
27 5 3
def PHE()
in isoexp/mab/smab_algs.py
26 4 3
def Random_exploration()
in isoexp/mab/smab_algs.py
26 4 3
def solve_MLE()
in isoexp/linear/linearbandit.py
25 4 3
def compute_attack()
in isoexp/main_attack_one_user.py
25 4 4
def __init__()
in isoexp/contextual/contextual_models.py
24 3 7
def compute_relaxed_attack()
in isoexp/main_attack_one_user.py
24 6 4
def SoftMAB()
in isoexp/mab/smab_algs.py
24 4 3
def ExploreThenExploit()
in isoexp/mab/smab_algs.py
24 4 3
def EXP3_P()
in isoexp/mab/smab_algs.py
24 3 4
def __init__()
in isoexp/linear/linearmab_models.py
23 5 9