facebookresearch / ReAgent
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
  • 14% duplication:
    • 30,421 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 4,393 duplicated lines
  • 480 duplicates
system14% (4,393 lines)
Duplication per Extension
py15% (4,309 lines)
cpp4% (44 lines)
yaml28% (34 lines)
h<1% (6 lines)
Duplication per Component (primary)
reagent/model_managers45% (932 lines)
reagent/training16% (668 lines)
reagent/ope18% (659 lines)
reagent/net_builder38% (447 lines)
reagent/reporting58% (361 lines)
reagent/models12% (321 lines)
reagent/gym7% (234 lines)
reagent/evaluation6% (134 lines)
reagent/prediction13% (107 lines)
reagent/lite12% (92 lines)
reagent/preprocessing5% (89 lines)
reagent/workflow10% (85 lines)
reagent/mab13% (63 lines)
serving/reagent2% (50 lines)
reagent/data7% (45 lines)
reagent/publishers34% (40 lines)
reagent/replay_memory5% (36 lines)
reagent/core<1% (18 lines)
reagent/optimizer3% (12 lines)
serving0% (0 lines)
serving/scripts0% (0 lines)
ROOT0% (0 lines)
reagent/model_utils0% (0 lines)
reagent0% (0 lines)
reagent/samplers0% (0 lines)
reagent/scripts0% (0 lines)
reagent/validators0% (0 lines)
preprocessing/src0% (0 lines)

Duplication Between Components (50+ lines)

