aws-samples / serverless-go-demo
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
  • 6% duplication:
    • 593 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 40 duplicated lines
  • 7 duplicates
system6% (40 lines)
Duplication per Extension
go9% (40 lines)
Duplication per Component (primary)
store12% (12 lines)
functions/get-product87% (7 lines)
functions/put-product87% (7 lines)
functions/delete-product87% (7 lines)
functions/get-products87% (7 lines)
tools0% (0 lines)
ROOT0% (0 lines)
domain0% (0 lines)
functions/products-stream0% (0 lines)
load-testing0% (0 lines)
types0% (0 lines)
types/mocks0% (0 lines)
handlers0% (0 lines)
bus0% (0 lines)
Longest Duplicates
The list of 7 longest duplicates.
See data for all 7 duplicates...
Size#FoldersFilesLinesCode
7 x 2 functions/delete-product
functions/put-product
main.go
main.go
14:22 (87%)
14:22 (87%)
view
7 x 2 functions/get-product
functions/put-product
main.go
main.go
14:22 (87%)
14:22 (87%)
view
7 x 2 functions/get-product
functions/get-products
main.go
main.go
14:22 (87%)
14:22 (87%)
view
7 x 2 functions/delete-product
functions/get-products
main.go
main.go
14:22 (87%)
14:22 (87%)
view
7 x 2 functions/delete-product
functions/get-product
main.go
main.go
14:22 (87%)
14:22 (87%)
view
7 x 2 functions/get-products
functions/put-product
main.go
main.go
14:22 (87%)
14:22 (87%)
view
6 x 2 store
store
dynamodb.go
dynamodb.go
77:83 (8%)
121:127 (8%)
view