aws-samples / aws-reinvent-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
  • 22% duplication:
    • 3,252 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 733 duplicated lines
  • 53 duplicates
system22% (733 lines)
Duplication per Extension
ts28% (456 lines)
yml40% (119 lines)
js11% (88 lines)
yaml20% (70 lines)
Duplication per Component (primary)
trivia-backend/infra24% (306 lines)
pipelines/src47% (261 lines)
chat-bot36% (54 lines)
static-site/app6% (28 lines)
canaries9% (20 lines)
chat-bot/bot14% (18 lines)
static-site/cdk10% (14 lines)
chat-bot/hook33% (14 lines)
trivia-backend24% (12 lines)
chat-bot/lex-model7% (6 lines)
alarms0% (0 lines)
static-site0% (0 lines)
trivia-backend/app0% (0 lines)
trivia-backend/base0% (0 lines)

Duplication Between Components (50+ lines)

G chat-bot chat-bot trivia-backend/infra trivia-backend/infra chat-bot--trivia-backend/infra 56

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 53 duplicates...
Size#FoldersFilesLinesCode
29 x 2 trivia-backend/infra/cdk
trivia-backend/infra/cdk
buildspec-blue-green.yml
buildspec.yml
1:40 (82%)
1:40 (82%)
view
28 x 2 pipelines/src
pipelines/src
api-base-image-pipeline.ts
static-site-pipeline.ts
19:50 (68%)
15:46 (42%)
view
27 x 2 pipelines/src/common
pipelines/src
cfn-pipeline.ts
static-site-pipeline.ts
33:62 (28%)
17:46 (40%)
view
27 x 2 pipelines/src
pipelines/src/common
api-base-image-pipeline.ts
cfn-pipeline.ts
21:50 (65%)
33:62 (28%)
view
24 x 2 pipelines/src
pipelines/src/common
api-service-codedeploy-pipeline.ts
cfn-containers-pipeline.ts
39:65 (18%)
49:75 (16%)
view
24 x 2 pipelines/src
pipelines/src
api-service-codedeploy-pipeline.ts
static-site-pipeline.ts
21:48 (18%)
15:42 (36%)
view
24 x 2 pipelines/src
pipelines/src
api-base-image-pipeline.ts
api-service-codedeploy-pipeline.ts
19:46 (58%)
21:48 (18%)
view
23 x 2 pipelines/src
pipelines/src/common
api-service-codedeploy-pipeline.ts
cfn-pipeline.ts
23:48 (17%)
33:58 (23%)
view
18 x 2 pipelines/src
pipelines/src/common
api-service-codedeploy-pipeline.ts
cfn-containers-pipeline.ts
78:97 (13%)
103:122 (12%)
view
16 x 2 trivia-backend/infra/cdk
trivia-backend/infra/codedeploy-blue-green
ecs-service-blue-green.ts
infra-setup.ts
319:336 (5%)
124:141 (11%)
view
15 x 2 trivia-backend/infra/codedeploy-blue-green
trivia-backend/infra/codedeploy-blue-green
infra-setup.ts
infra-setup.ts
60:76 (11%)
80:96 (11%)
view
14 x 2 pipelines/src
pipelines/src/common
api-service-codedeploy-pipeline.ts
cfn-containers-pipeline.ts
21:37 (10%)
27:43 (9%)
view
14 x 2 pipelines/src
pipelines/src/common
api-base-image-pipeline.ts
cfn-containers-pipeline.ts
19:35 (34%)
27:43 (9%)
view
14 x 2 trivia-backend/infra/cdk
trivia-backend/infra/codedeploy-blue-green
buildspec-blue-green.yml
buildspec.yml
17:35 (40%)
15:33 (30%)
view
14 x 2 pipelines/src/common
pipelines/src
cfn-containers-pipeline.ts
static-site-pipeline.ts
27:43 (9%)
15:31 (21%)
view
14 x 2 trivia-backend/infra/cdk
trivia-backend/infra/cdk
ecs-service-blue-green.ts
ecs-service-blue-green.ts
81:95 (5%)
98:112 (5%)
view
14 x 2 trivia-backend/infra/cdk
trivia-backend/infra/codedeploy-blue-green
buildspec.yml
buildspec.yml
17:35 (40%)
15:33 (30%)
view
14 x 2 static-site/app/js
static-site/app/js
app.js
pageNotFound.js
14:32 (25%)
7:24 (40%)
view
13 x 2 pipelines/src/common
pipelines/src/common
cfn-containers-pipeline.ts
cfn-pipeline.ts
29:43 (9%)
33:47 (13%)
view
11 x 2 trivia-backend/infra/cdk
trivia-backend/infra/codedeploy-blue-green
buildspec.yml
buildspec.yml
1:14 (31%)
1:13 (23%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
7 x 2 static-site/app/js
static-site/app/js
app.js
pageNotFound.js
14:21 
7:14 
view