facebookresearch / ParlAI
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
  • 15% duplication:
    • 84,546 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 13,145 duplicated lines
  • 5,011 duplicates
system15% (13,145 lines)
Duplication per Extension
py12% (9,985 lines)
css88% (1,593 lines)
jsx42% (1,326 lines)
js16% (115 lines)
yaml20% (66 lines)
html14% (60 lines)
Duplication per Component (primary)
parlai/tasks19% (5,183 lines)
parlai/crowdsourcing19% (2,198 lines)
website/static93% (1,593 lines)
parlai/agents13% (1,573 lines)
parlai/core5% (615 lines)
parlai/chat_service13% (364 lines)
projects/light_whoami11% (326 lines)
parlai/scripts6% (297 lines)
parlai/zoo26% (234 lines)
projects/blenderbot212% (187 lines)
parlai/utils2% (91 lines)
parlai/mutators60% (82 lines)
projects/anti_scaling9% (78 lines)
projects/style_gen24% (70 lines)
projects/wizard_of_wikipedia6% (53 lines)
projects/msc15% (51 lines)
projects/image_chat6% (37 lines)
projects/params_vs_compute18% (26 lines)
projects/personality_captions3% (23 lines)
projects/safety_bench5% (20 lines)
parlai/nn4% (14 lines)
projects/dialogue_unlikelihood3% (12 lines)
projects/safety_recipes7% (10 lines)
parlai/torchscript1% (8 lines)
ROOT0% (0 lines)
projects/genderation_bias0% (0 lines)
projects0% (0 lines)
projects/dialogue_bias0% (0 lines)
projects/multimodal_blenderbot0% (0 lines)
projects/md_gender0% (0 lines)
projects/tod_simulator0% (0 lines)
example_parlai_internal0% (0 lines)
example_parlai_internal/agents0% (0 lines)
website0% (0 lines)
website/templates0% (0 lines)
parlai0% (0 lines)
parlai/opt_presets0% (0 lines)

Duplication Between Components (50+ lines)

