facebookresearch / UnsupervisedMT
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
  • 10% duplication:
    • 4,471 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 449 duplicated lines
  • 30 duplicates
system10% (449 lines)
Duplication per Extension
py10% (449 lines)
Duplication per Component (primary)
NMT/src/model24% (371 lines)
NMT/src/data6% (42 lines)
NMT/src1% (24 lines)
PBSMT/src10% (12 lines)
PBSMT0% (0 lines)
NMT0% (0 lines)
NMT/src/modules0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 30 duplicates...
Size#FoldersFilesLinesCode
29 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
244:274 (5%)
230:260 (8%)
view
23 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
180:206 (3%)
185:213 (7%)
view
22 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
794:821 (3%)
433:460 (6%)
view
19 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
506:530 (3%)
377:401 (5%)
view
16 x 2 NMT/src/model
NMT/src/model
attention.py
transformer.py
259:274 (2%)
184:199 (4%)
view
16 x 2 NMT/src/model
NMT/src/model
seq2seq.py
transformer.py
245:260 (4%)
184:199 (4%)
view
15 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
55:71 (2%)
64:82 (4%)
view
15 x 2 NMT/src/data
NMT/src/data
loader.py
loader.py
166:184 (4%)
223:241 (4%)
view
12 x 2 NMT/src/data
PBSMT/src
dictionary.py
dictionary.py
35:60 (10%)
14:41 (38%)
view
11 x 2 NMT/src/model
NMT/src/model
seq2seq.py
seq2seq.py
66:78 (3%)
199:211 (3%)
view
11 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
57:67 (1%)
199:211 (3%)
view
11 x 2 NMT/src/model
NMT/src/model
attention.py
attention.py
57:67 (1%)
194:204 (1%)
view
11 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
194:204 (1%)
66:78 (3%)
view
9 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
32:45 (1%)
41:54 (2%)
view
9 x 2 NMT/src/model
NMT/src/model
lm.py
seq2seq.py
65:73 (10%)
204:213 (2%)
view
9 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
151:164 (1%)
156:169 (2%)
view
9 x 2 NMT/src/model
NMT/src/model
attention.py
lm.py
198:206 (1%)
65:73 (10%)
view
8 x 2 NMT/src/model
NMT/src/model
attention.py
seq2seq.py
770:779 (1%)
417:426 (2%)
view
7 x 2 NMT/src/model
NMT/src/model
attention.py
lm.py
61:67 (1%)
65:71 (8%)
view
7 x 2 NMT/src/model
NMT/src/model
lm.py
seq2seq.py
65:71 (8%)
71:78 (2%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
7 x 2 PBSMT/src
NMT/src/data
dictionary.py
dictionary.py
0:0 
0:0 
view