aws-samples / amazon-cloudwatch-container-insights
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
  • 92% duplication:
    • 7,563 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 7,007 duplicated lines
  • 1,223 duplicates
system92% (7,007 lines)
Duplication per Extension
yaml92% (7,007 lines)
Duplication per Component (primary)
k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring97% (2,300 lines)
k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus89% (1,282 lines)
k8s-deployment-manifest-templates/deployment-mode/daemonset/combination98% (645 lines)
k8s-yaml-templates/quickstart100% (567 lines)
k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray99% (543 lines)
ecs-task-definition-templates/deployment-mode/replica-service/cwagent-prometheus72% (538 lines)
k8s-yaml-templates/fluentd100% (414 lines)
k8s-yaml-templates/cwagent-kubernetes-monitoring100% (139 lines)
k8s-deployment-manifest-templates/deployment-mode/service/combination90% (75 lines)
k8s-deployment-manifest-templates/deployment-mode/service/cwagent-statsd95% (71 lines)
k8s-deployment-manifest-templates/deployment-mode/sidecar/combination92% (69 lines)
k8s-yaml-templates/cwagent-statsd61% (66 lines)
k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd100% (64 lines)
k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-emf100% (54 lines)
k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-statsd87% (49 lines)
k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics82% (48 lines)
k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-sdkmetrics71% (41 lines)
k8s-deployment-manifest-templates/deployment-mode/service/cwagent-sdkmetrics52% (36 lines)
k8s-yaml-templates100% (6 lines)

Duplication Between Components (50+ lines)