G parlai/agents parlai/agents projects/light_whoami projects/light_whoami parlai/agents--projects/light_whoami 290 parlai/core parlai/core parlai/agents--parlai/core 176 parlai/tasks parlai/tasks parlai/agents--parlai/tasks 132 projects/blenderbot2 projects/blenderbot2 parlai/agents--projects/blenderbot2 156 projects/style_gen projects/style_gen parlai/agents--projects/style_gen 61 projects/params_vs_compute projects/params_vs_compute parlai/agents--projects/params_vs_compute 52 parlai/core--projects/light_whoami 169 parlai/core--parlai/tasks 202 parlai/core--projects/style_gen 86 parlai/tasks--projects/light_whoami 54 projects/wizard_of_wikipedia projects/wizard_of_wikipedia parlai/tasks--projects/wizard_of_wikipedia 54 projects/msc projects/msc projects/blenderbot2--projects/msc 62 parlai/crowdsourcing parlai/crowdsourcing projects/safety_recipes projects/safety_recipes parlai/crowdsourcing--projects/safety_recipes 70 parlai/chat_service parlai/chat_service parlai/scripts parlai/scripts parlai/chat_service--parlai/scripts 56

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 5,011 duplicates...
Size#FoldersFilesLinesCode
261 x 2 website/static/css
website/static/css
home-theme.css
parlai.css
544:804 (32%)
673:933 (28%)
view
174 x 2 website/static/css
website/static/css
home-theme.css
parlai.css
8:181 (21%)
92:265 (19%)
view
141 x 2 parlai/crowdsourcing/pro...val/frontend/components
parlai/crowdsourcing/tas...hat/frontend/components
chat_app_with_onboarding.jsx
chat_app_with_onboarding.jsx
22:177 (69%)
22:177 (69%)
view
95 x 2 website/static/css
website/static/css
home-theme.css
parlai.css
260:354 (11%)
344:438 (10%)
view
90 x 2 website/static/css
website/static/css
home-theme.css
parlai.css
345:434 (11%)
446:535 (9%)
view
75 x 2 website/static/css
website/static/css
home-theme.css
parlai.css
183:257 (9%)
267:341 (8%)
view
71 x 2 website/static/css
website/static/css
home-theme.css
parlai.css
456:526 (8%)
583:653 (7%)
view
67 x 2 parlai/crowdsourcing/pro...val/frontend/components
parlai/crowdsourcing/tas...hat/frontend/components
response_panes.jsx
response_panes.jsx
125:201 (39%)
181:257 (31%)
view
60 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
builder.py
builder.py
16:86 (18%)
131:201 (9%)
view
60 x 2 parlai/agents/ir_baseline
parlai/tasks/wizard_of_wikipedia
ir_baseline.py
agents.py
89:148 (28%)
961:1020 (6%)
view
48 x 2 parlai/tasks/light_dialog_wild
parlai/tasks/light_dialog_wild
agents.py
agents.py
209:257 (11%)
313:361 (11%)
view
45 x 2 parlai/tasks/multiwoz_v20
parlai/tasks/multiwoz_v21
agents.py
agents.py
50:101 (80%)
50:101 (80%)
view
42 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
builder.py
builder.py
160:201 (12%)
270:311 (6%)
view
36 x 2 parlai/crowdsourcing/pro...val/frontend/components
parlai/crowdsourcing/tas...hat/frontend/components
chat_app_with_onboarding.jsx
chat_app_with_onboarding.jsx
189:230 (17%)
189:230 (17%)
view
35 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
agents.py
agents.py
238:272 (14%)
283:317 (8%)
view
35 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
agents.py
agents.py
171:205 (14%)
179:213 (8%)
view
34 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
agents.py
agents.py
82:115 (13%)
56:89 (8%)
view
34 x 2 parlai/chat_service/core
parlai/chat_service/services/websocket
chat_service_manager.py
websocket_manager.py
698:737 (8%)
97:136 (21%)
view
31 x 2 parlai/crowdsourcing/pro...val/frontend/components
parlai/crowdsourcing/tas...hat/frontend/components
message.jsx
message.jsx
150:180 (20%)
53:83 (41%)
view
30 x 2 parlai/agents/transformer/modules
projects/light_whoami/agents
decoder.py
expanded_attention.py
113:148 (10%)
826:870 (3%)
view
Duplicated Units
The list of top 20 duplicated units.
See data for all 43 unit duplicates...
Size#FoldersFilesLinesCode
28 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
builder.py
builder.py
0:0 
0:0 
view
23 x 2 parlai/tasks/multiwoz_v20
parlai/tasks/multiwoz_v21
agents.py
agents.py
0:0 
0:0 
view
20 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
builder.py
builder.py
0:0 
0:0 
view
16 x 2 projects/blenderbot2/agents
projects/blenderbot2/agents
modules.py
modules.py
0:0 
0:0 
view
15 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
builder.py
builder.py
0:0 
0:0 
view
23 x 2 parlai/tasks/vqa_v1
parlai/tasks/flickr30k
agents.py
agents.py
0:0 
0:0 
view
13 x 2 parlai/tasks/light_dialog
parlai/tasks/light_dialog_wild
builder.py
builder.py
0:0 
0:0 
view
12 x 2 parlai/tasks/squad2
parlai/tasks/squad2
agents.py
agents.py
0:0 
0:0 
view
15 x 2 parlai/tasks/casino
parlai/tasks/dealnodeal
agents.py
agents.py
0:0 
0:0 
view
12 x 2 parlai/agents/bert_ranker
parlai/agents/bert_ranker
bi_encoder_ranker.py
cross_encoder_ranker.py
0:0 
0:0 
view
10 x 2 parlai/tasks/squad2
parlai/tasks/squad
agents.py
agents.py
0:0 
0:0 
view
10 x 2 parlai/tasks/taskmaster
parlai/tasks/taskmaster2
agents.py
agents.py
0:0 
0:0 
view
10 x 2 parlai/tasks/taskmaster
parlai/tasks/taskmaster2
agents.py
agents.py
0:0 
0:0 
view
10 x 2 parlai/tasks/multiwoz_v20
parlai/tasks/multiwoz_v21
agents.py
agents.py
0:0 
0:0 
view
12 x 2 projects/style_gen
parlai/core
classifier.py
torch_classifier_agent.py
0:0 
0:0 
view
12 x 2 projects/light_whoami/agents
parlai/core
poly_return_weights.py
torch_generator_agent.py
0:0 
0:0 
view
13 x 2 parlai/tasks/qacnn
parlai/tasks/qadailymail
build.py
build.py
0:0 
0:0 
view
9 x 2 parlai/tasks/squad2
parlai/tasks/squad2
agents.py
agents.py
0:0 
0:0 
view
9 x 2 parlai/tasks/squad
parlai/tasks/squad
agents.py
agents.py
0:0 
0:0 
view
8 x 2 projects/safety_bench/model_wrappers
projects/safety_bench/model_wrappers
gpt_wrappers.py
gpt_wrappers.py
0:0 
0:0 
view