aws-samples / aws-alien-attack
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
  • 14% duplication:
    • 7,490 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,063 duplicated lines
  • 85 duplicates
system14% (1,063 lines)
Duplication per Extension
js10% (507 lines)
ts24% (438 lines)
css29% (100 lines)
html3% (18 lines)
Duplication per Component (primary)
infrastructure/cdk/lib24% (438 lines)
infrastructure/cdk/lambdas36% (408 lines)
application/resources/css23% (58 lines)
application/scoreboard/css64% (42 lines)
application/game/js4% (32 lines)
application/scoreboard/js5% (26 lines)
application/resources/js6% (25 lines)
application/scoreboard6% (18 lines)
application/resources/libs<1% (16 lines)
infrastructure/cicd0% (0 lines)
application0% (0 lines)
application/game/css0% (0 lines)
application/game0% (0 lines)
application/pages0% (0 lines)

Duplication Between Components (50+ lines)

G application/resources/css application/resources/css application/scoreboard/css application/scoreboard/css application/resources/css--application/scoreboard/css 84

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 85 duplicates...
Size#FoldersFilesLinesCode
42 x 2 application/resources/css
application/scoreboard/css
typeography.css
typeography.css
1:50 (100%)
1:50 (100%)
view
34 x 2 infrastructure/cdk/lambdas/allocateGamer
infrastructure/cdk/lambdas/websocketConnect
index.js
index.js
7:44 (16%)
8:45 (34%)
view
32 x 2 infrastructure/cdk/lambdas/websocketConnect
infrastructure/cdk/lambdas/websocketDisconnect
index.js
index.js
8:41 (32%)
8:41 (30%)
view
32 x 2 infrastructure/cdk/lambdas/allocateGamer
infrastructure/cdk/lambdas/websocketDisconnect
index.js
index.js
7:40 (15%)
8:41 (30%)
view
30 x 2 infrastructure/cdk/lambdas/synchronousStart
infrastructure/cdk/lambdas/websocketDisconnect
index.js
index.js
15:47 (17%)
14:46 (28%)
view
28 x 2 infrastructure/cdk/lambdas/allocateGamer
infrastructure/cdk/lambdas/synchronousStart
index.js
index.js
13:40 (13%)
15:42 (16%)
view
28 x 2 infrastructure/cdk/lambdas/synchronousStart
infrastructure/cdk/lambdas/websocketConnect
index.js
index.js
15:42 (16%)
14:41 (28%)
view
24 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
589:620 (3%)
984:1015 (3%)
view
24 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
589:620 (3%)
878:909 (3%)
view
24 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
744:775 (3%)
984:1015 (3%)
view
24 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
589:620 (3%)
744:775 (3%)
view
24 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
878:909 (3%)
984:1015 (3%)
view
24 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
744:775 (3%)
878:909 (3%)
view
22 x 2 infrastructure/cdk/lambdas/allocateGamer
infrastructure/cdk/lambdas/deallocateGamer
index.js
index.js
219:243 (10%)
170:194 (13%)
view
21 x 2 infrastructure/cdk/lambdas/websocketConnect
infrastructure/cdk/lambdas/websocketDisconnect
index.js
index.js
71:94 (21%)
81:104 (20%)
view
20 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
676:703 (2%)
988:1015 (2%)
view
20 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
676:703 (2%)
882:909 (2%)
view
20 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
593:620 (2%)
676:703 (2%)
view
20 x 2 infrastructure/cdk/lib/layer
infrastructure/cdk/lib/layer
ingestionConsumptionLayer.ts
ingestionConsumptionLayer.ts
676:703 (2%)
748:775 (2%)
view
19 x 2 infrastructure/cdk/lib
infrastructure/cdk/lib
resourceawarestack.ts
resourceawarestack.ts
44:71 (13%)
197:224 (13%)
view
Duplicated Units
The list of top 6 duplicated units.
See data for all 6 unit duplicates...
Size#FoldersFilesLinesCode
25 x 2 infrastructure/cdk/lambdas/allocateGamer
infrastructure/cdk/lambdas/websocketConnect
index.js
index.js
18:43 
19:44 
view
25 x 2 infrastructure/cdk/lambdas/synchronousStart
infrastructure/cdk/lambdas/websocketDisconnect
index.js
index.js
20:45 
19:44 
view
8 x 2 infrastructure/cdk/lib
infrastructure/cdk/lib
resourceawarestack.ts
resourceawarestack.ts
48:56 
154:162 
view
7 x 2 infrastructure/cdk/lambdas/scoreboard
application/resources/js
index.js
gameutils.js
10:17 
7:14 
view
32 x 2 infrastructure/cdk/lambdas/synchronousStart
infrastructure/cdk/lambdas/websocketDisconnect
index.js
index.js
15:47 
14:46 
view
31 x 2 infrastructure/cdk/lambdas/allocateGamer
infrastructure/cdk/lambdas/websocketConnect
index.js
index.js
13:44 
14:45 
view