facebookresearch / EGG
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
  • 22% duplication:
    • 10,162 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,293 duplicated lines
  • 264 duplicates
system22% (2,293 lines)
Duplication per Extension
py22% (2,293 lines)
Duplication per Component (primary)
egg/core15% (470 lines)
egg/zoo/language_bottleneck33% (377 lines)
egg/zoo/emcom_as_ssl18% (249 lines)
egg/zoo/simple_autoenc75% (166 lines)
egg/zoo/simclr38% (164 lines)
egg/zoo/channel38% (121 lines)
egg/zoo/external_game35% (111 lines)
egg/zoo/basic_games28% (110 lines)
egg/zoo/compositional_efficiency34% (109 lines)
egg/zoo/objects_game15% (99 lines)
egg/zoo/summation30% (70 lines)
egg/zoo/compo_vs_generalization10% (70 lines)
egg/nest19% (62 lines)
egg/zoo/mnist_vae33% (35 lines)
egg/zoo/mnist_autoenc44% (30 lines)
egg/zoo/dsprites_bvae6% (20 lines)
egg/zoo/signal_game5% (16 lines)
egg/zoo/template11% (14 lines)
egg0% (0 lines)
egg/zoo0% (0 lines)
ROOT0% (0 lines)
scripts0% (0 lines)

Duplication Between Components (50+ lines)

