aws-samples / saga-orchestration-netcore-blog
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
  • 47% duplication:
    • 743 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 356 duplicated lines
  • 79 duplicates
system47% (356 lines)
Duplication per Extension
yml82% (224 lines)
cs28% (132 lines)
Duplication per Component (primary)
saga-orchestration/UpdateInventoryLambda/src59% (34 lines)
saga-orchestration/MakePaymentLambda82% (28 lines)
saga-orchestration/InvokeOrchestratorLambda82% (28 lines)
saga-orchestration/PlaceOrderLambda82% (28 lines)
saga-orchestration/RevertInventoryLambda82% (28 lines)
saga-orchestration/RemoveOrderLambda82% (28 lines)
saga-orchestration/UpdateInventoryLambda82% (28 lines)
saga-orchestration/SendNotificationLambda82% (28 lines)
saga-orchestration/RevertPaymentLambda82% (28 lines)
saga-orchestration/RevertInventoryLambda/src59% (28 lines)
saga-orchestration/RemoveOrderLambda/src43% (17 lines)
cdk-saga-orchestration/src/CdkSagaOrchestration6% (14 lines)
saga-orchestration/MakePaymentLambda/src59% (13 lines)
saga-orchestration/PlaceOrderLambda/src34% (12 lines)
saga-orchestration/RevertPaymentLambda/src66% (8 lines)
saga-orchestration/InvokeOrchestratorLambda/src14% (6 lines)
saga-orchestration/SendNotificationLambda/src0% (0 lines)

Duplication Between Components (50+ lines)

G saga-orchestration/InvokeOrchestratorLambda saga-orchestration/InvokeOrchestratorLambda saga-orchestration/RevertPaymentLambda saga-orchestration/RevertPaymentLambda saga-orchestration/InvokeOrchestratorLambda--saga-orchestration/RevertPaymentLambda 56 saga-orchestration/PlaceOrderLambda saga-orchestration/PlaceOrderLambda saga-orchestration/InvokeOrchestratorLambda--saga-orchestration/PlaceOrderLambda 56 saga-orchestration/RemoveOrderLambda saga-orchestration/RemoveOrderLambda saga-orchestration/InvokeOrchestratorLambda--saga-orchestration/RemoveOrderLambda 56 saga-orchestration/UpdateInventoryLambda saga-orchestration/UpdateInventoryLambda saga-orchestration/InvokeOrchestratorLambda--saga-orchestration/UpdateInventoryLambda 56 saga-orchestration/MakePaymentLambda saga-orchestration/MakePaymentLambda saga-orchestration/InvokeOrchestratorLambda--saga-orchestration/MakePaymentLambda 56 saga-orchestration/RevertInventoryLambda saga-orchestration/RevertInventoryLambda saga-orchestration/InvokeOrchestratorLambda--saga-orchestration/RevertInventoryLambda 56 saga-orchestration/SendNotificationLambda saga-orchestration/SendNotificationLambda saga-orchestration/InvokeOrchestratorLambda--saga-orchestration/SendNotificationLambda 56 saga-orchestration/RevertPaymentLambda--saga-orchestration/UpdateInventoryLambda 56 saga-orchestration/RevertPaymentLambda--saga-orchestration/SendNotificationLambda 56 saga-orchestration/PlaceOrderLambda--saga-orchestration/RevertPaymentLambda 56 saga-orchestration/PlaceOrderLambda--saga-orchestration/RemoveOrderLambda 56 saga-orchestration/PlaceOrderLambda--saga-orchestration/UpdateInventoryLambda 56 saga-orchestration/PlaceOrderLambda--saga-orchestration/RevertInventoryLambda 56 saga-orchestration/PlaceOrderLambda--saga-orchestration/SendNotificationLambda 56 saga-orchestration/RemoveOrderLambda--saga-orchestration/RevertPaymentLambda 56 saga-orchestration/RemoveOrderLambda--saga-orchestration/UpdateInventoryLambda 56 saga-orchestration/RemoveOrderLambda--saga-orchestration/RevertInventoryLambda 56 saga-orchestration/RemoveOrderLambda--saga-orchestration/SendNotificationLambda 56 saga-orchestration/MakePaymentLambda--saga-orchestration/RevertPaymentLambda 56 saga-orchestration/MakePaymentLambda--saga-orchestration/PlaceOrderLambda 56 saga-orchestration/MakePaymentLambda--saga-orchestration/RemoveOrderLambda 56 saga-orchestration/MakePaymentLambda--saga-orchestration/UpdateInventoryLambda 56 saga-orchestration/MakePaymentLambda--saga-orchestration/RevertInventoryLambda 56 saga-orchestration/MakePaymentLambda--saga-orchestration/SendNotificationLambda 56 saga-orchestration/RevertInventoryLambda--saga-orchestration/RevertPaymentLambda 56 saga-orchestration/RevertInventoryLambda--saga-orchestration/UpdateInventoryLambda 56 saga-orchestration/RevertInventoryLambda--saga-orchestration/SendNotificationLambda 56 saga-orchestration/SendNotificationLambda--saga-orchestration/UpdateInventoryLambda 56 saga-orchestration/RevertInventoryLambda/src saga-orchestration/RevertInventoryLambda/src saga-orchestration/UpdateInventoryLambda/src saga-orchestration/UpdateInventoryLambda/src saga-orchestration/RevertInventoryLambda/src--saga-orchestration/UpdateInventoryLambda/src 56

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 79 duplicates...
Size#FoldersFilesLinesCode
22 x 2 saga-orchestration/InvokeOrchestratorLambda
saga-orchestration/RevertPaymentLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/PlaceOrderLambda
saga-orchestration/RemoveOrderLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/InvokeOrchestratorLambda
saga-orchestration/UpdateInventoryLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/MakePaymentLambda
saga-orchestration/RevertPaymentLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/PlaceOrderLambda
saga-orchestration/UpdateInventoryLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/MakePaymentLambda
saga-orchestration/RevertInventoryLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/RevertPaymentLambda
saga-orchestration/UpdateInventoryLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/InvokeOrchestratorLambda
saga-orchestration/MakePaymentLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/RevertInventoryLambda
saga-orchestration/UpdateInventoryLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/PlaceOrderLambda
saga-orchestration/SendNotificationLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/InvokeOrchestratorLambda
saga-orchestration/RemoveOrderLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/RevertPaymentLambda
saga-orchestration/SendNotificationLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/InvokeOrchestratorLambda
saga-orchestration/PlaceOrderLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/PlaceOrderLambda
saga-orchestration/RevertPaymentLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/MakePaymentLambda
saga-orchestration/PlaceOrderLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/MakePaymentLambda
saga-orchestration/SendNotificationLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/RemoveOrderLambda
saga-orchestration/RevertPaymentLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/InvokeOrchestratorLambda
saga-orchestration/SendNotificationLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/MakePaymentLambda
saga-orchestration/UpdateInventoryLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
22 x 2 saga-orchestration/RevertInventoryLambda
saga-orchestration/SendNotificationLambda
buildspec.yml
buildspec.yml
1:23 (64%)
1:23 (64%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
20 x 2 saga-orchestration/Rever...c/RevertInventoryLambda
saga-orchestration/Updat...c/UpdateInventoryLambda
Function.cs
Function.cs
36:59 
69:90 
view
14 x 3 saga-orchestration/Remov...a/src/RemoveOrderLambda
saga-orchestration/Rever...c/RevertInventoryLambda
saga-orchestration/Updat...c/UpdateInventoryLambda
Function.cs
Function.cs
Function.cs
53:68 
61:76 
92:107 
view