aws-samples / ml-gameday-tutorial
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
  • 33% duplication:
    • 737 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 248 duplicated lines
  • 27 duplicates
system33% (248 lines)
Duplication per Extension
py33% (248 lines)
Duplication per Component (primary)
Layout/2vs370% (60 lines)
Layout/random-278% (60 lines)
Shoot/line74% (53 lines)
Shoot/random89% (53 lines)
Shoot/CNN4% (22 lines)

Duplication Between Components (50+ lines)

G Layout/2vs3 Layout/2vs3 Layout/random-2 Layout/random-2 Layout/2vs3--Layout/random-2 120 Shoot/line Shoot/line Layout/2vs3--Shoot/line 74 Shoot/random Shoot/random Layout/2vs3--Shoot/random 74 Layout/random-2--Shoot/line 74 Layout/random-2--Shoot/random 74 Shoot/line--Shoot/random 106

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 27 duplicates...
Size#FoldersFilesLinesCode
22 x 2 containers/Layout/random-2
containers/Shoot/random
train.py
train.py
10:33 (100%)
10:33 (100%)
view
22 x 2 containers/Layout/2vs3
containers/Shoot/random
train.py
train.py
10:33 (100%)
10:33 (100%)
view
22 x 2 containers/Shoot/line
containers/Shoot/random
train.py
train.py
10:33 (100%)
10:33 (100%)
view
22 x 2 containers/Layout/2vs3
containers/Layout/random-2
train.py
train.py
10:33 (100%)
10:33 (100%)
view
22 x 2 containers/Layout/random-2
containers/Shoot/line
train.py
train.py
10:33 (100%)
10:33 (100%)
view
22 x 2 containers/Layout/2vs3
containers/Shoot/line
train.py
train.py
10:33 (100%)
10:33 (100%)
view
14 x 2 containers/Layout/2vs3
containers/Layout/random-2
test.py
test.py
5:23 (70%)
5:23 (70%)
view
14 x 2 containers/Shoot/line
containers/Shoot/random
test.py
test.py
5:24 (66%)
5:24 (82%)
view
12 x 2 containers/Layout/2vs3
containers/Shoot/CNN
train.py
train.py
22:33 (54%)
236:247 (6%)
view
12 x 2 containers/Layout/random-2
containers/Shoot/CNN
train.py
train.py
22:33 (54%)
236:247 (6%)
view
12 x 2 containers/Shoot/CNN
containers/Shoot/random
train.py
train.py
236:247 (6%)
22:33 (54%)
view
12 x 2 containers/Shoot/CNN
containers/Shoot/line
train.py
train.py
236:247 (6%)
22:33 (54%)
view
10 x 2 containers/Shoot/line
containers/Shoot/random
host.py
host.py
27:36 (35%)
20:29 (50%)
view
10 x 2 containers/Shoot/CNN
containers/Shoot/line
host.py
host.py
74:83 (15%)
27:36 (35%)
view
10 x 2 containers/Shoot/CNN
containers/Shoot/random
host.py
host.py
74:83 (15%)
20:29 (50%)
view
9 x 2 containers/Layout/2vs3
containers/Shoot/random
test.py
test.py
5:18 (45%)
5:18 (52%)
view
9 x 2 containers/Layout/2vs3
containers/Layout/random-2
host.py
host.py
7:18 (20%)
6:17 (26%)
view
9 x 2 containers/Layout/2vs3
containers/Shoot/line
test.py
test.py
5:18 (45%)
5:18 (42%)
view
9 x 2 containers/Layout/random-2
containers/Shoot/line
test.py
test.py
5:18 (45%)
5:18 (42%)
view
9 x 2 containers/Layout/random-2
containers/Shoot/random
test.py
test.py
5:18 (45%)
5:18 (52%)
view