aws-samples / aws-management-and-governance-samples
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
  • 18% duplication:
    • 2,804 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 512 duplicated lines
  • 39 duplicates
system18% (512 lines)
Duplication per Extension
yaml24% (472 lines)
py5% (32 lines)
yml2% (8 lines)
Duplication per Component (primary)
AWSConfig/AWS-Config-OPA/cfn_templates56% (167 lines)
AWSSystemsManager/AWS-Org-SSM-Permissions/ssm-management-account31% (122 lines)
AWSSystemsManager/CentralizedPatchManagement12% (109 lines)
AWSConfig/ConformancePacks15% (42 lines)
AWSSystemsManager/AWS-Org-SSM-Permissions/ssm-child-account24% (32 lines)
AWSConfig/CloudEndureCheckReplication/lambda_function8% (32 lines)
AWSLicenseManager/TrackLicenses_MultiRegion5% (8 lines)
AWSCloudTrail0% (0 lines)
AWSConfig/AWS-Config-OPA/opa_policies0% (0 lines)
AWSConfig/AWS-Config-OPA/lambda_sources0% (0 lines)

Duplication Between Components (50+ lines)

G AWSSystemsManager/AWS-Org-SSM-Permissions/ssm-child-account AWSSystemsManager/AWS-Org-SSM-Permissions/ssm-child-account AWSSystemsManager/AWS-Org-SSM-Permissions/ssm-management-account AWSSystemsManager/AWS-Org-SSM-Permissions/ssm-management-account AWSSystemsManager/AWS-Org-SSM-Permissions/ssm-child-account--AWSSystemsManager/AWS-Org-SSM-Permissions/ssm-management-account 94

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 39 duplicates...
Size#FoldersFilesLinesCode
26 x 2 AWSConfig/AWS-Config-OPA..._templates/config_rules
AWSConfig/AWS-Config-OPA..._templates/config_rules
opa-ebs-attachment.yaml
opa-eip-attachment.yaml
24:51 (54%)
24:51 (54%)
view
26 x 2 AWSConfig/AWS-Config-OPA..._templates/config_rules
AWSConfig/AWS-Config-OPA..._templates/config_rules
opa-ebs-attachment.yaml
opa-ebs-encryption.yaml
24:51 (54%)
24:51 (54%)
view
26 x 2 AWSConfig/AWS-Config-OPA..._templates/config_rules
AWSConfig/AWS-Config-OPA..._templates/config_rules
opa-eip-attachment.yaml
opa-s3-encryption.yaml
24:51 (54%)
24:51 (54%)
view
26 x 2 AWSConfig/AWS-Config-OPA..._templates/config_rules
AWSConfig/AWS-Config-OPA..._templates/config_rules
opa-ebs-encryption.yaml
opa-eip-attachment.yaml
24:51 (54%)
24:51 (54%)
view
26 x 2 AWSConfig/AWS-Config-OPA..._templates/config_rules
AWSConfig/AWS-Config-OPA..._templates/config_rules
opa-ebs-encryption.yaml
opa-s3-encryption.yaml
24:51 (54%)
24:51 (54%)
view
26 x 2 AWSConfig/AWS-Config-OPA..._templates/config_rules
AWSConfig/AWS-Config-OPA..._templates/config_rules
opa-ebs-attachment.yaml
opa-s3-encryption.yaml
24:51 (54%)
24:51 (54%)
view
21 x 2 AWSSystemsManager/AWS-Or.../ssm-management-account
AWSSystemsManager/AWS-Or.../ssm-management-account
template.yaml
template.yaml
98:118 (6%)
194:214 (6%)
view
19 x 2 AWSSystemsManager/AWS-Or...sions/ssm-child-account
AWSSystemsManager/AWS-Or.../ssm-management-account
template.yaml
template.yaml
11:29 (14%)
19:37 (5%)
view
17 x 2 AWSSystemsManager/AWS-Or...sions/ssm-child-account
AWSSystemsManager/AWS-Or.../ssm-management-account
template.yaml
template.yaml
13:29 (12%)
121:137 (4%)
view
17 x 2 AWSSystemsManager/AWS-Or.../ssm-management-account
AWSSystemsManager/AWS-Or.../ssm-management-account
template.yaml
template.yaml
21:37 (4%)
121:137 (4%)
view
16 x 2 AWSConfig/CloudEndureChe...ication/lambda_function
AWSConfig/CloudEndureChe...ication/lambda_function
CloudEndureReplicationCheck.py
CloudEndureReplicationCheck.py
161:180 (4%)
184:203 (4%)
view
15 x 2 AWSConfig/AWS-Config-OPA..._templates/config_rules
AWSConfig/AWS-Config-OPA..._templates/config_rules
opa-ebs-attachment.yaml
opa-ebs-encryption.yaml
4:18 (31%)
4:18 (31%)
view
13 x 2 AWSSystemsManager/AWS-Or.../ssm-management-account
AWSSystemsManager/AWS-Or.../ssm-management-account
template.yaml
template.yaml
41:53 (3%)
141:153 (3%)
view
13 x 2 AWSSystemsManager/AWS-Or...sions/ssm-child-account
AWSSystemsManager/AWS-Or.../ssm-management-account
template.yaml
template.yaml
37:49 (9%)
41:53 (3%)
view
13 x 2 AWSSystemsManager/CentralizedPatchManagement
AWSSystemsManager/CentralizedPatchManagement
opsmgmt-central-account.yaml
opsmgmt-central-account.yaml
133:145 (2%)
478:490 (2%)
view
13 x 2 AWSSystemsManager/AWS-Or...sions/ssm-child-account
AWSSystemsManager/AWS-Or.../ssm-management-account
template.yaml
template.yaml
37:49 (9%)
141:153 (3%)
view
12 x 2 AWSSystemsManager/CentralizedPatchManagement
AWSSystemsManager/CentralizedPatchManagement
opsmgmt-operations-central-account.yaml
opsmgmt-operations-central-account.yaml
212:223 (4%)
232:243 (4%)
view
9 x 2 AWSConfig/AWS-Config-OPA...emplates/lambda_backend
AWSSystemsManager/CentralizedPatchManagement
opa-lambda.yaml
opsmgmt-central-account.yaml
37:45 (8%)
342:350 (2%)
view
9 x 2 AWSSystemsManager/AWS-Or.../ssm-management-account
AWSSystemsManager/AWS-Or.../ssm-management-account
template.yaml
template.yaml
62:70 (2%)
82:90 (2%)
view
8 x 2 AWSConfig/AWS-Config-OPA...emplates/lambda_backend
AWSLicenseManager/TrackLicenses_MultiRegion
opa-lambda.yaml
LM-MULTIREGION_LicenseTracking.yml
34:41 (7%)
30:37 (5%)
view