G k8s-deployment-manifest-templates/deployment-mode/daemonset/combination k8s-deployment-manifest-templates/deployment-mode/daemonset/combination k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring k8s-deployment-manifest-templates/deployment-mode/daemonset/combination--k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring 1918 k8s-yaml-templates/quickstart k8s-yaml-templates/quickstart k8s-deployment-manifest-templates/deployment-mode/daemonset/combination--k8s-yaml-templates/quickstart 1117 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray k8s-deployment-manifest-templates/deployment-mode/daemonset/combination--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray 1052 k8s-yaml-templates/fluentd k8s-yaml-templates/fluentd k8s-deployment-manifest-templates/deployment-mode/daemonset/combination--k8s-yaml-templates/fluentd 824 k8s-yaml-templates/cwagent-kubernetes-monitoring k8s-yaml-templates/cwagent-kubernetes-monitoring k8s-deployment-manifest-templates/deployment-mode/daemonset/combination--k8s-yaml-templates/cwagent-kubernetes-monitoring 249 k8s-deployment-manifest-templates/deployment-mode/service/combination k8s-deployment-manifest-templates/deployment-mode/service/combination k8s-deployment-manifest-templates/deployment-mode/daemonset/combination--k8s-deployment-manifest-templates/deployment-mode/service/combination 56 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd k8s-deployment-manifest-templates/deployment-mode/daemonset/combination--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd 87 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics k8s-deployment-manifest-templates/deployment-mode/daemonset/combination--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics 66 k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring--k8s-yaml-templates/quickstart 1909 k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray 1508 k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring--k8s-yaml-templates/fluentd 1311 k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring--k8s-yaml-templates/cwagent-kubernetes-monitoring 543 k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring--k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus 135 k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd 135 k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics 74 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray--k8s-yaml-templates/quickstart 924 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray--k8s-yaml-templates/fluentd 824 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray--k8s-yaml-templates/cwagent-kubernetes-monitoring 60 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray--k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus 59 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd 93 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-fluentd-xray--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics 58 k8s-yaml-templates/fluentd--k8s-yaml-templates/quickstart 828 k8s-yaml-templates/cwagent-kubernetes-monitoring--k8s-yaml-templates/quickstart 270 ecs-task-definition-templates/deployment-mode/replica-service/cwagent-prometheus ecs-task-definition-templates/deployment-mode/replica-service/cwagent-prometheus ecs-task-definition-templates/deployment-mode/replica-service/cwagent-prometheus--k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus 190 k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus--k8s-yaml-templates/quickstart 86 k8s-deployment-manifest-templates/deployment-mode/service/cwagent-statsd k8s-deployment-manifest-templates/deployment-mode/service/cwagent-statsd k8s-deployment-manifest-templates/deployment-mode/service/combination--k8s-deployment-manifest-templates/deployment-mode/service/cwagent-statsd 142 k8s-yaml-templates/cwagent-statsd k8s-yaml-templates/cwagent-statsd k8s-deployment-manifest-templates/deployment-mode/service/combination--k8s-yaml-templates/cwagent-statsd 75 k8s-deployment-manifest-templates/deployment-mode/service/cwagent-sdkmetrics k8s-deployment-manifest-templates/deployment-mode/service/cwagent-sdkmetrics k8s-deployment-manifest-templates/deployment-mode/service/combination--k8s-deployment-manifest-templates/deployment-mode/service/cwagent-sdkmetrics 64 k8s-deployment-manifest-templates/deployment-mode/service/cwagent-statsd--k8s-yaml-templates/cwagent-statsd 83 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd--k8s-yaml-templates/quickstart 71 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd--k8s-deployment-manifest-templates/deployment-mode/service/combination 70 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd--k8s-deployment-manifest-templates/deployment-mode/service/cwagent-statsd 78 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd--k8s-yaml-templates/cwagent-statsd 91 k8s-deployment-manifest-templates/deployment-mode/sidecar/combination k8s-deployment-manifest-templates/deployment-mode/sidecar/combination k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-emf k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-emf k8s-deployment-manifest-templates/deployment-mode/sidecar/combination--k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-emf 90 k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-statsd k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-statsd k8s-deployment-manifest-templates/deployment-mode/sidecar/combination--k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-statsd 88 k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-emf--k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-statsd 82 k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-statsd--k8s-yaml-templates/cwagent-statsd 52 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics--k8s-deployment-manifest-templates/deployment-mode/service/combination 54 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics--k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-statsd 70 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics--k8s-yaml-templates/cwagent-statsd 53 k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics--k8s-deployment-manifest-templates/deployment-mode/service/cwagent-sdkmetrics 62 k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-sdkmetrics k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-sdkmetrics k8s-deployment-manifest-templates/deployment-mode/daemonset/cwagent-sdkmetrics--k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-sdkmetrics 50 k8s-deployment-manifest-templates/deployment-mode/service/cwagent-sdkmetrics--k8s-deployment-manifest-templates/deployment-mode/service/cwagent-statsd 50 k8s-deployment-manifest-templates/deployment-mode/service/cwagent-sdkmetrics--k8s-deployment-manifest-templates/deployment-mode/sidecar/cwagent-sdkmetrics 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 1,223 duplicates...
Size#FoldersFilesLinesCode
479 x 2 k8s-deployment-manifest-...e/daemonset/combination
k8s-deployment-manifest-...et/cwagent-fluentd-xray
combination.yaml
cwagent-fluentd-xray-quickstart.yaml
195:710 (72%)
80:595 (87%)
view
411 x 2 k8s-deployment-manifest-...ghts-monitoring/fluentd
k8s-deployment-manifest-...s-monitoring/quickstart
fluentd.yaml
cwagent-fluentd-quickstart.yaml
1:439 (100%)
190:628 (71%)
view
406 x 2 k8s-yaml-templates/fluentd
k8s-yaml-templates/quickstart
fluentd.yaml
cwagent-fluentd-quickstart.yaml
1:434 (100%)
185:618 (71%)
view
342 x 2 k8s-deployment-manifest-...s-monitoring/fluent-bit
k8s-deployment-manifest-...s-monitoring/quickstart
fluent-bit.yaml
cwagent-fluent-bit-quickstart.yaml
1:363 (100%)
196:558 (66%)
view
325 x 2 k8s-deployment-manifest-...vice/cwagent-prometheus
k8s-deployment-manifest-...vice/cwagent-prometheus
prometheus-eks-fargate.yaml
prometheus-k8s.yaml
12:346 (80%)
2:336 (79%)
view
216 x 2 k8s-deployment-manifest-...e/daemonset/combination
k8s-deployment-manifest-...s-monitoring/quickstart
combination.yaml
cwagent-fluentd-quickstart.yaml
149:384 (32%)
130:365 (37%)
view
171 x 2 k8s-deployment-manifest-...s-monitoring/quickstart
k8s-deployment-manifest-...et/cwagent-fluentd-xray
cwagent-fluentd-quickstart.yaml
cwagent-fluentd-xray-quickstart.yaml
176:365 (29%)
80:269 (31%)
view
162 x 2 k8s-deployment-manifest-...s-monitoring/quickstart
k8s-deployment-manifest-...s-monitoring/quickstart
cwagent-fluent-bit-quickstart.yaml
cwagent-fluentd-quickstart.yaml
2:185 (31%)
2:183 (28%)
view
161 x 2 k8s-deployment-manifest-...e/daemonset/combination
k8s-deployment-manifest-...ghts-monitoring/fluentd
combination.yaml
fluentd.yaml
209:384 (24%)
1:176 (39%)
view
161 x 2 k8s-deployment-manifest-...ghts-monitoring/fluentd
k8s-deployment-manifest-...et/cwagent-fluentd-xray
fluentd.yaml
cwagent-fluentd-xray-quickstart.yaml
1:176 (39%)
94:269 (29%)
view
132 x 2 ecs-task-definition-temp...oudformation-quickstart
ecs-task-definition-temp...oudformation-quickstart
cwagent-ecs-prometheus-metric-for-aws...
cwagent-ecs-prometheus-metric-for-bri...
89:220 (50%)
84:215 (52%)
view
112 x 2 k8s-deployment-manifest-...vice/cwagent-prometheus
k8s-deployment-manifest-...vice/cwagent-prometheus
prometheus-eks-fargate.yaml
prometheus-eks.yaml
34:145 (27%)
19:130 (24%)
view
112 x 2 k8s-deployment-manifest-...vice/cwagent-prometheus
k8s-deployment-manifest-...vice/cwagent-prometheus
prometheus-eks.yaml
prometheus-k8s.yaml
19:130 (24%)
24:135 (27%)
view
109 x 2 k8s-deployment-manifest-...s-monitoring/quickstart
k8s-yaml-templates/quickstart
cwagent-fluentd-quickstart.yaml
cwagent-fluentd-quickstart.yaml
167:284 (18%)
162:279 (19%)
view
109 x 2 k8s-deployment-manifest-...e/daemonset/combination
k8s-yaml-templates/quickstart
combination.yaml
cwagent-fluentd-quickstart.yaml
186:303 (16%)
162:279 (19%)
view
101 x 2 k8s-deployment-manifest-...et/cwagent-fluentd-xray
k8s-yaml-templates/quickstart
cwagent-fluentd-xray-quickstart.yaml
cwagent-fluentd-quickstart.yaml
80:188 (18%)
171:279 (17%)
view
100 x 2 k8s-deployment-manifest-...vice/cwagent-prometheus
k8s-deployment-manifest-...vice/cwagent-prometheus
prometheus-eks.yaml
prometheus-k8s.yaml
278:378 (21%)
226:326 (24%)
view
100 x 2 k8s-deployment-manifest-...vice/cwagent-prometheus
k8s-deployment-manifest-...vice/cwagent-prometheus
prometheus-eks-fargate.yaml
prometheus-eks.yaml
236:336 (24%)
278:378 (21%)
view
97 x 2 k8s-deployment-manifest-...et/cwagent-fluentd-xray
k8s-yaml-templates/fluentd
cwagent-fluentd-xray-quickstart.yaml
fluentd.yaml
241:344 (17%)
145:248 (23%)
view
97 x 2 k8s-deployment-manifest-...e/daemonset/combination
k8s-yaml-templates/fluentd
combination.yaml
fluentd.yaml
356:459 (14%)
145:248 (23%)
view