aws-samples / moving-up-stack-workshop
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
  • 31% duplication:
    • 6,846 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,135 duplicated lines
  • 196 duplicates
system31% (2,135 lines)
Duplication per Extension
css26% (722 lines)
yaml34% (558 lines)
py69% (410 lines)
html26% (212 lines)
yml37% (191 lines)
vue22% (42 lines)
Duplication per Component (primary)
resources/code/scenario2/loadbalanced-fargate-redis-mysql37% (546 lines)
hugo/themes/learn/static22% (542 lines)
resources/code/scenario0/api59% (147 lines)
hugo/themes/learn/layouts20% (123 lines)
resources/code/scenario085% (102 lines)
hugo/static/css39% (96 lines)
hugo/layouts/partials81% (89 lines)
resources/code/scenario1/api-users86% (89 lines)
resources/code/scenario1/templates25% (89 lines)
resources/code/scenario1/api-posts86% (88 lines)
resources/code/scenario1/api-threads84% (86 lines)
hugo/themes/learn/exampleSite33% (84 lines)
resources/code/scenario0/webapp21% (42 lines)
resources/code/scenario3/environment_template9% (6 lines)
resources/code/scenario3/service_template9% (6 lines)
hugo0% (0 lines)
hugo/themes/learn0% (0 lines)
hugo/themes/learn/i18n0% (0 lines)
resources/code/scenario30% (0 lines)

Duplication Between Components (50+ lines)

G hugo/themes/learn/exampleSite hugo/themes/learn/exampleSite hugo/themes/learn/static hugo/themes/learn/static hugo/themes/learn/exampleSite--hugo/themes/learn/static 304 hugo/static/css hugo/static/css hugo/static/css--hugo/themes/learn/exampleSite 107 hugo/static/css--hugo/themes/learn/static 299 hugo/layouts/partials hugo/layouts/partials hugo/themes/learn/layouts hugo/themes/learn/layouts hugo/layouts/partials--hugo/themes/learn/layouts 184 resources/code/scenario0/api resources/code/scenario0/api resources/code/scenario1/api-threads resources/code/scenario1/api-threads resources/code/scenario0/api--resources/code/scenario1/api-threads 180 resources/code/scenario1/api-users resources/code/scenario1/api-users resources/code/scenario0/api--resources/code/scenario1/api-users 176 resources/code/scenario1/api-posts resources/code/scenario1/api-posts resources/code/scenario0/api--resources/code/scenario1/api-posts 174 resources/code/scenario1/api-threads--resources/code/scenario1/api-users 140 resources/code/scenario1/api-posts--resources/code/scenario1/api-threads 140 resources/code/scenario1/api-posts--resources/code/scenario1/api-users 140

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 196 duplicates...
Size#FoldersFilesLinesCode
82 x 2 hugo/themes/learn/static/css
hugo/themes/learn/static/css
theme-green.css
theme-red.css
30:128 (79%)
30:128 (79%)
view
82 x 2 hugo/themes/learn/static/css
hugo/themes/learn/static/css
theme-blue.css
theme-red.css
30:128 (79%)
30:128 (79%)
view
82 x 2 hugo/themes/learn/static/css
hugo/themes/learn/static/css
theme-blue.css
theme-green.css
30:128 (79%)
30:128 (79%)
view
80 x 2 hugo/layouts/partials
hugo/themes/learn/layouts/partials
header.html
header.html
1:94 (85%)
1:94 (83%)
view
78 x 2 hugo/themes/learn/exampleSite/static/css
hugo/themes/learn/static/css
theme-mine.css
theme-green.css
10:103 (92%)
13:106 (75%)
view
65 x 2 hugo/themes/learn/exampleSite/static/css
hugo/themes/learn/static/css
theme-mine.css
theme-red.css
27:103 (77%)
30:106 (63%)
view
65 x 2 hugo/themes/learn/exampleSite/static/css
hugo/themes/learn/static/css
theme-mine.css
theme-blue.css
27:103 (77%)
30:106 (63%)
view
34 x 2 hugo/static/css
hugo/themes/learn/static/css
theme-aws.css
hugo-theme.css
225:263 (14%)
70:108 (16%)
view
33 x 2 resources/code/scenario1/api-posts
resources/code/scenario1/api-threads
app.py
app.py
10:52 (35%)
10:52 (35%)
view
33 x 2 resources/code/scenario1/api-posts
resources/code/scenario1/api-users
app.py
app.py
10:52 (35%)
11:53 (35%)
view
33 x 2 resources/code/scenario1/api-threads
resources/code/scenario1/api-users
app.py
app.py
10:52 (35%)
11:53 (35%)
view
29 x 2 resources/code/scenario2...pipeline_infrastructure
resources/code/scenario2...pipeline_infrastructure
cloudformation.yaml
cloudformation.yaml
228:256 (4%)
510:538 (4%)
view
24 x 2 resources/code/scenario0
resources/code/scenario0
docker-compose-data-layer.yml
docker-compose1.yml
3:27 (92%)
34:58 (42%)
view
24 x 2 hugo/static/css
hugo/themes/learn/static/css
theme-aws.css
theme-green.css
106:130 (9%)
59:83 (23%)
view
24 x 2 hugo/static/css
hugo/themes/learn/exampleSite/static/css
theme-aws.css
theme-mine.css
106:130 (9%)
56:80 (28%)
view
24 x 2 hugo/static/css
hugo/themes/learn/static/css
theme-aws.css
theme-blue.css
106:130 (9%)
59:83 (23%)
view
24 x 2 hugo/static/css
hugo/themes/learn/static/css
theme-aws.css
theme-red.css
106:130 (9%)
59:83 (23%)
view
19 x 2 resources/code/scenario0/api
resources/code/scenario1/api-threads
app.py
app.py
106:137 (11%)
51:82 (20%)
view
18 x 2 resources/code/scenario0/api
resources/code/scenario1/api-threads
app.py
app.py
10:34 (10%)
10:34 (19%)
view
18 x 2 resources/code/scenario0/api
resources/code/scenario1/api-users
app.py
app.py
10:34 (10%)
11:35 (19%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
10 x 4 resources/code/scenario0/api
resources/code/scenario1/api-users
resources/code/scenario1/api-posts
resources/code/scenario1/api-threads
app.py
app.py
app.py
app.py
0:0 
0:0 
0:0 
0:0 
view
8 x 3 resources/code/scenario1/api-users
resources/code/scenario1/api-posts
resources/code/scenario1/api-threads
app.py
app.py
app.py
0:0 
0:0 
0:0 
view