aws-samples / aws-continuous-compliance-for-terraform
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
  • 48% duplication:
    • 1,929 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 940 duplicated lines
  • 60 duplicates
system48% (940 lines)
Duplication per Extension
py61% (807 lines)
yml36% (69 lines)
tf14% (64 lines)
Duplication per Component (primary)
workload-account/stacks/pipeline_stack60% (388 lines)
security-and-compliance-account/stacks/pipeline_stack63% (305 lines)
workload-account/workload-code/src14% (64 lines)
workload-account/workload-code78% (52 lines)
workload-account/stacks/cross_account_role_stack85% (34 lines)
security-and-compliance-account/stacks/cross_account_role_stack77% (34 lines)
workload-account51% (23 lines)
security-and-compliance-account51% (23 lines)
security-and-compliance-account/security-and-compliance-code13% (17 lines)
workload-account/stacks0% (0 lines)
security-and-compliance-account/stacks0% (0 lines)

Duplication Between Components (50+ lines)

G security-and-compliance-account/stacks/pipeline_stack security-and-compliance-account/stacks/pipeline_stack workload-account/stacks/pipeline_stack workload-account/stacks/pipeline_stack security-and-compliance-account/stacks/pipeline_stack--workload-account/stacks/pipeline_stack 626 security-and-compliance-account/stacks/cross_account_role_stack security-and-compliance-account/stacks/cross_account_role_stack workload-account/stacks/cross_account_role_stack workload-account/stacks/cross_account_role_stack security-and-compliance-account/stacks/cross_account_role_stack--workload-account/stacks/cross_account_role_stack 68

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 60 duplicates...
Size#FoldersFilesLinesCode
77 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
104:182 (16%)
121:199 (11%)
view
64 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
284:352 (13%)
446:514 (9%)
view
27 x 2 security-and-compliance-...ross_account_role_stack
workload-account/stacks/cross_account_role_stack
cdk_stack.py
cdk_stack.py
52:83 (61%)
46:77 (67%)
view
19 x 2 workload-account/workload-code
workload-account/workload-code
buildspec-compliance.yml
buildspec-workload-deploy.yml
16:36 (48%)
16:36 (70%)
view
17 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
304:320 (3%)
532:548 (2%)
view
17 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
433:453 (3%)
626:646 (2%)
view
17 x 2 workload-account/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
466:482 (2%)
532:548 (2%)
view
16 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
358:373 (3%)
560:575 (2%)
view
16 x 2 security-and-compliance-account
workload-account
setup.py
setup.py
23:45 (55%)
23:45 (55%)
view
15 x 2 workload-account/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
653:667 (2%)
683:697 (2%)
view
15 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
191:209 (3%)
216:234 (2%)
view
14 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
65:78 (2%)
101:114 (2%)
view
14 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
248:261 (2%)
333:346 (2%)
view
14 x 2 security-and-compliance-...t/stacks/pipeline_stack
security-and-compliance-...t/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
330:343 (2%)
356:369 (2%)
view
14 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
356:369 (2%)
492:505 (2%)
view
13 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
237:249 (2%)
301:313 (2%)
view
12 x 2 workload-account/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
70:81 (1%)
103:114 (1%)
view
12 x 2 workload-account/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
452:463 (1%)
518:529 (1%)
view
12 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
332:343 (2%)
560:571 (1%)
view
12 x 2 security-and-compliance-...t/stacks/pipeline_stack
workload-account/stacks/pipeline_stack
cdk_stack.py
cdk_stack.py
290:301 (2%)
518:529 (1%)
view