G egg/zoo/emcom_as_ssl egg/zoo/emcom_as_ssl egg/zoo/simclr egg/zoo/simclr egg/zoo/emcom_as_ssl--egg/zoo/simclr 315 egg/zoo/channel egg/zoo/channel egg/zoo/simple_autoenc egg/zoo/simple_autoenc egg/zoo/channel--egg/zoo/simple_autoenc 246 egg/zoo/external_game egg/zoo/external_game egg/zoo/channel--egg/zoo/external_game 102 egg/zoo/summation egg/zoo/summation egg/zoo/channel--egg/zoo/summation 62 egg/zoo/language_bottleneck egg/zoo/language_bottleneck egg/zoo/channel--egg/zoo/language_bottleneck 72 egg/zoo/simple_autoenc--egg/zoo/summation 136 egg/zoo/external_game--egg/zoo/simple_autoenc 174 egg/zoo/external_game--egg/zoo/summation 128 egg/zoo/objects_game egg/zoo/objects_game egg/zoo/external_game--egg/zoo/objects_game 128 egg/zoo/objects_game--egg/zoo/simple_autoenc 134 egg/zoo/objects_game--egg/zoo/summation 96 egg/core egg/core egg/core--egg/zoo/emcom_as_ssl 117 egg/zoo/compo_vs_generalization egg/zoo/compo_vs_generalization egg/zoo/compositional_efficiency egg/zoo/compositional_efficiency egg/zoo/compo_vs_generalization--egg/zoo/compositional_efficiency 90 egg/zoo/compo_vs_generalization--egg/zoo/language_bottleneck 64 egg/zoo/compositional_efficiency--egg/zoo/language_bottleneck 73 egg/zoo/language_bottleneck--egg/zoo/simple_autoenc 88 egg/zoo/language_bottleneck--egg/zoo/summation 60 egg/zoo/language_bottleneck--egg/zoo/objects_game 72 egg/zoo/mnist_vae egg/zoo/mnist_vae egg/zoo/language_bottleneck--egg/zoo/mnist_vae 66 egg/zoo/mnist_autoenc egg/zoo/mnist_autoenc egg/zoo/language_bottleneck--egg/zoo/mnist_autoenc 63 egg/zoo/basic_games egg/zoo/basic_games egg/zoo/basic_games--egg/zoo/simple_autoenc 86 egg/zoo/basic_games--egg/zoo/external_game 86 egg/zoo/basic_games--egg/zoo/summation 60 egg/zoo/dsprites_bvae egg/zoo/dsprites_bvae egg/zoo/dsprites_bvae--egg/zoo/language_bottleneck 66 egg/zoo/mnist_autoenc--egg/zoo/mnist_vae 60

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 264 duplicates...
Size#FoldersFilesLinesCode
57 x 2 egg/zoo/emcom_as_ssl
egg/zoo/simclr
LARC.py
LARC.py
22:134 (100%)
13:125 (100%)
view
44 x 2 egg/zoo/external_game
egg/zoo/simple_autoenc
game.py
train.py
39:86 (16%)
25:72 (25%)
view
43 x 2 egg/zoo/external_game
egg/zoo/summation
game.py
train.py
41:86 (16%)
20:66 (38%)
view
43 x 2 egg/zoo/simple_autoenc
egg/zoo/summation
train.py
train.py
26:72 (24%)
20:66 (38%)
view
27 x 2 egg/core
egg/core
continous_communication.py
gs_wrappers.py
92:122 (31%)
164:193 (8%)
view
27 x 2 egg/zoo/channel
egg/zoo/simple_autoenc
train.py
train.py
20:47 (10%)
18:46 (15%)
view
26 x 2 egg/zoo/external_game
egg/zoo/objects_game
game.py
train.py
59:86 (9%)
94:122 (7%)
view
26 x 2 egg/zoo/objects_game
egg/zoo/simple_autoenc
train.py
train.py
94:122 (7%)
44:72 (15%)
view
26 x 2 egg/zoo/objects_game
egg/zoo/summation
train.py
train.py
94:122 (7%)
38:66 (23%)
view
22 x 2 egg/zoo/emcom_as_ssl
egg/zoo/simclr
data.py
data.py
36:64 (24%)
33:60 (35%)
view
20 x 2 egg/zoo/language_bottleneck/mnist_adv
egg/zoo/language_bottleneck/mnist_overfit
train.py
train.py
20:42 (25%)
21:43 (19%)
view
20 x 2 egg/zoo/channel
egg/zoo/external_game
train.py
game.py
27:47 (7%)
39:61 (7%)
view
20 x 2 egg/zoo/external_game
egg/zoo/objects_game
game.py
train.py
110:130 (7%)
120:140 (5%)
view
19 x 2 egg/zoo/channel
egg/zoo/summation
train.py
train.py
28:47 (7%)
20:40 (16%)
view
17 x 2 egg/zoo/basic_games
egg/zoo/simple_autoenc
play.py
train.py
87:103 (7%)
31:49 (9%)
view
17 x 2 egg/nest
egg/nest
nest.py
nest_local.py
20:36 (11%)
18:34 (20%)
view
17 x 2 egg/zoo/objects_game
egg/zoo/simple_autoenc
train.py
train.py
278:296 (5%)
168:186 (9%)
view
17 x 2 egg/zoo/compo_vs_generalization
egg/zoo/language_bottleneck/guess_number
train.py
train.py
68:84 (4%)
91:107 (6%)
view
17 x 2 egg/zoo/basic_games
egg/zoo/external_game
play.py
game.py
87:103 (7%)
46:64 (6%)
view
17 x 2 egg/zoo/mnist_autoenc
egg/zoo/mnist_vae
train.py
train.py
58:82 (25%)
114:132 (16%)
view
Duplicated Units
The list of top 11 duplicated units.
See data for all 11 unit duplicates...
Size#FoldersFilesLinesCode
29 x 2 egg/zoo/simclr
egg/zoo/emcom_as_ssl
LARC.py
LARC.py
0:0 
0:0 
view
13 x 2 egg/zoo/simclr
egg/zoo/emcom_as_ssl
utils.py
utils.py
0:0 
0:0 
view
8 x 2 egg/zoo/objects_game
egg/zoo/language_bottleneck
util.py
intervention.py
0:0 
0:0 
view
7 x 2 egg/core
egg/core
losses.py
losses.py
0:0 
0:0 
view
7 x 3 egg/core
egg/zoo/simclr
egg/zoo/emcom_as_ssl
losses.py
losses.py
losses.py
0:0 
0:0 
0:0 
view
7 x 2 egg/zoo/simclr
egg/zoo/emcom_as_ssl
archs.py
archs.py
0:0 
0:0 
view
7 x 2 egg/zoo/compositional_efficiency
egg/zoo/compo_vs_generalization
discrete.py
train.py
0:0 
0:0 
view
7 x 2 egg/zoo/compositional_efficiency
egg/zoo/compo_vs_generalization
dataset.py
data.py
0:0 
0:0 
view
7 x 3 egg/zoo/language_bottleneck/mnist_classification
egg/zoo/language_bottleneck/mnist_overfit
egg/zoo/language_bottleneck/mnist_adv
archs.py
archs.py
archs.py
0:0 
0:0 
0:0 
view
6 x 2 egg/core
egg/core
gs_wrappers.py
continous_communication.py
0:0 
0:0 
view
6 x 2 egg/zoo/objects_game
egg/zoo/language_bottleneck
util.py
intervention.py
0:0 
0:0 
view