aws-samples / aws-shield-advanced-rapid-deployment
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
  • 46% duplication:
    • 5,067 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 2,350 duplicated lines
  • 452 duplicates
system46% (2,350 lines)
Duplication per Extension
yaml52% (1,774 lines)
py34% (576 lines)
Duplication per Component (primary)
route5360% (1,072 lines)
fms59% (723 lines)
utility32% (235 lines)
kinesis57% (134 lines)
athena14% (72 lines)
shield18% (61 lines)
sns19% (36 lines)
iam28% (9 lines)
config25% (8 lines)
s30% (0 lines)
scripts0% (0 lines)

Duplication Between Components (50+ lines)

G fms fms route53 route53 fms--route53 463 shield shield fms--shield 243 sns sns fms--sns 65 route53--shield 135 athena athena athena--fms 178 athena--route53 80 athena--shield 62 athena--sns 74

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 452 duplicates...
Size#FoldersFilesLinesCode
56 x 2 code/route53/healthChecks
code/route53/healthChecks
alb-health-check.yaml
cf-health-check.yaml
88:144 (18%)
54:110 (20%)
view
41 x 2 code/route53/healthChecks
code/route53/healthChecks
eip-health-check.yaml
nlb-health-check.yaml
63:103 (18%)
73:113 (15%)
view
30 x 2 code/route53/healthChecks
code/route53/healthChecks
alb-health-check.yaml
nlb-health-check.yaml
77:106 (10%)
44:73 (11%)
view
29 x 2 code/fms/fms-policy-shield-protect-cloudfront/cfn
code/fms/fms-policy-shield-protect-regional/cfn
fms-shield-security-policy-cloudfront...
fms-shield-security-policy-regional.yaml
37:65 (24%)
44:72 (29%)
view
28 x 2 code/kinesis/cfn
code/kinesis/cfn
kinesis-firehose-delivery-stream.yaml
kinesis-firehose-iam-role.yaml
106:133 (20%)
39:66 (29%)
view
28 x 2 code/route53/healthChecks
code/route53/healthChecks
alb-health-check.yaml
cf-health-check.yaml
9:36 (9%)
8:35 (10%)
view
26 x 2 code/fms/fms-mimic-shiel...e53-hosted-zones/lambda
code/route53/route53-ass...hield-protection/lambda
cfnresponse.py
cfnresponse.py
6:39 (100%)
6:39 (100%)
view
26 x 2 code/fms/fms-mimic-shiel...obal-accelerator/lambda
code/route53/route53-ass...hield-protection/lambda
cfnresponse.py
cfnresponse.py
6:39 (100%)
6:39 (100%)
view
26 x 2 code/fms/fms-policy-waf-generator/lambda
code/route53/route53-ass...hield-protection/lambda
cfnresponse.py
cfnresponse.py
6:39 (100%)
6:39 (100%)
view
26 x 2 code/fms/fms-mimic-shiel...e53-hosted-zones/lambda
code/fms/fms-policy-waf-generator/lambda
cfnresponse.py
cfnresponse.py
6:39 (100%)
6:39 (100%)
view
26 x 2 code/fms/fms-mimic-shiel...obal-accelerator/lambda
code/fms/fms-mimic-shiel...e53-hosted-zones/lambda
cfnresponse.py
cfnresponse.py
6:39 (100%)
6:39 (100%)
view
26 x 2 code/fms/fms-mimic-shiel...obal-accelerator/lambda
code/fms/fms-policy-waf-generator/lambda
cfnresponse.py
cfnresponse.py
6:39 (100%)
6:39 (100%)
view
25 x 2 code/fms/fms-mimic-shiel...e53-hosted-zones/lambda
code/route53/cloudfront-...lambda/check-compliance
tag_check.py
tag_check.py
3:33 (100%)
3:33 (100%)
view
25 x 2 code/route53/healthChecks
code/route53/healthChecks
alb-health-check.yaml
nlb-health-check.yaml
146:170 (8%)
115:139 (9%)
view
25 x 2 code/fms/fms-policy-shield-protect-cloudfront/cfn
code/fms/fms-policy-waf-regional/cfn
fms-shield-security-policy-cloudfront...
fms-waf-security-policy-regional.yaml
41:65 (21%)
66:90 (16%)
view
25 x 2 code/fms/fms-policy-shield-protect-regional/cfn
code/fms/fms-policy-waf-regional/cfn
fms-shield-security-policy-regional.yaml
fms-waf-security-policy-regional.yaml
48:72 (25%)
66:90 (16%)
view
25 x 2 code/fms/fms-mimic-shiel...obal-accelerator/lambda
code/route53/cloudfront-...lambda/check-compliance
tag_check.py
tag_check.py
3:33 (100%)
3:33 (100%)
view
25 x 2 code/route53/healthChecks
code/route53/healthChecks
eip-health-check.yaml
nlb-health-check.yaml
105:129 (11%)
115:139 (9%)
view
25 x 2 code/route53/healthChecks
code/route53/healthChecks
alb-health-check.yaml
eip-health-check.yaml
146:170 (8%)
105:129 (11%)
view
25 x 2 code/fms/fms-mimic-shiel...obal-accelerator/lambda
code/fms/fms-mimic-shiel...e53-hosted-zones/lambda
tag_check.py
tag_check.py
3:33 (100%)
3:33 (100%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
30 x 3 code/fms/fms-mimic-shiel...obal-accelerator/lambda
code/fms/fms-mimic-shiel...e53-hosted-zones/lambda
code/route53/cloudfront-...lambda/check-compliance
tag_check.py
tag_check.py
tag_check.py
0:0 
0:0 
0:0 
view
22 x 4 code/fms/fms-policy-waf-generator/lambda
code/fms/fms-mimic-shiel...obal-accelerator/lambda
code/fms/fms-mimic-shiel...e53-hosted-zones/lambda
code/route53/route53-ass...hield-protection/lambda
cfnresponse.py
cfnresponse.py
cfnresponse.py
cfnresponse.py
0:0 
0:0 
0:0 
0:0 
view
20 x 2 code/fms/enableConfigure/lambda
code/shield/enableConfigure/lambda
cfnresponse.py
cfnresponse.py
0:0 
0:0 
view
10 x 2 code/utility
code/utility
get_fms_waf_policy.py
generate_waf_logs.py
0:0 
0:0 
view