aws-samples / eks-preventative-controls
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
  • 15% duplication:
    • 370 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 59 duplicated lines
  • 6 duplicates
system15% (59 lines)
Duplication per Extension
yaml25% (47 lines)
js100% (12 lines)
Duplication per Component (primary)
k8s-manifests25% (47 lines)
cdk-pipeline100% (6 lines)
cdk-eks100% (6 lines)
cdk-pipeline/lib0% (0 lines)
cdk-eks/lib0% (0 lines)
conftest/data0% (0 lines)
conftest/policy0% (0 lines)
Longest Duplicates
The list of 6 longest duplicates.
See data for all 6 duplicates...
Size#FoldersFilesLinesCode
8 x 2 k8s-manifests
k8s-manifests
guestbook-all-in-one.yaml
guestbook-all-in-one.yaml
93:105 (5%)
150:162 (5%)
view
7 x 2 k8s-manifests
k8s-manifests
guestbook-all-in-one.yaml
guestbook-all-in-one.yaml
24:30 (4%)
73:79 (4%)
view
6 x 2 cdk-eks
cdk-pipeline
jest.config.js
jest.config.js
1:7 (100%)
1:7 (100%)
view
6 x 2 k8s-manifests
k8s-manifests
guestbook-all-in-one.yaml
guestbook-all-in-one.yaml
73:78 (4%)
132:137 (4%)
view
6 x 2 k8s-manifests
k8s-manifests
guestbook-all-in-one.yaml
guestbook-all-in-one.yaml
24:29 (4%)
132:137 (4%)
view
6 x 2 k8s-manifests
k8s-manifests
guestbook-all-in-one.yaml
guestbook-all-in-one.yaml
49:54 (4%)
105:110 (4%)
view