aws-samples / sessions-with-aws-sam
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
  • 28% duplication:
    • 5,921 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,668 duplicated lines
  • 192 duplicates
system28% (1,668 lines)
Duplication per Extension
yaml36% (1,322 lines)
js15% (245 lines)
vue23% (82 lines)
ts10% (19 lines)
Duplication per Component (primary)
s12d22% (511 lines)
governance58% (249 lines)
custom-domains79% (242 lines)
http-api-direct-integration58% (84 lines)
sam-or-cdk19% (82 lines)
http-api-integrations-blog-example83% (64 lines)
multi-level-mapping27% (62 lines)
eventbridge-dlq-retry52% (60 lines)
http-api50% (58 lines)
sam-containers-demo-app57% (44 lines)
safe-deploy24% (40 lines)
node-webpack-custom-build76% (35 lines)
kinesis-firehose9% (24 lines)
cognito19% (23 lines)
lambda-layers19% (23 lines)
starter-templates18% (21 lines)
eventbridge15% (20 lines)
step-functions14% (14 lines)
api-enhanced-observability-variables6% (6 lines)
SQS9% (6 lines)
swift-custom-runtime0% (0 lines)
dotnet-api0% (0 lines)
go-al20% (0 lines)
http-api-logging0% (0 lines)
secrets0% (0 lines)
appconfig-lambda-extensions0% (0 lines)

Duplication Between Components (50+ lines)

G http-api-direct-integration http-api-direct-integration http-api-integrations-blog-example http-api-integrations-blog-example http-api-direct-integration--http-api-integrations-blog-example 128 eventbridge-dlq-retry eventbridge-dlq-retry eventbridge-dlq-retry--http-api-direct-integration 101 eventbridge-dlq-retry--http-api-integrations-blog-example 61 node-webpack-custom-build node-webpack-custom-build sam-containers-demo-app sam-containers-demo-app node-webpack-custom-build--sam-containers-demo-app 76 s12d s12d sam-or-cdk sam-or-cdk s12d--sam-or-cdk 57 kinesis-firehose kinesis-firehose kinesis-firehose--s12d 51

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 192 duplicates...
Size#FoldersFilesLinesCode
86 x 2 governance/4-reusable-setup
governance/5-reusable-setup-full
template.yaml
template.yaml
1:103 (100%)
1:103 (89%)
view
53 x 2 governance/1-initial-setup
governance/5-reusable-setup-full
template.yaml
template.yaml
15:71 (82%)
47:103 (55%)
view
53 x 2 governance/1-initial-setup
governance/4-reusable-setup
template.yaml
template.yaml
15:71 (82%)
47:103 (61%)
view
33 x 2 custom-domains/both-implied
custom-domains/http
template.yaml
template.yaml
9:45 (37%)
9:45 (61%)
view
32 x 2 custom-domains/both-declared
custom-domains/both-implied
template.yaml
template.yaml
1:36 (31%)
1:36 (36%)
view
32 x 2 custom-domains/both-implied
custom-domains/rest
template.yaml
template.yaml
1:36 (36%)
1:36 (52%)
view
32 x 2 custom-domains/both-declared
custom-domains/rest
template.yaml
template.yaml
1:36 (31%)
1:36 (52%)
view
29 x 2 http-api-direct-integration
http-api-integrations-blog-example
template.yaml
template.yaml
14:43 (33%)
9:38 (54%)
view
25 x 2 custom-domains/http
custom-domains/rest
template.yaml
template.yaml
9:36 (46%)
9:36 (40%)
view
25 x 2 custom-domains/both-declared
custom-domains/http
template.yaml
template.yaml
9:36 (24%)
9:36 (46%)
view
23 x 2 s12d/server
s12d/server
api.yaml
api.yaml
168:190 (5%)
311:333 (5%)
view
20 x 2 eventbridge-dlq-retry
http-api-direct-integration
template.yaml
template.yaml
12:32 (21%)
14:34 (23%)
view
20 x 2 custom-domains/both-implied
custom-domains/rest
template.yaml
template.yaml
77:96 (22%)
48:67 (32%)
view
20 x 2 custom-domains/both-declared
custom-domains/rest
template.yaml
template.yaml
84:103 (19%)
48:67 (32%)
view
20 x 2 eventbridge-dlq-retry
http-api-integrations-blog-example
template.yaml
template.yaml
12:32 (21%)
9:29 (37%)
view
20 x 2 custom-domains/both-declared
custom-domains/both-implied
template.yaml
template.yaml
84:103 (19%)
77:96 (22%)
view
17 x 2 s12d/server
s12d/server
api.yaml
api.yaml
197:215 (4%)
335:351 (4%)
view
16 x 2 http-api-integrations-blog-example
sam-or-cdk/sam
template.yaml
template.yaml
19:34 (30%)
164:179 (8%)
view
16 x 2 http-api-direct-integration
sam-or-cdk/sam
template.yaml
template.yaml
24:39 (18%)
164:179 (8%)
view
15 x 2 s12d/client
s12d/client
tailwind.config.js
tailwind.config.js
490:504 (1%)
506:520 (1%)
view