aws-solutions / aws-security-hub-automated-response-and-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
  • 44% duplication:
    • 11,663 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 5,243 duplicated lines
  • 4,144 duplicates
system44% (5,243 lines)
Duplication per Extension
yaml61% (3,527 lines)
ts36% (1,058 lines)
py21% (658 lines)
Duplication per Component (primary)
source/playbooks/PCI32184% (1,239 lines)
source/playbooks/AFSBP83% (1,102 lines)
source/playbooks/CIS12070% (977 lines)
source/solution_deploy/lib45% (878 lines)
source/remediation_runbooks/scripts28% (363 lines)
source/remediation_runbooks18% (330 lines)
source/lib22% (109 lines)
source/Orchestrator15% (90 lines)
source/playbooks/NEWPLAYBOOK37% (74 lines)
source/Orchestrator/lib11% (55 lines)
source/LambdaLayers3% (26 lines)
source/solution_deploy/source0% (0 lines)
source0% (0 lines)

Duplication Between Components (50+ lines)

G source/playbooks/AFSBP source/playbooks/AFSBP source/playbooks/PCI321 source/playbooks/PCI321 source/playbooks/AFSBP--source/playbooks/PCI321 2087 source/playbooks/CIS120 source/playbooks/CIS120 source/playbooks/AFSBP--source/playbooks/CIS120 1664 source/playbooks/NEWPLAYBOOK source/playbooks/NEWPLAYBOOK source/playbooks/AFSBP--source/playbooks/NEWPLAYBOOK 549 source/remediation_runbooks source/remediation_runbooks source/playbooks/AFSBP--source/remediation_runbooks 108 source/playbooks/PCI321--source/remediation_runbooks 87 source/playbooks/CIS120--source/playbooks/PCI321 1921 source/playbooks/CIS120--source/playbooks/NEWPLAYBOOK 422 source/playbooks/CIS120--source/remediation_runbooks 101 source/playbooks/NEWPLAYBOOK--source/playbooks/PCI321 486 source/playbooks/NEWPLAYBOOK--source/remediation_runbooks 111 source/lib source/lib source/solution_deploy/lib source/solution_deploy/lib source/lib--source/solution_deploy/lib 111 source/lib--source/remediation_runbooks 77 source/remediation_runbooks--source/solution_deploy/lib 60 source/Orchestrator/lib source/Orchestrator/lib source/Orchestrator/lib--source/lib 75 source/Orchestrator/lib--source/solution_deploy/lib 60

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 4,144 duplicates...
Size#FoldersFilesLinesCode
55 x 2 source/playbooks/AFSBP/ssmdocs/scripts
source/playbooks/CIS120/ssmdocs/scripts
afsbp_parse_input.py
cis_parse_input.py
21:94 (94%)
21:94 (94%)
view
55 x 2 source/playbooks/AFSBP/ssmdocs/scripts
source/playbooks/PCI321/ssmdocs/scripts
afsbp_parse_input.py
pci_parse_input.py
21:94 (94%)
21:94 (94%)
view
55 x 2 source/playbooks/CIS120/ssmdocs/scripts
source/playbooks/PCI321/ssmdocs/scripts
cis_parse_input.py
pci_parse_input.py
21:94 (94%)
21:94 (94%)
view
52 x 2 source/playbooks/CIS120/ssmdocs
source/playbooks/PCI321/ssmdocs
CIS_3.1.yaml
PCI_PCI.CW.1.yaml
46:98 (33%)
16:68 (40%)
view
41 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/CIS120/ssmdocs
AFSBP_CloudTrail.2.yaml
CIS_2.7.yaml
14:55 (53%)
12:53 (53%)
view
41 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/PCI321/ssmdocs
AFSBP_CloudTrail.2.yaml
PCI_PCI.CloudTrail.1.yaml
14:55 (53%)
14:55 (51%)
view
41 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/PCI321/ssmdocs
AFSBP_RDS.1.yaml
PCI_PCI.RDS.1.yaml
12:53 (53%)
12:53 (53%)
view
41 x 2 source/playbooks/CIS120/ssmdocs
source/playbooks/PCI321/ssmdocs
CIS_2.7.yaml
PCI_PCI.CloudTrail.1.yaml
12:53 (53%)
14:55 (51%)
view
39 x 2 source/remediation_runbooks/scripts
source/remediation_runbooks/scripts
CreateLogMetricFilterAndAlarm_createt...
EnableAWSConfig_createtopic.py
22:68 (54%)
22:68 (54%)
view
39 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/PCI321/ssmdocs
AFSBP_EC2.1.yaml
PCI_PCI.EC2.1.yaml
13:53 (51%)
13:53 (51%)
view
38 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/PCI321/ssmdocs
AFSBP_AutoScaling.1.yaml
PCI_PCI.AutoScaling.1.yaml
20:57 (50%)
20:58 (50%)
view
38 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/PCI321/ssmdocs
AFSBP_S3.5.yaml
PCI_PCI.S3.5.yaml
17:55 (50%)
17:55 (50%)
view
37 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/CIS120/ssmdocs
AFSBP_Config.1.yaml
CIS_2.5.yaml
18:55 (46%)
18:55 (46%)
view
35 x 2 source/solution_deploy/lib
source/solution_deploy/lib
remediation_runbook-stack.ts
remediation_runbook-stack.ts
801:843 (3%)
1368:1409 (3%)
view
35 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/PCI321/ssmdocs
AFSBP_S3.1.yaml
PCI_PCI.S3.6.yaml
17:51 (46%)
17:52 (46%)
view
35 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/PCI321/ssmdocs
AFSBP_S3.2.yaml
PCI_PCI.S3.1.yaml
18:53 (46%)
18:53 (46%)
view
35 x 2 source/playbooks/AFSBP/ssmdocs
source/playbooks/CIS120/ssmdocs
AFSBP_S3.2.yaml
CIS_2.3.yaml
18:53 (46%)
17:52 (46%)
view
35 x 2 source/playbooks/CIS120/ssmdocs
source/playbooks/PCI321/ssmdocs
CIS_2.2.yaml
PCI_PCI.CloudTrail.3.yaml
17:52 (49%)
17:52 (49%)
view
35 x 2 source/playbooks/CIS120/ssmdocs
source/playbooks/PCI321/ssmdocs
CIS_2.3.yaml
PCI_PCI.S3.1.yaml
17:52 (46%)
18:53 (46%)
view
34 x 2 source/playbooks/CIS120/ssmdocs
source/playbooks/PCI321/ssmdocs
CIS_2.8.yaml
PCI_PCI.KMS.1.yaml
16:50 (49%)
20:54 (47%)
view
Duplicated Units
The list of top 2 duplicated units.
See data for all 2 unit duplicates...
Size#FoldersFilesLinesCode
52 x 3 source/playbooks/PCI321/ssmdocs/scripts
source/playbooks/CIS120/ssmdocs/scripts
source/playbooks/AFSBP/ssmdocs/scripts
pci_parse_input.py
cis_parse_input.py
afsbp_parse_input.py
0:0 
0:0 
0:0 
view
10 x 3 source/Orchestrator
source/Orchestrator
source/Orchestrator
check_ssm_doc_state.py
exec_ssm_doc.py
check_ssm_execution.py
0:0 
0:0 
0:0 
view