facebookresearch / OnlineAttacks
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 21% duplication:
    • 3,792 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 831 duplicated lines
  • 59 duplicates
system21% (831 lines)
Duplication per Extension
py22% (831 lines)
Duplication per Component (primary)
online_attacks/scripts32% (277 lines)
online_attacks/experiments50% (215 lines)
online_attacks/online_algorithms26% (117 lines)
online_attacks/classifiers/cifar14% (103 lines)
online_attacks/classifiers/mnist19% (39 lines)
online_attacks/attacks22% (27 lines)
online_attacks/datastream15% (24 lines)
online_attacks/utils12% (22 lines)
online_attacks/classifiers3% (7 lines)
ROOT0% (0 lines)
online_attacks/utils/optimizer0% (0 lines)
online_attacks0% (0 lines)
online_attacks/classifiers/madry0% (0 lines)

Duplication Between Components (50+ lines)

G online_attacks/classifiers/cifar online_attacks/classifiers/cifar online_attacks/classifiers/mnist online_attacks/classifiers/mnist online_attacks/classifiers/cifar--online_attacks/classifiers/mnist 78

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 59 duplicates...
Size#FoldersFilesLinesCode
30 x 2 online_attacks/experiments
online_attacks/experiments
hyper_search_stochastic_toy.py
stochastic_toy.py
46:83 (44%)
27:66 (28%)
view
29 x 2 online_attacks/experiments
online_attacks/experiments
stochastic_toy.py
toy.py
34:75 (27%)
34:71 (29%)
view
25 x 2 online_attacks/experiments
online_attacks/experiments
stochastic_toy.py
toy.py
87:113 (23%)
77:104 (25%)
view
23 x 2 online_attacks/experiments
online_attacks/experiments
hyper_search_stochastic_toy.py
toy.py
53:83 (34%)
34:62 (23%)
view
22 x 2 online_attacks/scripts
online_attacks/scripts
eval_classifiers.py
hist_classifiers.py
28:51 (38%)
96:119 (15%)
view
21 x 2 online_attacks/scripts
online_attacks/scripts
compute_hist_all.py
eval_all.py
109:131 (16%)
153:175 (13%)
view
20 x 2 online_attacks/scripts
online_attacks/scripts
compute_hist_all.py
eval_all.py
49:68 (15%)
43:62 (12%)
view
17 x 2 online_attacks/scripts
online_attacks/scripts
batch_online_attacks.py
compute_hist_all.py
35:51 (36%)
111:127 (13%)
view
17 x 2 online_attacks/scripts
online_attacks/scripts
batch_online_attacks.py
eval_all.py
35:51 (36%)
155:171 (10%)
view
16 x 2 online_attacks/online_algorithms
online_attacks/online_algorithms
stochastic_modified_virtual.py
stochastic_virtual.py
34:51 (36%)
34:51 (34%)
view
16 x 2 online_attacks/scripts
online_attacks/scripts
eval_all.py
online_attacks_sweep.py
51:67 (10%)
90:107 (11%)
view
15 x 2 online_attacks/online_algorithms
online_attacks/online_algorithms
stochastic_optimistic.py
stochastic_single_ref.py
34:50 (37%)
109:125 (14%)
view
14 x 2 online_attacks/classifiers/cifar/models
online_attacks/classifiers/cifar/models
resnet.py
resnet.py
25:39 (13%)
62:76 (13%)
view
12 x 2 online_attacks/online_algorithms
online_attacks/online_algorithms
stochastic_modified_virtual.py
stochastic_optimistic.py
34:47 (27%)
34:47 (30%)
view
12 x 2 online_attacks/classifiers/cifar
online_attacks/classifiers/mnist
train.py
train.py
36:49 (30%)
33:46 (34%)
view
12 x 2 online_attacks/online_algorithms
online_attacks/online_algorithms
stochastic_optimistic.py
stochastic_virtual.py
34:47 (30%)
34:47 (26%)
view
12 x 2 online_attacks/datastream
online_attacks/datastream
toy_data.py
toy_data.py
17:28 (22%)
49:60 (22%)
view
12 x 2 online_attacks/online_algorithms
online_attacks/online_algorithms
stochastic_virtual.py
stochastic_virtual_ref.py
34:47 (26%)
45:59 (22%)
view
12 x 2 online_attacks/online_algorithms
online_attacks/online_algorithms
stochastic_single_ref.py
stochastic_virtual_ref.py
109:122 (11%)
45:59 (22%)
view
12 x 2 online_attacks/scripts
online_attacks/scripts
batch_online_attacks.py
random_eval.py
18:33 (25%)
87:99 (15%)
view