aws-samples / serverless-trivia-game
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
  • 18% duplication:
    • 10,853 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,010 duplicated lines
  • 552 duplicates
system18% (2,010 lines)
Duplication per Extension
vue23% (934 lines)
yaml20% (716 lines)
js10% (360 lines)
Duplication per Component (primary)
frontend/src/components28% (910 lines)
backend20% (716 lines)
backend/Functions/IoT24% (146 lines)
backend/Functions/HTTP12% (107 lines)
backend/Functions/WebSockets12% (61 lines)
frontend/src2% (24 lines)
backend/utilslayer11% (14 lines)
backend/sendchatlayer11% (12 lines)
frontend/src/services3% (12 lines)
backend/Functions/Main2% (8 lines)
frontend0% (0 lines)
frontend/src/store0% (0 lines)
frontend/src/plugins0% (0 lines)
frontend/public0% (0 lines)

Duplication Between Components (50+ lines)

G frontend/src frontend/src frontend/src/components frontend/src/components frontend/src--frontend/src/components 378

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 552 duplicates...
Size#FoldersFilesLinesCode
27 x 2 frontend/src/components
frontend/src/components
BlitzGamePlayer.vue
LiveGamePlayerController.vue
28:71 (17%)
48:91 (11%)
view
25 x 2 frontend/src/components
frontend/src/components
QuizEdit.vue
Quizdetail.vue
175:199 (11%)
123:147 (17%)
view
25 x 2 frontend/src/components
frontend/src/components
BlitzGamePlayer.vue
LiveGamePlayerController.vue
171:196 (16%)
260:285 (11%)
view
21 x 2 frontend/src/components
frontend/src/components
Hostgame.vue
QuizList.vue
21:44 (16%)
21:43 (16%)
view
20 x 2 frontend/src/components
frontend/src/components
QuizEdit.vue
Quizdetail.vue
64:93 (9%)
34:63 (13%)
view
19 x 2 backend
backend
httptemplate.yaml
httptemplate.yaml
602:620 (1%)
647:665 (1%)
view
19 x 2 frontend/src/components
frontend/src/components
Quizdetail.vue
Quizheader.vue
1:20 (13%)
1:20 (24%)
view
19 x 2 frontend/src/components
frontend/src/components
Player.vue
Quizdetail.vue
1:20 (9%)
1:20 (13%)
view
19 x 2 frontend/src/components
frontend/src/components
Player.vue
Quizheader.vue
1:20 (9%)
1:20 (24%)
view
18 x 2 frontend/src/components
frontend/src/components
BlitzGamePlayer.vue
LiveGameAdminController.vue
1:19 (11%)
1:19 (3%)
view
17 x 2 frontend/src/components
frontend/src/components
CognitoUI.vue
Question.vue
1:18 (13%)
1:18 (10%)
view
17 x 2 frontend/src/components
frontend/src/components
Question.vue
Signout.vue
1:18 (10%)
1:18 (62%)
view
17 x 2 frontend/src/components
frontend/src/components
CognitoUI.vue
Signout.vue
1:18 (13%)
1:18 (62%)
view
17 x 2 backend
backend
analytics.yaml
template.yaml
18:34 (3%)
36:52 (2%)
view
16 x 2 backend/Functions/WebSockets/auth
backend/Functions/WebSockets/auth
app.js
app.js
49:67 (9%)
88:106 (9%)
view
16 x 2 frontend/src/components
frontend/src/components
AdminController.vue
Managequiz.vue
1:17 (29%)
1:17 (11%)
view
16 x 2 frontend/src/components
frontend/src/components
Hostgame.vue
LiveGamePlayerController.vue
1:17 (12%)
1:17 (7%)
view
16 x 2 frontend/src/components
frontend/src/components
AdminController.vue
BlitzGamePlayer.vue
1:17 (29%)
1:17 (10%)
view
16 x 2 frontend/src/components
frontend/src/components
CognitoUI.vue
Managequiz.vue
1:17 (13%)
1:17 (11%)
view
16 x 2 frontend/src/components
frontend/src/components
Marketplace.vue
QuizList.vue
1:17 (14%)
1:17 (12%)
view
Duplicated Units
The list of top 5 duplicated units.
See data for all 5 unit duplicates...
Size#FoldersFilesLinesCode
14 x 2 backend/Functions/HTTP/game_activate
backend/Functions/HTTP/activegames_delete
app.js
app.js
44:58 
47:61 
view
10 x 2 frontend/src/services
frontend/src/services
DataServices.js
DataServices.js
138:148 
160:170 
view
9 x 4 backend/Functions/HTTP/purchasedgame_putkinesis
backend/Functions/HTTP/game_answer
backend/Functions/WebSockets/livegameadmin
backend/Functions/IoT/answer_receive
app.js
app.js
app.js
app.js
29:39 
35:45 
45:55 
42:52 
view
8 x 2 backend/Functions/IoT/answer_receive
backend/Functions/IoT/game_cache
app.js
app.js
178:186 
137:145 
view
8 x 2 backend/Functions/IoT/game_start
backend/Functions/Main/chat_send
app.js
app.js
39:47 
28:36 
view