awslabs / ec2-spot-labs
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
  • 52% duplication:
    • 12,454 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 6,507 duplicated lines
  • 2,298 duplicates
system52% (6,507 lines)
Duplication per Extension
yaml63% (6,217 lines)
py6% (121 lines)
tf50% (102 lines)
yml17% (67 lines)
Duplication per Component (primary)
aws-compute-optimizer84% (797 lines)
workshops76% (659 lines)
ec2-spot-aws-batch80% (552 lines)
ec2-spot-fleet-jenkins-plugin69% (504 lines)
sqs-ec2-spot-asg86% (421 lines)
sqs-ec2-spot-fleet-autoscaling72% (376 lines)
ec2-spot-eks-solution38% (329 lines)
ec2-asg-mixed-instances-scheduled-ratio72% (297 lines)
ec2-spot-interruption-notice-cloudwatch-events83% (296 lines)
ec2-spot-fleet-multiple-vpcs30% (289 lines)
ecs-ec2-spot-fleet56% (255 lines)
ec2-spot-fleet-launch-templates87% (240 lines)
builder-sessions38% (230 lines)
ec2-spot-asg-launch-template100% (183 lines)
ec2-spot-instance-launch-templates94% (169 lines)
ec2-spot-fleet-aws-batch94% (144 lines)
ec2-spot-elastic-inference25% (124 lines)
ec2-spot-instance-state-change-notification-lambda77% (107 lines)
ecs-spot-terraform44% (102 lines)
ec2-spot-interruption-handler12% (64 lines)
ec2-spot-price-monitoring-with-lambda36% (63 lines)
ec2-spot-emr57% (55 lines)
ec2-spot-fleet-instance-weighting65% (54 lines)
ec2-spot-analyze-costs33% (38 lines)
cost-optimized-spark-on-kubernetes50% (38 lines)
ec2-spot-defined-duration25% (30 lines)
run-instances48% (28 lines)
ecs-ec2-spot-auto-deregister14% (17 lines)
ec2-fleet18% (17 lines)
paginated-api-call-examples20% (12 lines)
ecs-spot-agent7% (9 lines)
ec2-spot-interruption-logging-insights5% (8 lines)
ec2-spot-deep-learning-training0% (0 lines)
ec2-spot-history-notebook0% (0 lines)
ec2-spot-asg-handling-interruptions0% (0 lines)
ec2-spot-duration0% (0 lines)
tensorflow-serving-load-testing-sample0% (0 lines)
ec2-spot-tensorflow-checkpoint0% (0 lines)
ec2-spot-sagemaker-managed-spot-training0% (0 lines)

Duplication Between Components (50+ lines)

