pytorch / examples
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:
    • 5,113 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 258 duplicated lines
  • 14 duplicates
system5% (258 lines)
Duplication per Extension
py4% (186 lines)
cpp7% (72 lines)
Duplication per Component (primary)
cpp7% (72 lines)
reinforcement_learning36% (59 lines)
distributed4% (47 lines)
dcgan12% (26 lines)
imagenet6% (20 lines)
mnist12% (14 lines)
word_language_model3% (12 lines)
mnist_hogwild7% (8 lines)
fx0% (0 lines)
super_resolution0% (0 lines)
snli0% (0 lines)
time_sequence_prediction0% (0 lines)
fast_neural_style0% (0 lines)
regression0% (0 lines)
vae0% (0 lines)
Longest Duplicates
The list of 14 longest duplicates.
See data for all 14 duplicates...
Size#FoldersFilesLinesCode
24 x 2 cpp/distributed
cpp/mnist
dist-mnist.cpp
mnist.cpp
8:35 (22%)
26:53 (21%)
view
14 x 2 reinforcement_learning
reinforcement_learning
actor_critic.py
reinforce.py
161:184 (16%)
91:107 (17%)
view
13 x 2 distributed/rpc/rl
reinforcement_learning
main.py
reinforce.py
56:70 (9%)
31:45 (16%)
view
10 x 2 imagenet
imagenet
main.py
main.py
285:298 (3%)
329:342 (3%)
view
9 x 2 reinforcement_learning
reinforcement_learning
actor_critic.py
reinforce.py
16:24 (10%)
14:22 (11%)
view
8 x 2 mnist
mnist_hogwild
main.py
main.py
112:119 (7%)
59:66 (11%)
view
8 x 2 distributed/ddp
distributed/ddp
example.py
main.py
14:22 (14%)
24:32 (8%)
view
7 x 2 dcgan
dcgan
main.py
main.py
62:68 (3%)
72:78 (3%)
view
6 x 2 cpp/custom-dataset
cpp/custom-dataset
custom-dataset.cpp
custom-dataset.cpp
139:145 (3%)
172:178 (3%)
view
6 x 2 word_language_model
word_language_model
generate.py
main.py
33:41 (11%)
54:62 (3%)
view
6 x 2 distributed/rpc/parameter_server
mnist
rpc_parameter_server.py
main.py
51:56 (3%)
29:34 (5%)
view
6 x 2 distributed/rpc/batch
distributed/rpc/ddp_rpc
parameter_server.py
main.py
127:133 (5%)
160:167 (6%)
view
6 x 2 cpp/transfer-learning
cpp/transfer-learning
classify.cpp
main.cpp
19:24 (15%)
100:105 (5%)
view
6 x 2 dcgan
dcgan
main.py
main.py
148:154 (2%)
188:194 (2%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
9 x 2 cpp/mnist
cpp/distributed
mnist.cpp
dist-mnist.cpp
37:46 
19:28 
view
6 x 2 distributed/rpc/rl
reinforcement_learning
main.py
reinforce.py
0:0 
0:0 
view