facebookresearch / minihack
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
  • 19% duplication:
    • 7,978 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,516 duplicated lines
  • 957 duplicates
system19% (1,516 lines)
Duplication per Extension
py19% (1,462 lines)
yaml20% (54 lines)
Duplication per Component (primary)
minihack/agent/polybeast/models47% (422 lines)
minihack/tiles46% (313 lines)
minihack/agent/rllib46% (272 lines)
minihack/agent/polybeast15% (165 lines)
minihack/envs9% (165 lines)
minihack/scripts13% (98 lines)
minihack5% (67 lines)
minihack/agent/polybeast/core5% (14 lines)
ROOT0% (0 lines)
minihack/agent0% (0 lines)
minihack/agent/common/util0% (0 lines)
minihack/agent/common0% (0 lines)
minihack/agent/common/models0% (0 lines)
minihack/agent/common/envs0% (0 lines)

Duplication Between Components (50+ lines)

G minihack/agent/polybeast/models minihack/agent/polybeast/models minihack/agent/rllib minihack/agent/rllib minihack/agent/polybeast/models--minihack/agent/rllib 529 minihack/agent/polybeast minihack/agent/polybeast minihack/agent/polybeast--minihack/agent/rllib 54 minihack/scripts minihack/scripts minihack/agent/polybeast--minihack/scripts 197

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 957 duplicates...
Size#FoldersFilesLinesCode
59 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
337:410 (15%)
331:404 (16%)
view
49 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
276:342 (12%)
270:336 (13%)
view
43 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
143:207 (11%)
142:206 (12%)
view
33 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
236:274 (8%)
230:268 (9%)
view
31 x 2 minihack/agent/polybeast/models
minihack/agent/polybeast/models
base.py
intrinsic.py
481:531 (8%)
259:308 (6%)
view
27 x 2 minihack/agent/polybeast/models
minihack/agent/polybeast/models
intrinsic.py
intrinsic.py
389:425 (5%)
604:640 (5%)
view
26 x 2 minihack/agent/polybeast
minihack/scripts
evaluate.py
play.py
261:286 (11%)
286:311 (9%)
view
24 x 2 minihack/agent/polybeast/models
minihack/agent/polybeast/models
base.py
intrinsic.py
533:566 (6%)
604:637 (5%)
view
24 x 2 minihack/agent/polybeast/models
minihack/agent/polybeast/models
base.py
intrinsic.py
533:566 (6%)
389:422 (5%)
view
23 x 2 minihack/agent/polybeast/models
minihack/agent/polybeast/models
intrinsic.py
intrinsic.py
226:271 (5%)
519:565 (5%)
view
21 x 2 minihack/agent/polybeast
minihack/scripts
evaluate.py
play.py
159:184 (8%)
199:223 (7%)
view
20 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
64:90 (5%)
94:120 (5%)
view
19 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
intrinsic.py
models.py
284:308 (4%)
482:506 (5%)
view
19 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
507:531 (4%)
482:506 (5%)
view
16 x 2 minihack/agent/polybeast
minihack/agent/rllib
config.yaml
config.yaml
15:34 (18%)
15:34 (17%)
view
16 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
31:54 (4%)
67:90 (4%)
view
15 x 2 minihack/agent/polybeast
minihack/scripts
evaluate.py
play.py
219:233 (6%)
257:271 (5%)
view
12 x 2 minihack/agent/polybeast/models
minihack/agent/polybeast/models
base.py
intrinsic.py
457:478 (3%)
530:551 (2%)
view
12 x 2 minihack/agent/polybeast
minihack/scripts
evaluate.py
play.py
237:248 (5%)
275:286 (4%)
view
12 x 2 minihack/agent/polybeast/models
minihack/agent/polybeast/models
base.py
intrinsic.py
457:478 (3%)
237:258 (2%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
42 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
0:0 
0:0 
view
13 x 2 minihack/agent/polybeast/models
minihack/agent/rllib
base.py
models.py
0:0 
0:0 
view
6 x 2 minihack
minihack
reward_manager.py
reward_manager.py
0:0 
0:0 
view