aws-samples / amazon-ec2-image-builder-samples
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
  • 50% duplication:
    • 2,062 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,042 duplicated lines
  • 138 duplicates
system50% (1,042 lines)
Duplication per Extension
yml54% (1,010 lines)
yaml23% (32 lines)
Duplication per Component (primary)
CloudFormation/Windows/cascading-images-with-dotnet-web-application65% (435 lines)
CloudFormation/Docker/ubuntu-dotnet-web-application41% (96 lines)
Components/Linux/ansible-playbook-execution-amazon-linux-277% (82 lines)
CloudFormation/Docker/amazon-linux-2-with-helloworld48% (80 lines)
CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent62% (60 lines)
CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent63% (60 lines)
CloudFormation/Windows/windows-server-with-latest-ssm-agent51% (53 lines)
CloudFormation/Windows/windows-server-2016-with-vscode38% (52 lines)
CloudFormation/Linux/ubuntu-with-net643% (48 lines)
Components/Linux/chef-recipe-execution-linux36% (22 lines)
Components/Windows/chef-recipe-execution-windows40% (22 lines)
Components/Windows/configure-wsus-server25% (19 lines)
Components/Windows/create-local-user20% (13 lines)
lambda/latest_image_tracker0% (0 lines)

Duplication Between Components (50+ lines)

