aws-samples / aws-photosharing-example
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
  • 7% duplication:
    • 3,610 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 268 duplicated lines
  • 45 duplicates
system7% (268 lines)
Duplication per Extension
xhtml26% (169 lines)
java3% (87 lines)
css3% (12 lines)
Duplication per Component (primary)
src/main3% (87 lines)
WebContent/me25% (67 lines)
WebContent/resources23% (54 lines)
WebContent/share53% (30 lines)
WebContent/auth31% (18 lines)
WebContent/styles3% (12 lines)
WebContent/errorpages0% (0 lines)
WebContent0% (0 lines)
WebContent/template0% (0 lines)
WebContent/scripts0% (0 lines)

Duplication Between Components (50+ lines)

G WebContent/me WebContent/me WebContent/share WebContent/share WebContent/me--WebContent/share 65

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 45 duplicates...
Size#FoldersFilesLinesCode
11 x 2 WebContent/share
WebContent/share
album.xhtml
media.xhtml
1:12 (33%)
1:12 (47%)
view
11 x 2 WebContent/resources/components/album
WebContent/resources/components/media
menu.xhtml
menu.xhtml
1:13 (35%)
1:13 (36%)
view
10 x 2 WebContent/me
WebContent/share
media.xhtml
album.xhtml
1:11 (10%)
1:11 (30%)
view
10 x 2 WebContent/me
WebContent/share
media.xhtml
media.xhtml
1:11 (10%)
1:11 (43%)
view
10 x 2 WebContent/me
WebContent/share
album.xhtml
media.xhtml
1:11 (10%)
1:11 (43%)
view
10 x 2 WebContent/me
WebContent/share
album.xhtml
album.xhtml
1:11 (10%)
1:11 (30%)
view
10 x 2 WebContent/me
WebContent/me
album.xhtml
media.xhtml
1:11 (10%)
1:11 (10%)
view
9 x 2 WebContent/me
WebContent/me
index.xhtml
media.xhtml
1:9 (11%)
1:9 (9%)
view
9 x 2 WebContent/auth
WebContent/auth
loggedout.xhtml
login.xhtml
1:15 (81%)
1:15 (19%)
view
9 x 2 WebContent/me
WebContent/me
album.xhtml
media.xhtml
110:121 (9%)
116:127 (9%)
view
9 x 2 WebContent/me
WebContent/me
album.xhtml
index.xhtml
1:9 (9%)
1:9 (11%)
view
9 x 2 WebContent/me
WebContent/share
index.xhtml
album.xhtml
1:9 (11%)
1:9 (27%)
view
9 x 2 WebContent/me
WebContent/share
index.xhtml
media.xhtml
1:9 (11%)
1:9 (39%)
view
8 x 2 WebContent/resources/components/media
WebContent/resources/components/media
card.xhtml
menu.xhtml
1:10 (15%)
1:10 (26%)
view
8 x 2 WebContent/me
WebContent/share
media.xhtml
media.xhtml
16:25 (8%)
17:26 (34%)
view
8 x 2 WebContent/resources/components/controller
WebContent/resources/components/media
controller.xhtml
card.xhtml
1:10 (22%)
1:10 (15%)
view
8 x 2 WebContent/resources/components/media
WebContent/resources/components/user
menu.xhtml
card.xhtml
1:10 (26%)
1:10 (47%)
view
8 x 2 WebContent/resources/components/album
WebContent/resources/components/media
menu.xhtml
card.xhtml
1:10 (25%)
1:10 (15%)
view
8 x 2 WebContent/resources/components/controller
WebContent/resources/components/user
controller.xhtml
card.xhtml
1:10 (22%)
1:10 (47%)
view
8 x 2 WebContent/resources/components/media
WebContent/resources/components/user
card.xhtml
card.xhtml
1:10 (15%)
1:10 (47%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
9 x 2 src/main/java/com/amazon/photosharing/rest
src/main/java/com/amazon/photosharing/rest
ShareService.java
ShareService.java
267:279 
285:297 
view