aws-samples / designing-cloud-native-microservices-on-aws
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
  • 7% duplication:
    • 1,558 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 116 duplicated lines
  • 5 duplicates
system7% (116 lines)
Duplication per Extension
java8% (98 lines)
yaml18% (18 lines)
Duplication per Component (primary)
sources/coffeeshop/coffee-sls27% (41 lines)
sources/coffeeshop/orders-domain12% (39 lines)
sources/coffeeshop/infrastructure12% (24 lines)
sources/coffeeshop/ddd-commons6% (12 lines)
sources/coffeeshop/inventory-sls0% (0 lines)
sources/coffeeshop/orders-web0% (0 lines)
sources/coffeeshop/service-discovery0% (0 lines)
sources/coffeeshop/orders-application0% (0 lines)
sources/coffeeshop/coffee-domain0% (0 lines)
sources/coffeeshop/inventory-domain0% (0 lines)
sources/coffeeshop/inventory-web0% (0 lines)
sources/coffeeshop/coffee-application0% (0 lines)
deployment/coffeeshop-cdk/lib0% (0 lines)
deployment/coffeeshop-cdk0% (0 lines)
Longest Duplicates
The list of 5 longest duplicates.
See data for all 5 duplicates...
Size#FoldersFilesLinesCode
23 x 2 sources/coffeeshop/coffe...ls/orders/datacontracts
sources/coffeeshop/order...coffeeshop/order/models
OrderItem.java
OrderItem.java
7:47 (100%)
12:52 (92%)
view
12 x 2 sources/coffeeshop/ddd-c...ddd/commons/baseclasses
sources/coffeeshop/infra...op/infra/serializations
DomainEvent.java
DomainEvent.java
12:24 (92%)
13:25 (92%)
view
9 x 2 sources/coffeeshop/coffee-sls
sources/coffeeshop/coffee-sls
packaged.yaml
template.yaml
15:23 (28%)
17:26 (31%)
view
8 x 2 sources/coffeeshop/order...ffeeshop/order/commands
sources/coffeeshop/order...coffeeshop/order/models
CreateOrder.java
Order.java
18:27 (44%)
50:61 (7%)
view
6 x 2 sources/coffeeshop/infra...fra/repositories/coffee
sources/coffeeshop/infra...fra/repositories/orders
CoffeeDDBMapper.java
OrderDDBMapper.java
38:45 (25%)
47:53 (21%)
view
Duplicated Units
The list of top 1 duplicated units.
See data for all 1 unit duplicate
Size#FoldersFilesLinesCode
6 x 2 sources/coffeeshop/infra...fra/repositories/orders
sources/coffeeshop/infra...fra/repositories/coffee
OrderDDBMapper.java
CoffeeDDBMapper.java
47:54 
38:47 
view