aws-samples / eks-security-compromised-cluster-remediation
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
  • 42% duplication:
    • 1,585 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 675 duplicated lines
  • 40 duplicates
system42% (675 lines)
Duplication per Extension
yaml45% (675 lines)
Duplication per Component (primary)
Implement_Countermeasures/gatekeeper/constraint-templates80% (613 lines)
Implement_Countermeasures/gatekeeper/constraints68% (62 lines)
Containment/forensics/source0% (0 lines)
Implement_Countermeasures/security-profiles-operator/profiles0% (0 lines)
Implement_Countermeasures/security-profiles-operator/pods0% (0 lines)
Implement_Countermeasures/falco0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 40 duplicates...
Size#FoldersFilesLinesCode
79 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-filesystem-template.yaml
pod-host-filesystem-template.yaml
16:109 (47%)
16:109 (47%)
view
68 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-network-template.yaml
pod-host-network-template.yaml
12:93 (65%)
12:93 (65%)
view
62 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-security-context-template.yaml
pod-security-context-template.yaml
12:89 (57%)
12:88 (54%)
view
58 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
pod-host-filesystem-template.yaml
pod-host-network-template.yaml
38:109 (34%)
22:93 (55%)
view
58 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-network-template.yaml
pod-host-filesystem-template.yaml
22:93 (55%)
38:109 (34%)
view
58 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-filesystem-template.yaml
pod-host-network-template.yaml
38:109 (34%)
22:93 (55%)
view
58 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-filesystem-template.yaml
dep-host-network-template.yaml
38:109 (34%)
22:93 (55%)
view
54 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-filesystem-template.yaml
pod-host-filesystem-template.yaml
120:187 (32%)
120:187 (32%)
view
30 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-filesystem-template.yaml
pod-security-context-template.yaml
72:109 (17%)
45:82 (26%)
view
30 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-network-template.yaml
pod-security-context-template.yaml
56:93 (28%)
45:82 (26%)
view
30 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-security-context-template.yaml
pod-host-network-template.yaml
46:83 (28%)
56:93 (28%)
view
30 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-network-template.yaml
dep-security-context-template.yaml
56:93 (28%)
46:83 (28%)
view
30 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
pod-host-network-template.yaml
pod-security-context-template.yaml
56:93 (28%)
45:82 (26%)
view
30 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-filesystem-template.yaml
dep-security-context-template.yaml
72:109 (17%)
46:83 (28%)
view
30 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
pod-host-filesystem-template.yaml
pod-security-context-template.yaml
72:109 (17%)
45:82 (26%)
view
30 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-security-context-template.yaml
pod-host-filesystem-template.yaml
46:83 (28%)
72:109 (17%)
view
26 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-network-template.yaml
pod-security-context-template.yaml
22:52 (25%)
15:45 (23%)
view
26 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-host-filesystem-template.yaml
dep-security-context-template.yaml
38:68 (15%)
16:46 (24%)
view
26 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
pod-host-filesystem-template.yaml
pod-security-context-template.yaml
38:68 (15%)
15:45 (23%)
view
26 x 2 Implement_Countermeasure...er/constraint-templates
Implement_Countermeasure...er/constraint-templates
dep-security-context-template.yaml
pod-host-filesystem-template.yaml
16:46 (24%)
38:68 (15%)
view