aws-samples / iot-reference-architectures
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
  • 10% duplication:
    • 4,760 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 478 duplicated lines
  • 76 duplicates
system10% (478 lines)
Duplication per Extension
yaml46% (191 lines)
kts29% (148 lines)
java5% (139 lines)
Duplication per Component (primary)
cross-account-publish25% (148 lines)
dynamodb-api8% (81 lines)
cloudwatch-events38% (78 lines)
serverless-ui4% (73 lines)
cbor-stack27% (36 lines)
amazon-ion-stack26% (30 lines)
mqtt-over-websockets-jitpack54% (19 lines)
results-iterator-jitpack39% (13 lines)
greengrass-v20% (0 lines)
tools0% (0 lines)
cross-account-register-ztp0% (0 lines)
partner-attribution0% (0 lines)

Duplication Between Components (50+ lines)

G cloudwatch-events cloudwatch-events cross-account-publish cross-account-publish cloudwatch-events--cross-account-publish 157 serverless-ui serverless-ui cross-account-publish--serverless-ui 62 amazon-ion-stack amazon-ion-stack cbor-stack cbor-stack amazon-ion-stack--cbor-stack 58

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 76 duplicates...
Size#FoldersFilesLinesCode
25 x 2 cross-account-publish/c-sharp
cross-account-publish/python
customer-account.yaml
customer-account.yaml
1:26 (89%)
1:26 (92%)
view
18 x 2 amazon-ion-stack
cbor-stack
build.gradle.kts
build.gradle.kts
1:29 (36%)
1:29 (36%)
view
15 x 2 cloudwatch-events/python
cross-account-publish/python
customer-account.yaml
partner-account.yaml
33:48 (20%)
25:39 (23%)
view
14 x 2 cloudwatch-events/python
cloudwatch-events/python
customer-account.yaml
partner-account.yaml
33:47 (18%)
46:59 (17%)
view
14 x 2 cloudwatch-events/python
cross-account-publish/python
partner-account.yaml
partner-account.yaml
46:59 (17%)
25:38 (22%)
view
11 x 2 dynamodb-api/src/main/ja...t/dynamodb/api/handlers
dynamodb-api/src/main/ja...t/dynamodb/api/handlers
HandleIotGetEvent.java
HandleIotNextEvent.java
55:73 (29%)
60:78 (25%)
view
11 x 2 dynamodb-api/src/main/ja...t/dynamodb/api/handlers
dynamodb-api/src/main/ja...t/dynamodb/api/handlers
HandleIotDeleteEvent.java
HandleIotNextEvent.java
42:60 (36%)
60:78 (25%)
view
11 x 2 amazon-ion-stack
cbor-stack
build.gradle.kts
build.gradle.kts
31:49 (22%)
31:49 (22%)
view
11 x 2 dynamodb-api/src/main/ja...t/dynamodb/api/handlers
dynamodb-api/src/main/ja...t/dynamodb/api/handlers
HandleIotDeleteEvent.java
HandleIotGetEvent.java
42:60 (36%)
55:73 (29%)
view
9 x 2 cross-account-publish/c-sharp
cross-account-publish/python
partner-account.yaml
partner-account.yaml
20:28 (28%)
32:40 (14%)
view
9 x 2 cross-account-publish/c-sharp
cross-account-publish/python
partner-account.yaml
partner-account.yaml
10:18 (28%)
22:30 (14%)
view
9 x 2 amazon-ion-stack
cross-account-publish/certificate-based-stack
build.gradle.kts
build.gradle.kts
21:32 (18%)
28:40 (13%)
view
9 x 2 cloudwatch-events/python
cross-account-publish/python
partner-account.yaml
partner-account.yaml
71:80 (11%)
54:63 (14%)
view
9 x 2 cloudwatch-events/python
cross-account-publish/python
customer-account.yaml
partner-account.yaml
54:62 (12%)
41:49 (14%)
view
8 x 2 cloudwatch-events/python
cloudwatch-events/python
partner-account.yaml
partner-account.yaml
32:39 (10%)
53:60 (10%)
view
8 x 2 serverless-ui/jwt-stack/...ples/client/attribution
serverless-ui/jwt-stack/...wssamples/client/create
AttributionPresenter.java
CreatePresenter.java
33:44 (36%)
134:145 (10%)
view
8 x 2 cloudwatch-events/python
cross-account-publish/python
partner-account.yaml
customer-account.yaml
32:39 (10%)
20:27 (29%)
view
8 x 2 cloudwatch-events/python
cross-account-publish/c-sharp
customer-account.yaml
partner-account.yaml
40:48 (10%)
20:27 (25%)
view
8 x 2 cloudwatch-events/python
cross-account-publish/python
partner-account.yaml
customer-account.yaml
53:60 (10%)
20:27 (29%)
view
8 x 2 cloudwatch-events/python
cloudwatch-events/python
customer-account.yaml
partner-account.yaml
53:60 (10%)
61:68 (10%)
view