G aws-compute-optimizer aws-compute-optimizer sqs-ec2-spot-asg sqs-ec2-spot-asg aws-compute-optimizer--sqs-ec2-spot-asg 920 ec2-spot-interruption-notice-cloudwatch-events ec2-spot-interruption-notice-cloudwatch-events aws-compute-optimizer--ec2-spot-interruption-notice-cloudwatch-events 521 workshops workshops aws-compute-optimizer--workshops 734 ec2-spot-aws-batch ec2-spot-aws-batch aws-compute-optimizer--ec2-spot-aws-batch 783 ec2-asg-mixed-instances-scheduled-ratio ec2-asg-mixed-instances-scheduled-ratio aws-compute-optimizer--ec2-asg-mixed-instances-scheduled-ratio 680 ec2-spot-fleet-jenkins-plugin ec2-spot-fleet-jenkins-plugin aws-compute-optimizer--ec2-spot-fleet-jenkins-plugin 337 ecs-ec2-spot-fleet ecs-ec2-spot-fleet aws-compute-optimizer--ecs-ec2-spot-fleet 375 sqs-ec2-spot-fleet-autoscaling sqs-ec2-spot-fleet-autoscaling aws-compute-optimizer--sqs-ec2-spot-fleet-autoscaling 422 ec2-spot-fleet-launch-templates ec2-spot-fleet-launch-templates aws-compute-optimizer--ec2-spot-fleet-launch-templates 328 ec2-spot-asg-launch-template ec2-spot-asg-launch-template aws-compute-optimizer--ec2-spot-asg-launch-template 303 ec2-spot-instance-launch-templates ec2-spot-instance-launch-templates aws-compute-optimizer--ec2-spot-instance-launch-templates 285 sqs-ec2-spot-asg--workshops 437 sqs-ec2-spot-asg--sqs-ec2-spot-fleet-autoscaling 474 ec2-spot-interruption-notice-cloudwatch-events--workshops 837 ec2-spot-interruption-notice-cloudwatch-events--ecs-ec2-spot-fleet 288 ec2-spot-interruption-notice-cloudwatch-events--sqs-ec2-spot-fleet-autoscaling 312 ec2-spot-aws-batch--sqs-ec2-spot-asg 599 ec2-spot-aws-batch--ec2-spot-interruption-notice-cloudwatch-events 444 ec2-spot-aws-batch--workshops 658 ec2-spot-aws-batch--ec2-spot-fleet-jenkins-plugin 440 ec2-spot-aws-batch--ecs-ec2-spot-fleet 507 ec2-spot-aws-batch--sqs-ec2-spot-fleet-autoscaling 546 ec2-spot-aws-batch--ec2-spot-fleet-launch-templates 411 ec2-spot-aws-batch--ec2-spot-instance-launch-templates 365 ec2-asg-mixed-instances-scheduled-ratio--sqs-ec2-spot-asg 420 ec2-asg-mixed-instances-scheduled-ratio--ec2-spot-interruption-notice-cloudwatch-events 380 ec2-asg-mixed-instances-scheduled-ratio--workshops 640 ec2-asg-mixed-instances-scheduled-ratio--ec2-spot-aws-batch 497 ec2-asg-mixed-instances-scheduled-ratio--ec2-spot-fleet-jenkins-plugin 258 ec2-asg-mixed-instances-scheduled-ratio--sqs-ec2-spot-fleet-autoscaling 284 ec2-spot-fleet-jenkins-plugin--ec2-spot-interruption-notice-cloudwatch-events 304 ec2-spot-fleet-jenkins-plugin--workshops 455 ec2-spot-fleet-jenkins-plugin--ecs-ec2-spot-fleet 612 ec2-spot-fleet-jenkins-plugin--sqs-ec2-spot-fleet-autoscaling 561 ec2-spot-fleet-jenkins-plugin--ec2-spot-fleet-launch-templates 347 ecs-ec2-spot-fleet--workshops 461 ecs-ec2-spot-fleet--sqs-ec2-spot-fleet-autoscaling 430 sqs-ec2-spot-fleet-autoscaling--workshops 488 ec2-spot-fleet-launch-templates--ec2-spot-interruption-notice-cloudwatch-events 292 ec2-spot-fleet-launch-templates--workshops 434 ec2-spot-fleet-launch-templates--ecs-ec2-spot-fleet 294 ec2-spot-fleet-launch-templates--sqs-ec2-spot-fleet-autoscaling 320 ec2-spot-fleet-launch-templates--ec2-spot-instance-launch-templates 337 ec2-spot-asg-launch-template--workshops 372 ec2-spot-asg-launch-template--ec2-spot-aws-batch 433 ec2-spot-asg-launch-template--ec2-spot-fleet-launch-templates 295 ec2-spot-asg-launch-template--ec2-spot-instance-launch-templates 308 ec2-spot-instance-launch-templates--workshops 372 ec2-spot-instance-state-change-notification-lambda ec2-spot-instance-state-change-notification-lambda ec2-spot-instance-state-change-notification-lambda--workshops 327 ec2-spot-elastic-inference ec2-spot-elastic-inference ec2-spot-elastic-inference--workshops 303

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 2,298 duplicates...
Size#FoldersFilesLinesCode
140 x 2 aws-compute-optimizer
aws-compute-optimizer
aws-compute-optimizer.yaml
opt3.yaml
307:450 (29%)
251:394 (34%)
view
134 x 2 ec2-spot-interruption-notice-cloudwatch-events
workshops/ec2-spot-fleet-web-app
ec2-spot-interruption-notice-cloudwat...
ec2-spot-fleet-web-app.yaml
221:354 (37%)
170:303 (43%)
view
101 x 2 aws-compute-optimizer
sqs-ec2-spot-asg
aws-compute-optimizer.yaml
sqs-ec2-spot-asg.yaml
350:450 (21%)
345:445 (20%)
view
101 x 2 aws-compute-optimizer
sqs-ec2-spot-asg
opt3.yaml
sqs-ec2-spot-asg.yaml
294:394 (25%)
345:445 (20%)
view
100 x 2 aws-compute-optimizer
ec2-spot-aws-batch
opt3.yaml
ec2-spot-aws-batch-allocation-strateg...
295:394 (24%)
211:310 (29%)
view
100 x 2 ec2-spot-aws-batch
sqs-ec2-spot-asg
ec2-spot-aws-batch-allocation-strateg...
sqs-ec2-spot-asg.yaml
211:310 (29%)
346:445 (20%)
view
100 x 2 aws-compute-optimizer
ec2-spot-aws-batch
aws-compute-optimizer.yaml
ec2-spot-aws-batch-allocation-strateg...
351:450 (20%)
211:310 (29%)
view
91 x 2 ec2-spot-asg-launch-template
ec2-spot-instance-launch-templates
ec2-spot-asg-launch-template.yaml
ec2-spot-instance-launch-templates.yaml
85:175 (49%)
71:161 (51%)
view
89 x 2 ec2-spot-fleet-jenkins-plugin
ecs-ec2-spot-fleet
spot-fleet-jenkins-plugin.yaml
ecs-ec2-spot-fleet.yaml
566:654 (12%)
115:203 (19%)
view
89 x 2 ecs-ec2-spot-fleet
sqs-ec2-spot-fleet-autoscaling
ecs-ec2-spot-fleet.yaml
sqs-ec2-spot-fleet-autoscaling.yaml
111:199 (19%)
108:196 (17%)
view
86 x 2 ec2-spot-aws-batch
sqs-ec2-spot-fleet-autoscaling
ec2-spot-aws-batch-unmanaged-asg.yaml
sqs-ec2-spot-fleet-autoscaling.yaml
229:314 (25%)
112:197 (16%)
view
86 x 2 ec2-spot-asg-launch-template
ec2-spot-fleet-launch-templates
ec2-spot-asg-launch-template.yaml
ec2-spot-fleet-launch-templates.yaml
90:175 (46%)
140:225 (31%)
view
86 x 2 ec2-spot-aws-batch
ec2-spot-instance-launch-templates
ec2-spot-aws-batch-unmanaged-asg.yaml
ec2-spot-instance-launch-templates.yaml
228:313 (25%)
76:161 (48%)
view
86 x 2 ec2-spot-aws-batch
ec2-spot-fleet-launch-templates
ec2-spot-aws-batch-unmanaged-asg.yaml
ec2-spot-fleet-launch-templates.yaml
228:313 (25%)
140:225 (31%)
view
86 x 2 ec2-spot-asg-launch-template
ec2-spot-aws-batch
ec2-spot-asg-launch-template.yaml
ec2-spot-aws-batch-unmanaged-asg.yaml
90:175 (46%)
228:313 (25%)
view
86 x 2 ec2-spot-fleet-launch-templates
ec2-spot-instance-launch-templates
ec2-spot-fleet-launch-templates.yaml
ec2-spot-instance-launch-templates.yaml
140:225 (31%)
76:161 (48%)
view
85 x 2 ec2-spot-fleet-jenkins-plugin
sqs-ec2-spot-fleet-autoscaling
spot-fleet-jenkins-plugin.yaml
sqs-ec2-spot-fleet-autoscaling.yaml
566:650 (11%)
112:196 (16%)
view
85 x 2 ec2-spot-asg-launch-template
workshops/ec2-spot-fleet-web-app
ec2-spot-asg-launch-template.yaml
ec2-spot-fleet-web-app.yaml
91:175 (46%)
170:254 (27%)
view
85 x 2 ec2-spot-aws-batch
ec2-spot-fleet-jenkins-plugin
ec2-spot-aws-batch-unmanaged-asg.yaml
spot-fleet-jenkins-plugin.yaml
229:313 (24%)
566:650 (11%)
view
85 x 2 ec2-spot-fleet-jenkins-plugin
ec2-spot-instance-launch-templates
spot-fleet-jenkins-plugin.yaml
ec2-spot-instance-launch-templates.yaml
566:650 (11%)
77:161 (47%)
view