facebookresearch / CompilerGym
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
  • 9% duplication:
    • 17,755 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,632 duplicated lines
  • 106 duplicates
system9% (1,632 lines)
Duplication per Extension
py7% (732 lines)
js21% (719 lines)
cmake6% (137 lines)
cc2% (30 lines)
scss2% (14 lines)
Duplication per Component (primary)
www/frontends18% (733 lines)
compiler_gym/envs10% (641 lines)
build_tools/cmake6% (137 lines)
compiler_gym/service4% (79 lines)
www9% (16 lines)
compiler_gym/views5% (14 lines)
compiler_gym/wrappers3% (12 lines)
leaderboard/llvm_instcount0% (0 lines)
ROOT0% (0 lines)
compiler_gym0% (0 lines)
compiler_gym/util0% (0 lines)
compiler_gym/datasets0% (0 lines)
compiler_gym/spaces0% (0 lines)
compiler_gym/leaderboard0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 106 duplicates...
Size#FoldersFilesLinesCode
51 x 2 www/frontends/compiler_g...nts/StateVisualizations
www/frontends/compiler_g...nts/StateVisualizations
AutophaseStateContainer.js
InstcountsStateContainer.js
72:124 (27%)
66:118 (26%)
view
39 x 2 www/frontends/compiler_g...nts/StateVisualizations
www/frontends/compiler_g...nts/StateVisualizations
AutophaseHistoricalChart.js
InstCountsHistoricalChart.js
65:104 (41%)
65:104 (41%)
view
37 x 2 compiler_gym/envs/gcc/datasets
compiler_gym/envs/llvm/datasets
anghabench.py
anghabench.py
14:66 (90%)
19:78 (46%)
view
31 x 2 www/frontends/compiler_g...nts/StateVisualizations
www/frontends/compiler_g...nts/StateVisualizations
AutophaseStateContainer.js
InstcountsStateContainer.js
136:168 (16%)
133:165 (16%)
view
24 x 2 www/frontends/compiler_g...nts/StateVisualizations
www/frontends/compiler_g...nts/StateVisualizations
AutophaseHistoricalChart.js
InstCountsHistoricalChart.js
38:63 (25%)
38:63 (25%)
view
21 x 2 www/frontends/compiler_g...nts/StateVisualizations
www/frontends/compiler_g...nts/StateVisualizations
AutophaseStateContainer.js
InstcountsStateContainer.js
202:222 (11%)
202:222 (10%)
view
20 x 2 www/frontends/compiler_g...nts/StateVisualizations
www/frontends/compiler_g...nts/StateVisualizations
AutophaseStateContainer.js
InstcountsStateContainer.js
35:64 (10%)
30:59 (10%)
view
19 x 2 compiler_gym/service
compiler_gym/service
connection.py
connection.py
432:450 (4%)
543:561 (4%)
view
18 x 2 compiler_gym/envs/gcc
compiler_gym/envs/gcc
gcc_rewards.py
gcc_rewards.py
17:38 (39%)
48:69 (39%)
view
18 x 2 www/frontends/compiler_g...nts/StateVisualizations
www/frontends/compiler_g...nts/StateVisualizations
AutophaseHistoricalChart.js
InstCountsHistoricalChart.js
15:36 (19%)
15:36 (19%)
view
18 x 2 compiler_gym/envs/gcc/datasets
compiler_gym/envs/llvm/datasets
chstone.py
chstone.py
51:68 (23%)
50:67 (20%)
view
17 x 2 compiler_gym/envs/gcc/datasets
compiler_gym/envs/llvm/datasets
chstone.py
chstone.py
15:49 (22%)
17:49 (19%)
view
17 x 2 compiler_gym/envs/llvm/datasets
compiler_gym/envs/llvm/datasets
anghabench.py
chstone.py
98:116 (21%)
98:116 (19%)
view
17 x 2 compiler_gym/envs/gcc/datasets
compiler_gym/envs/llvm/datasets
csmith.py
csmith.py
91:122 (13%)
97:128 (13%)
view
16 x 2 compiler_gym/envs/gcc/datasets
compiler_gym/envs/llvm/datasets
csmith.py
csmith.py
47:89 (12%)
54:96 (12%)
view
14 x 2 www/frontends/compiler_gym/src/components/Sections
www/frontends/compiler_g...nts/StateVisualizations
RewardHistoryChart.js
ModalSingleChart.js
69:82 (10%)
28:41 (22%)
view
13 x 2 compiler_gym/envs/llvm/datasets
compiler_gym/envs/llvm/datasets
anghabench.py
chstone.py
118:132 (16%)
122:136 (14%)
view
13 x 2 www/frontends/compiler_g...nts/StateVisualizations
www/frontends/compiler_g...nts/StateVisualizations
AutophaseStateContainer.js
InstcountsStateContainer.js
187:200 (6%)
187:200 (6%)
view
11 x 2 www/frontends/compiler_gym/src/components/Sections
www/frontends/compiler_gym/src/components/Sections
ControlsContainer.js
ControlsContainer.js
155:165 (3%)
182:192 (3%)
view
11 x 2 www/frontends/compiler_gym/src/components/Sections
www/frontends/compiler_g...nts/StateVisualizations
ActionsHeatMap.js
SparkLineTable.js
167:178 (6%)
94:104 (7%)
view
Duplicated Units
The list of top 3 duplicated units.
See data for all 3 unit duplicates...
Size#FoldersFilesLinesCode
14 x 2 compiler_gym/envs/llvm/datasets
compiler_gym/envs/llvm/datasets
chstone.py
anghabench.py
0:0 
0:0 
view
7 x 2 compiler_gym/envs/llvm/datasets
compiler_gym/envs/gcc/datasets
anghabench.py
anghabench.py
0:0 
0:0 
view
6 x 2 compiler_gym/spaces
compiler_gym/spaces
tuple.py
dict.py
0:0 
0:0 
view