G reagent/data reagent/data reagent/model_managers reagent/model_managers reagent/data--reagent/model_managers 58

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 480 duplicates...
Size#FoldersFilesLinesCode
37 x 2 reagent/reporting
reagent/reporting
discrete_crr_reporter.py
discrete_dqn_reporter.py
42:78 (42%)
41:77 (42%)
view
35 x 2 reagent/training/ranking
reagent/training/ranking
seq2slate_tf_trainer.py
seq2slate_trainer.py
111:156 (33%)
233:278 (17%)
view
29 x 2 reagent/model_managers/model_based
reagent/model_managers
synthetic_reward.py
parametric_dqn_base.py
211:240 (15%)
155:184 (24%)
view
27 x 2 reagent/ope/estimators
reagent/ope/estimators
slate_estimators.py
slate_estimators.py
1393:1421 (2%)
1495:1523 (2%)
view
26 x 2 reagent/ope/estimators
reagent/ope/estimators
slate_estimators.py
slate_estimators.py
1203:1230 (2%)
1393:1420 (2%)
view
26 x 2 reagent/ope/estimators
reagent/ope/estimators
slate_estimators.py
slate_estimators.py
1203:1230 (2%)
1495:1522 (2%)
view
26 x 2 reagent/reporting
reagent/reporting
discrete_crr_reporter.py
discrete_dqn_reporter.py
79:106 (29%)
79:106 (29%)
view
25 x 2 reagent/training/cfeval
reagent/training
bandit_reward_network_trainer.py
reward_network_trainer.py
20:45 (26%)
69:94 (18%)
view
24 x 2 reagent/training
reagent/training
dqn_trainer.py
qrdqn_trainer.py
105:132 (10%)
87:114 (14%)
view
21 x 2 reagent/reporting
reagent/reporting
seq2reward_reporter.py
seq2reward_reporter.py
50:70 (16%)
109:129 (16%)
view
21 x 2 reagent/model_managers/discrete
reagent/model_managers/discrete
discrete_dqn.py
discrete_qrdqn.py
72:99 (13%)
72:99 (23%)
view
21 x 2 reagent/net_builder/continuous_actor
reagent/net_builder/continuous_actor
fully_connected.py
gaussian_fully_connected.py
27:49 (53%)
28:50 (36%)
view
20 x 2 reagent/evaluation
reagent/evaluation
evaluation_data_page.py
evaluation_data_page.py
276:297 (3%)
430:453 (3%)
view
20 x 2 reagent/mab
reagent/mab
mab_algorithm.py
thompson_sampling.py
125:144 (13%)
75:94 (22%)
view
20 x 2 reagent/model_managers/model_based
reagent/model_managers
synthetic_reward.py
parametric_dqn_base.py
182:203 (10%)
130:152 (16%)
view
20 x 2 reagent/reporting
reagent/reporting
discrete_crr_reporter.py
discrete_dqn_reporter.py
21:40 (22%)
21:40 (22%)
view
19 x 2 reagent/model_managers/discrete
reagent/model_managers/discrete
discrete_crr.py
discrete_dqn.py
132:155 (8%)
76:99 (12%)
view
19 x 2 reagent/training/ranking
reagent/training/ranking
seq2slate_sim_trainer.py
seq2slate_trainer.py
67:85 (14%)
24:42 (9%)
view
19 x 2 reagent/model_managers/discrete
reagent/model_managers/discrete
discrete_crr.py
discrete_qrdqn.py
132:155 (8%)
76:99 (21%)
view
19 x 2 reagent/model_managers/actor_critic
reagent/model_managers/actor_critic
sac.py
td3.py
71:90 (21%)
69:88 (24%)
view
Duplicated Units
The list of top 17 duplicated units.
See data for all 17 unit duplicates...
Size#FoldersFilesLinesCode
23 x 2 reagent/training
reagent/training
qrdqn_trainer.py
dqn_trainer.py
0:0 
0:0 
view
17 x 2 reagent/training/ranking
reagent/training/ranking
seq2slate_sim_trainer.py
seq2slate_trainer.py
0:0 
0:0 
view
13 x 2 reagent/training
reagent/training
reinforce_trainer.py
ppo_trainer.py
0:0 
0:0 
view
9 x 2 reagent/data
reagent/data
oss_data_fetcher.py
data_fetcher.py
0:0 
0:0 
view
8 x 2 reagent/ope/estimators
reagent/ope/estimators
contextual_bandits_estimators.py
contextual_bandits_estimators.py
0:0 
0:0 
view
8 x 2 reagent/training/cfeval
reagent/training
bandit_reward_network_trainer.py
reward_network_trainer.py
0:0 
0:0 
view
8 x 3 reagent/model_managers
reagent/model_managers
reagent/model_managers/model_based
discrete_dqn_base.py
actor_critic_base.py
synthetic_reward.py
0:0 
0:0 
0:0 
view
7 x 2 serving/reagent/serving/operators
serving/reagent/serving/operators
SoftmaxRanker.cpp
Softmax.cpp
14:21 
6:13 
view
7 x 2 reagent/training/ranking
reagent/training/ranking
seq2slate_tf_trainer.py
seq2slate_attn_trainer.py
0:0 
0:0 
view
11 x 2 reagent/workflow
reagent/data
utils.py
manual_data_module.py
0:0 
0:0 
view
7 x 3 reagent/publishers
reagent/publishers
reagent/publishers
model_publisher.py
no_publishing.py
file_system_publisher.py
0:0 
0:0 
0:0 
view
6 x 2 reagent/ope/estimators
reagent/ope/estimators
contextual_bandits_estimators.py
contextual_bandits_estimators.py
0:0 
0:0 
view
6 x 2 reagent/models
reagent/models
seq2slate_reward.py
seq2slate_reward.py
0:0 
0:0 
view
6 x 2 reagent/mab
reagent/mab
mab_algorithm.py
thompson_sampling.py
0:0 
0:0 
view
6 x 2 reagent/net_builder
reagent/net_builder/categorical_dqn
categorical_dqn_net_builder.py
categorical.py
0:0 
0:0 
view
9 x 2 reagent/core
reagent/workflow
utils.py
utils.py
0:0 
0:0 
view
9 x 2 reagent/gym/envs/pomdp
reagent/gym/envs/pomdp
string_game.py
string_game_v1.py
0:0 
0:0 
view