microsoft / TextWorld
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
  • 5% duplication:
    • 9,985 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 572 duplicated lines
  • 73 duplicates
system5% (572 lines)
Duplication per Extension
py6% (572 lines)
Duplication per Component (primary)
textworld/generator4% (176 lines)
textworld/logic9% (160 lines)
textworld/envs10% (84 lines)
textworld/textgen12% (34 lines)
textworld/agents30% (34 lines)
textworld/gym7% (18 lines)
benchmark10% (16 lines)
textworld3% (14 lines)
textworld/render1% (12 lines)
textworld/challenges<1% (12 lines)
scripts5% (12 lines)
ROOT0% (0 lines)
src0% (0 lines)

Duplication Between Components (50+ lines)

G textworld/logic textworld/logic textworld/textgen textworld/textgen textworld/logic--textworld/textgen 74

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 73 duplicates...
Size#FoldersFilesLinesCode
17 x 2 textworld/agents
textworld/agents
random.py
simple.py
10:29 (58%)
10:29 (100%)
view
16 x 2 benchmark
textworld/agents
agent_template.py
simple.py
11:29 (94%)
11:29 (94%)
view
16 x 2 benchmark
textworld/agents
agent_template.py
random.py
11:29 (94%)
11:29 (55%)
view
14 x 2 textworld/envs
textworld/envs/wrappers
tw.py
tw_inform7.py
68:88 (12%)
233:253 (5%)
view
14 x 2 textworld
textworld/envs/glulx
core.py
git_glulx.py
233:252 (8%)
129:148 (17%)
view
13 x 2 textworld/logic
textworld/textgen
parser.py
parser.py
70:83 (2%)
70:83 (7%)
view
11 x 2 textworld/generator
textworld/generator
world.py
world.py
400:414 (2%)
518:532 (2%)
view
9 x 2 textworld/gym
textworld/gym
utils.py
utils.py
10:18 (16%)
110:118 (16%)
view
9 x 2 textworld/envs
textworld/envs/wrappers
tw.py
tw_inform7.py
47:56 (8%)
360:369 (3%)
view
9 x 2 textworld/logic
textworld/textgen
parser.py
parser.py
41:49 (1%)
41:49 (4%)
view
9 x 2 textworld/logic
textworld/logic
parser.py
parser.py
110:118 (1%)
200:208 (1%)
view
9 x 2 textworld/generator
textworld/generator
world.py
world.py
476:487 (2%)
561:572 (2%)
view
9 x 2 textworld/generator
textworld/generator
maker.py
maker.py
171:180 (2%)
186:195 (2%)
view
7 x 2 textworld/generator/inform7
textworld/generator/inform7
world2inform7.py
world2inform7.py
476:527 (1%)
824:866 (1%)
view
7 x 2 textworld/generator/inform7
textworld/generator/inform7
world2inform7.py
world2inform7.py
564:600 (1%)
866:909 (1%)
view
7 x 2 textworld/generator/inform7
textworld/generator/inform7
world2inform7.py
world2inform7.py
657:754 (1%)
866:909 (1%)
view
7 x 2 textworld/generator/inform7
textworld/generator/inform7
world2inform7.py
world2inform7.py
1049:1055 (1%)
1079:1085 (1%)
view
7 x 2 textworld/generator/inform7
textworld/generator/inform7
world2inform7.py
world2inform7.py
420:476 (1%)
824:866 (1%)
view
7 x 2 textworld/generator/inform7
textworld/generator/inform7
world2inform7.py
world2inform7.py
754:824 (1%)
866:909 (1%)
view
7 x 2 textworld/generator/inform7
textworld/generator/inform7
world2inform7.py
world2inform7.py
824:866 (1%)
866:909 (1%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
7 x 3 benchmark
textworld/agents
textworld/agents
agent_template.py
random.py
simple.py
0:0 
0:0 
0:0 
view