aws / aws-eks-best-practices
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
  • 38% duplication:
    • 2,771 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 1,068 duplicated lines
  • 204 duplicates
system38% (1,068 lines)
Duplication per Extension
yaml43% (1,056 lines)
py5% (12 lines)
Duplication per Component (primary)
policies/opa/gatekeeper/constraint-templates73% (576 lines)
policies/opa/classic/configmaps39% (149 lines)
policies/alternative-gatekeeper/policies/constraint-templates19% (135 lines)
policies/alternative-gatekeeper/policies/constraints55% (90 lines)
policies/opa/gatekeeper/constraints48% (58 lines)
policies/kyverno/cluster-policies12% (28 lines)
policies/alternative-gatekeeper/policies51% (20 lines)
projects/enable-irsa/src5% (12 lines)
ROOT0% (0 lines)
projects/imds0% (0 lines)
policies/alternative-gatekeeper0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 204 duplicates...
Size#FoldersFilesLinesCode
73 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
7-svc-clusterip-ext-ips.yaml
8-svc-clusterip-ext-ips-allowed.yaml
18:108 (80%)
22:112 (74%)
view
66 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
2-dep-security-context-template.yaml
5-dep-resources-template.yaml
13:100 (59%)
13:100 (56%)
view
65 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
4-dep-role-ns-template.yaml
6-dep-latest-version-template.yaml
13:94 (72%)
13:94 (74%)
view
62 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
3-dep-registry-template.yaml
6-dep-latest-version-template.yaml
22:99 (68%)
18:95 (71%)
view
61 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
2-dep-security-context-template.yaml
6-dep-latest-version-template.yaml
13:93 (54%)
13:88 (70%)
view
61 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
4-dep-role-ns-template.yaml
5-dep-resources-template.yaml
13:88 (67%)
13:93 (52%)
view
61 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
5-dep-resources-template.yaml
6-dep-latest-version-template.yaml
13:93 (52%)
13:88 (70%)
view
61 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
3-dep-registry-template.yaml
4-dep-role-ns-template.yaml
22:98 (67%)
18:94 (67%)
view
61 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
2-dep-security-context-template.yaml
4-dep-role-ns-template.yaml
13:93 (54%)
13:88 (67%)
view
57 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
1-labels-constraint-template.yaml
4-dep-role-ns-template.yaml
26:96 (57%)
18:88 (63%)
view
57 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
1-labels-constraint-template.yaml
3-dep-registry-template.yaml
26:96 (57%)
22:92 (62%)
view
57 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
1-labels-constraint-template.yaml
5-dep-resources-template.yaml
26:96 (57%)
18:93 (48%)
view
57 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
1-labels-constraint-template.yaml
2-dep-security-context-template.yaml
26:96 (57%)
18:93 (51%)
view
57 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
2-dep-security-context-template.yaml
3-dep-registry-template.yaml
18:93 (51%)
22:92 (62%)
view
57 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
3-dep-registry-template.yaml
5-dep-resources-template.yaml
22:92 (62%)
18:93 (48%)
view
57 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
1-labels-constraint-template.yaml
6-dep-latest-version-template.yaml
26:96 (57%)
18:88 (65%)
view
35 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
4-dep-role-ns-template.yaml
7-svc-clusterip-ext-ips.yaml
13:55 (38%)
13:55 (38%)
view
35 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
6-dep-latest-version-template.yaml
7-svc-clusterip-ext-ips.yaml
13:55 (40%)
13:55 (38%)
view
35 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
2-dep-security-context-template.yaml
7-svc-clusterip-ext-ips.yaml
13:55 (31%)
13:55 (38%)
view
35 x 2 policies/opa/gatekeeper/constraint-templates
policies/opa/gatekeeper/constraint-templates
5-dep-resources-template.yaml
7-svc-clusterip-ext-ips.yaml
13:55 (29%)
13:55 (38%)
view