awslabs / aws-saas-boost
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
  • 27% duplication:
    • 34,940 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 9,745 duplicated lines
  • 6,703 duplicates
system27% (9,745 lines)
Duplication per Extension
yaml39% (4,914 lines)
js25% (2,544 lines)
java17% (2,096 lines)
yml77% (177 lines)
py4% (14 lines)
Duplication per Component (primary)
resources39% (4,914 lines)
client/web25% (2,544 lines)
resources/custom-resources51% (615 lines)
services/settings-service24% (476 lines)
services/onboarding-service12% (171 lines)
metering-billing/lambdas11% (144 lines)
installer/src6% (113 lines)
services/tenant-service12% (98 lines)
functions/alb-update43% (93 lines)
functions/ecs-startup-services69% (79 lines)
services/quotas-service25% (76 lines)
functions/onboarding-notification20% (72 lines)
functions/ecs-shutdown-services93% (72 lines)
functions/ecs-deploy26% (67 lines)
functions/ecs-service-update50% (56 lines)
services/user-service7% (46 lines)
functions/system-rest-api-client54% (43 lines)
services/metric-service3% (32 lines)
layers/utils15% (20 lines)
metrics-analytics/deploy8% (14 lines)
ROOT0% (0 lines)
metrics-analytics/metrics-generator0% (0 lines)
metrics-analytics/metrics-java-sdk0% (0 lines)
layers/apigw-helper0% (0 lines)

Duplication Between Components (50+ lines)