G CloudFormation/Docker/ubuntu-dotnet-web-application CloudFormation/Docker/ubuntu-dotnet-web-application CloudFormation/Windows/cascading-images-with-dotnet-web-application CloudFormation/Windows/cascading-images-with-dotnet-web-application CloudFormation/Docker/ubuntu-dotnet-web-application--CloudFormation/Windows/cascading-images-with-dotnet-web-application 203 CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent CloudFormation/Docker/ubuntu-dotnet-web-application--CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent 62 CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent CloudFormation/Docker/ubuntu-dotnet-web-application--CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent 62 CloudFormation/Windows/windows-server-with-latest-ssm-agent CloudFormation/Windows/windows-server-with-latest-ssm-agent CloudFormation/Docker/ubuntu-dotnet-web-application--CloudFormation/Windows/windows-server-with-latest-ssm-agent 62 CloudFormation/Windows/cascading-images-with-dotnet-web-application--CloudFormation/Windows/windows-server-with-latest-ssm-agent 111 CloudFormation/Windows/windows-server-2016-with-vscode CloudFormation/Windows/windows-server-2016-with-vscode CloudFormation/Windows/cascading-images-with-dotnet-web-application--CloudFormation/Windows/windows-server-2016-with-vscode 90 CloudFormation/Docker/amazon-linux-2-with-helloworld CloudFormation/Docker/amazon-linux-2-with-helloworld CloudFormation/Docker/amazon-linux-2-with-helloworld--CloudFormation/Docker/ubuntu-dotnet-web-application 138 CloudFormation/Docker/amazon-linux-2-with-helloworld--CloudFormation/Windows/cascading-images-with-dotnet-web-application 126 CloudFormation/Docker/amazon-linux-2-with-helloworld--CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent 66 CloudFormation/Docker/amazon-linux-2-with-helloworld--CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent 66 CloudFormation/Docker/amazon-linux-2-with-helloworld--CloudFormation/Windows/windows-server-with-latest-ssm-agent 66 CloudFormation/Docker/amazon-linux-2-with-helloworld--CloudFormation/Windows/windows-server-2016-with-vscode 68 CloudFormation/Linux/ubuntu-with-net6 CloudFormation/Linux/ubuntu-with-net6 CloudFormation/Docker/amazon-linux-2-with-helloworld--CloudFormation/Linux/ubuntu-with-net6 70 CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent--CloudFormation/Windows/cascading-images-with-dotnet-web-application 111 CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent--CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent 120 CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent--CloudFormation/Windows/windows-server-with-latest-ssm-agent 106 CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent--CloudFormation/Windows/windows-server-2016-with-vscode 102 CloudFormation/Linux/amazon-linux-2-with-latest-ssm-agent--CloudFormation/Linux/ubuntu-with-net6 88 CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent--CloudFormation/Windows/cascading-images-with-dotnet-web-application 111 CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent--CloudFormation/Windows/windows-server-with-latest-ssm-agent 106 CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent--CloudFormation/Windows/windows-server-2016-with-vscode 102 CloudFormation/Linux/ubuntu-2004-with-latest-ssm-agent--CloudFormation/Linux/ubuntu-with-net6 88 CloudFormation/Windows/windows-server-2016-with-vscode--CloudFormation/Windows/windows-server-with-latest-ssm-agent 102 CloudFormation/Linux/ubuntu-with-net6--CloudFormation/Windows/cascading-images-with-dotnet-web-application 96 CloudFormation/Linux/ubuntu-with-net6--CloudFormation/Windows/windows-server-with-latest-ssm-agent 88 CloudFormation/Linux/ubuntu-with-net6--CloudFormation/Windows/windows-server-2016-with-vscode 90

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 138 duplicates...
Size#FoldersFilesLinesCode
62 x 2 CloudFormation/Windows/c...-dotnet-web-application
CloudFormation/Windows/c...-dotnet-web-application
windows-baseline-stack.yml
windows-dotnet-application-stack.yml
177:244 (29%)
437:504 (13%)
view
47 x 2 CloudFormation/Linux/ama...2-with-latest-ssm-agent
CloudFormation/Windows/w...r-with-latest-ssm-agent
amazon-linux-2-with-latest-ssm-agent.yml
windows-server-with-latest-ssm-agent.yml
3:68 (50%)
3:68 (45%)
view
47 x 2 CloudFormation/Windows/c...-dotnet-web-application
CloudFormation/Windows/c...-dotnet-web-application
windows-baseline-stack.yml
windows-dotnet-application-stack.yml
55:116 (22%)
81:142 (10%)
view
47 x 2 CloudFormation/Linux/ama...2-with-latest-ssm-agent
CloudFormation/Linux/ubu...4-with-latest-ssm-agent
amazon-linux-2-with-latest-ssm-agent.yml
ubuntu-2004-with-latest-ssm-agent.yml
3:68 (50%)
3:68 (48%)
view
47 x 2 CloudFormation/Linux/ubu...4-with-latest-ssm-agent
CloudFormation/Windows/w...r-with-latest-ssm-agent
ubuntu-2004-with-latest-ssm-agent.yml
windows-server-with-latest-ssm-agent.yml
3:68 (48%)
3:68 (45%)
view
41 x 2 Components/Linux/ansible...xecution-amazon-linux-2
Components/Linux/ansible...xecution-amazon-linux-2
cloudformation.yml
component.yml
13:53 (80%)
3:43 (100%)
view
37 x 2 CloudFormation/Docker/ub...-dotnet-web-application
CloudFormation/Windows/c...-dotnet-web-application
ubuntu-dotnet-web-application-pipelin...
windows-dotnet-application-stack.yml
99:145 (15%)
80:126 (8%)
view
36 x 2 CloudFormation/Docker/ub...-dotnet-web-application
CloudFormation/Windows/c...-dotnet-web-application
ubuntu-dotnet-web-application-pipelin...
windows-baseline-stack.yml
100:145 (15%)
55:100 (17%)
view
35 x 2 CloudFormation/Docker/am...linux-2-with-helloworld
CloudFormation/Linux/ubuntu-with-net6
amazon-linux-2-container-image.yml
ubuntuserver20-with-.net6.yml
68:109 (21%)
44:85 (31%)
view
30 x 2 CloudFormation/Linux/ubuntu-with-net6
CloudFormation/Windows/w...server-2016-with-vscode
ubuntuserver20-with-.net6.yml
windows-server-2016-with-vscode.yml
22:65 (27%)
5:48 (22%)
view
25 x 2 CloudFormation/Linux/ubu...4-with-latest-ssm-agent
CloudFormation/Windows/c...-dotnet-web-application
ubuntu-2004-with-latest-ssm-agent.yml
windows-dotnet-application-stack.yml
27:54 (26%)
81:108 (5%)
view
25 x 2 CloudFormation/Windows/c...-dotnet-web-application
CloudFormation/Windows/c...-dotnet-web-application
windows-baseline-stack.yml
windows-dotnet-application-stack.yml
132:158 (11%)
392:418 (5%)
view
25 x 2 CloudFormation/Docker/ub...-dotnet-web-application
CloudFormation/Linux/ubu...4-with-latest-ssm-agent
ubuntu-dotnet-web-application-pipelin...
ubuntu-2004-with-latest-ssm-agent.yml
100:127 (10%)
27:54 (26%)
view
25 x 2 CloudFormation/Linux/ama...2-with-latest-ssm-agent
CloudFormation/Windows/c...-dotnet-web-application
amazon-linux-2-with-latest-ssm-agent.yml
windows-dotnet-application-stack.yml
27:54 (26%)
81:108 (5%)
view
25 x 2 CloudFormation/Linux/ama...2-with-latest-ssm-agent
CloudFormation/Windows/c...-dotnet-web-application
amazon-linux-2-with-latest-ssm-agent.yml
windows-baseline-stack.yml
27:54 (26%)
55:82 (11%)
view
25 x 2 CloudFormation/Docker/ub...-dotnet-web-application
CloudFormation/Windows/w...r-with-latest-ssm-agent
ubuntu-dotnet-web-application-pipelin...
windows-server-with-latest-ssm-agent.yml
100:127 (10%)
27:54 (24%)
view
25 x 2 CloudFormation/Windows/c...-dotnet-web-application
CloudFormation/Windows/w...r-with-latest-ssm-agent
windows-dotnet-application-stack.yml
windows-server-with-latest-ssm-agent.yml
81:108 (5%)
27:54 (24%)
view
25 x 2 CloudFormation/Docker/ub...-dotnet-web-application
CloudFormation/Linux/ama...2-with-latest-ssm-agent
ubuntu-dotnet-web-application-pipelin...
amazon-linux-2-with-latest-ssm-agent.yml
100:127 (10%)
27:54 (26%)
view
25 x 2 CloudFormation/Linux/ubu...4-with-latest-ssm-agent
CloudFormation/Windows/c...-dotnet-web-application
ubuntu-2004-with-latest-ssm-agent.yml
windows-baseline-stack.yml
27:54 (26%)
55:82 (11%)
view
25 x 2 CloudFormation/Windows/c...-dotnet-web-application
CloudFormation/Windows/w...r-with-latest-ssm-agent
windows-baseline-stack.yml
windows-server-with-latest-ssm-agent.yml
55:82 (11%)
27:54 (24%)
view