G resources/custom-resources resources/custom-resources services/settings-service services/settings-service resources/custom-resources--services/settings-service 288 functions/ecs-shutdown-services functions/ecs-shutdown-services functions/ecs-startup-services functions/ecs-startup-services functions/ecs-shutdown-services--functions/ecs-startup-services 138 services/onboarding-service services/onboarding-service functions/ecs-startup-services--services/onboarding-service 58 functions/alb-update functions/alb-update functions/ecs-deploy functions/ecs-deploy functions/alb-update--functions/ecs-deploy 112 functions/onboarding-notification functions/onboarding-notification functions/alb-update--functions/onboarding-notification 80 functions/ecs-service-update functions/ecs-service-update functions/alb-update--functions/ecs-service-update 78 functions/ecs-deploy--functions/onboarding-notification 80 functions/ecs-deploy--functions/ecs-service-update 78 functions/system-rest-api-client functions/system-rest-api-client metering-billing/lambdas metering-billing/lambdas functions/system-rest-api-client--metering-billing/lambdas 88 metering-billing/lambdas--services/onboarding-service 51 functions/ecs-service-update--functions/onboarding-notification 78 services/onboarding-service--services/settings-service 78 installer/src installer/src installer/src--resources/custom-resources 62

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 6,703 duplicates...
Size#FoldersFilesLinesCode
102 x 2 client/web/src/metrics
client/web/src/metrics
RequestCountFailures5XXContainer.js
RequestCountFailuresContainer.js
38:154 (69%)
38:153 (69%)
view
76 x 2 resources/custom-resourc...s/saasfactory/saasboost
services/settings-servic...s/saasfactory/saasboost
Database.java
Database.java
22:125 (52%)
24:127 (43%)
view
55 x 2 resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
RdsOptions.java
RedshiftTable.java
227:303 (28%)
159:235 (37%)
view
51 x 2 resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
CidrDynamoDB.java
FsxDnsName.java
100:172 (48%)
77:149 (60%)
view
49 x 2 resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
ClearS3Bucket.java
RdsOptions.java
159:229 (31%)
233:303 (25%)
view
49 x 2 resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
ClearS3Bucket.java
RedshiftTable.java
159:229 (31%)
165:235 (33%)
view
49 x 2 functions/alb-update
functions/ecs-deploy
buildspec.yml
buildspec.yml
1:56 (100%)
1:56 (100%)
view
48 x 2 resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
CidrDynamoDB.java
DisableInstanceProtection.java
103:172 (45%)
94:163 (50%)
view
48 x 2 resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
DisableInstanceProtection.java
FsxDnsName.java
94:163 (50%)
80:149 (56%)
view
40 x 2 functions/ecs-deploy
functions/onboarding-notification
buildspec.yml
buildspec.yml
15:56 (81%)
11:52 (81%)
view
40 x 2 functions/alb-update
functions/onboarding-notification
buildspec.yml
buildspec.yml
15:56 (81%)
11:52 (81%)
view
36 x 2 resources
resources
saas-boost-metering-billing.yaml
saas-boost-metering-billing.yaml
730:765 (4%)
831:866 (4%)
view
34 x 2 client/web/src/metrics
client/web/src/metrics
AccessLogGraphComponent.js
AccessLoggingGraphContainer.js
27:65 (40%)
69:107 (30%)
view
33 x 2 client/web/src/metrics
client/web/src/metrics
AccessLogGraphComponent.js
RequestCountFailuresContainer.js
28:65 (38%)
56:93 (22%)
view
33 x 2 client/web/src/metrics
client/web/src/metrics
AccessLoggingGraphContainer.js
RequestCountFailuresContainer.js
70:107 (29%)
56:93 (22%)
view
33 x 2 client/web/src/metrics
client/web/src/metrics
AccessLogGraphComponent.js
RequestCountFailures5XXContainer.js
28:65 (38%)
56:93 (22%)
view
33 x 2 client/web/src/metrics
client/web/src/metrics
AccessLoggingGraphContainer.js
RequestCountFailures5XXContainer.js
70:107 (29%)
56:93 (22%)
view
31 x 2 functions/ecs-shutdown-s...s/saasfactory/saasboost
functions/ecs-startup-se...s/saasfactory/saasboost
EcsShutdownServices.java
EcsStartupServices.java
93:133 (40%)
106:146 (27%)
view
28 x 2 resources
resources
saas-boost-private-api.yaml
saas-boost-public-api.yaml
759:786 (2%)
995:1022 (1%)
view
28 x 2 resources
resources
saas-boost-svc-metrics.yaml
saas-boost-svc-metrics.yaml
234:261 (3%)
563:590 (3%)
view
Duplicated Units
The list of top 15 duplicated units.
See data for all 15 unit duplicates...
Size#FoldersFilesLinesCode
46 x 2 services/quotas-service/...s/saasfactory/saasboost
services/quotas-service/...s/saasfactory/saasboost
QuotasServiceDAL.java
QuotasServiceDAL.java
218:270 
272:324 
view
35 x 3 resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
ClearS3Bucket.java
RdsOptions.java
RedshiftTable.java
190:230 
264:304 
196:236 
view
34 x 3 resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
resources/custom-resourc...s/saasfactory/saasboost
DisableInstanceProtection.java
CidrDynamoDB.java
FsxDnsName.java
125:164 
134:173 
111:150 
view
23 x 2 functions/onboarding-not...s/saasfactory/saasboost
services/tenant-service/...s/saasfactory/saasboost
OnboardingNotification.java
TenantService.java
369:392 
423:446 
view
20 x 2 functions/ecs-startup-se...s/saasfactory/saasboost
functions/ecs-shutdown-s...s/saasfactory/saasboost
EcsStartupServices.java
EcsShutdownServices.java
42:64 
41:63 
view
15 x 2 client/web/src/settings/api
client/web/src/options/api
index.js
index.js
145:160 
25:40 
view
13 x 4 client/web/src/settings/api
client/web/src/settings/api
client/web/src/users/api
client/web/src/onboarding/api
index.js
index.js
index.js
index.js
57:71 
102:116 
61:75 
27:41 
view
7 x 2 client/web/src/components/Auth
client/web/src/components/Auth
SaasBoostSignIn.js
SaasBoostResetPassword.js
151:161 
64:74 
view
9 x 2 resources/custom-resourc...s/saasfactory/saasboost
services/settings-servic...s/saasfactory/saasboost
Database.java
Database.java
59:68 
61:70 
view
9 x 2 resources/custom-resourc...s/saasfactory/saasboost
services/settings-servic...s/saasfactory/saasboost
Database.java
Database.java
107:116 
109:118 
view
8 x 2 metering-billing/lambdas...actory/metering/billing
metering-billing/lambdas...ory/metering/onboarding
ProcessBillingEvent.java
OnboardTenantProduct.java
45:53 
42:50 
view
8 x 2 layers/utils/src/main/ja...s/saasfactory/saasboost
layers/utils/src/main/ja...s/saasfactory/saasboost
Utils.java
Utils.java
132:140 
146:154 
view
7 x 2 client/web/src/tenant
client/web/src/users
TenantViewContainer.js
UserViewContainer.js
118:125 
90:97 
view
7 x 2 resources/custom-resourc...s/saasfactory/saasboost
services/settings-servic...s/saasfactory/saasboost
Database.java
Database.java
196:203 
236:243 
view
7 x 2 resources/custom-resourc...s/saasfactory/saasboost
services/settings-servic...s/saasfactory/saasboost
Database.java
Database.java
205:212 
245:252 
view