aws-samples / aws-gateway-load-balancer-code-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
  • 79% duplication:
    • 8,380 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 6,664 duplicated lines
  • 902 duplicates
system79% (6,664 lines)
Duplication per Extension
yaml81% (6,399 lines)
py53% (265 lines)
Duplication per Component (primary)
aws-cloudformation/vpc_routing_enhancement_architectures/templates80% (1,897 lines)
aws-cloudformation/centralized_architecture/nested-stack81% (1,774 lines)
aws-cloudformation/centralized_architecture98% (1,738 lines)
aws-cloudformation/distributed_architecture67% (843 lines)
python/gwlb70% (233 lines)
aws-cloudformation/vpce51% (105 lines)
aws-cloudformation/gwlb31% (42 lines)
python/vpce19% (32 lines)

Duplication Between Components (50+ lines)

G aws-cloudformation/centralized_architecture aws-cloudformation/centralized_architecture aws-cloudformation/centralized_architecture/nested-stack aws-cloudformation/centralized_architecture/nested-stack aws-cloudformation/centralized_architecture--aws-cloudformation/centralized_architecture/nested-stack 3502 aws-cloudformation/distributed_architecture aws-cloudformation/distributed_architecture aws-cloudformation/centralized_architecture--aws-cloudformation/distributed_architecture 958 aws-cloudformation/vpc_routing_enhancement_architectures/templates aws-cloudformation/vpc_routing_enhancement_architectures/templates aws-cloudformation/centralized_architecture--aws-cloudformation/vpc_routing_enhancement_architectures/templates 1197 aws-cloudformation/vpce aws-cloudformation/vpce aws-cloudformation/centralized_architecture--aws-cloudformation/vpce 103 aws-cloudformation/gwlb aws-cloudformation/gwlb aws-cloudformation/centralized_architecture--aws-cloudformation/gwlb 56 aws-cloudformation/centralized_architecture/nested-stack--aws-cloudformation/distributed_architecture 988 aws-cloudformation/centralized_architecture/nested-stack--aws-cloudformation/vpc_routing_enhancement_architectures/templates 1246 aws-cloudformation/centralized_architecture/nested-stack--aws-cloudformation/vpce 101 aws-cloudformation/centralized_architecture/nested-stack--aws-cloudformation/gwlb 63 aws-cloudformation/distributed_architecture--aws-cloudformation/vpc_routing_enhancement_architectures/templates 1555 aws-cloudformation/distributed_architecture--aws-cloudformation/vpce 208 aws-cloudformation/distributed_architecture--aws-cloudformation/gwlb 68 aws-cloudformation/vpc_routing_enhancement_architectures/templates--aws-cloudformation/vpce 115 aws-cloudformation/gwlb--aws-cloudformation/vpc_routing_enhancement_architectures/templates 68 python/gwlb python/gwlb python/vpce python/vpce python/gwlb--python/vpce 62

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 902 duplicates...
Size#FoldersFilesLinesCode
559 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/centr...chitecture/nested-stack
CentralizedArchitectureApplianceVpc2A...
ApplianceVpc2Az.yaml
183:875 (61%)
183:875 (61%)
view
328 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/centr...chitecture/nested-stack
CentralizedArchitectureSpokeVpc2Az.yaml
SpokeVpc2Az.yaml
144:535 (71%)
144:535 (71%)
view
324 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/centr...chitecture/nested-stack
CentralizedArchitectureTgw.yaml
Tgw.yaml
8:355 (81%)
8:355 (81%)
view
242 x 2 aws-cloudformation/vpc_r...architectures/templates
aws-cloudformation/vpc_r...architectures/templates
EgressVpcNatGw.yaml
IngressVpcElb.yaml
189:472 (32%)
245:528 (26%)
view
171 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/centr...chitecture/nested-stack
CentralizedArchitectureApplianceVpc2A...
ApplianceVpc2Az.yaml
902:1101 (18%)
901:1100 (18%)
view
162 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/centr...chitecture/nested-stack
CentralizedArchitectureApplianceVpc2A...
ApplianceVpc2Az.yaml
13:180 (17%)
13:180 (17%)
view
148 x 2 aws-cloudformation/vpc_r...architectures/templates
aws-cloudformation/vpc_r...architectures/templates
EgressVpcNatGw.yaml
IngressVpcElb.yaml
629:809 (19%)
723:906 (16%)
view
75 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/centr...chitecture/nested-stack
CentralizedArchitectureTgw.yaml
Tgw.yaml
357:435 (18%)
356:434 (18%)
view
74 x 2 aws-cloudformation/distributed_architecture
aws-cloudformation/vpc_r...architectures/templates
DistributedArchitectureApplianceVpc2A...
InspectionVpc.yaml
137:210 (11%)
166:241 (10%)
view
58 x 2 aws-cloudformation/distributed_architecture
aws-cloudformation/vpce
DistributedArchitectureApplianceVpc2A...
GwlbVpcEndpointServiceSample.yaml
664:724 (9%)
94:153 (37%)
view
47 x 2 aws-cloudformation/vpc_r...architectures/templates
aws-cloudformation/vpc_r...architectures/templates
EgressVpcNatGw.yaml
IngressVpcElb.yaml
525:585 (6%)
617:677 (5%)
view
46 x 2 aws-cloudformation/vpc_r...architectures/templates
aws-cloudformation/vpc_r...architectures/templates
EgressVpcNatGw.yaml
IngressVpcElb.yaml
474:524 (6%)
564:614 (5%)
view
39 x 2 aws-cloudformation/distributed_architecture
aws-cloudformation/vpc_r...architectures/templates
DistributedArchitectureApplianceVpc2A...
InspectionVpc.yaml
417:459 (6%)
546:588 (5%)
view
37 x 2 aws-cloudformation/vpc_r...architectures/templates
aws-cloudformation/vpc_r...architectures/templates
EgressVpcNatGw.yaml
IngressVpcElb.yaml
149:187 (4%)
205:243 (4%)
view
36 x 2 aws-cloudformation/vpc_r...architectures/templates
aws-cloudformation/vpc_r...architectures/templates
InspectionVpc.yaml
InspectionVpc.yaml
616:668 (5%)
706:758 (5%)
view
36 x 2 aws-cloudformation/centr...chitecture/nested-stack
aws-cloudformation/distributed_architecture
ApplianceVpc2Az.yaml
DistributedArchitectureApplianceVpc2A...
617:670 (3%)
486:539 (5%)
view
36 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/distributed_architecture
CentralizedArchitectureApplianceVpc2A...
DistributedArchitectureApplianceVpc2A...
617:670 (3%)
486:539 (5%)
view
35 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/distributed_architecture
CentralizedArchitectureApplianceVpc2A...
DistributedArchitectureApplianceVpc2A...
617:668 (3%)
574:625 (5%)
view
35 x 2 aws-cloudformation/centr...chitecture/nested-stack
aws-cloudformation/distributed_architecture
ApplianceVpc2Az.yaml
DistributedArchitectureApplianceVpc2A...
617:668 (3%)
574:625 (5%)
view
35 x 2 aws-cloudformation/centralized_architecture
aws-cloudformation/centr...chitecture/nested-stack
CentralizedArchitectureApplianceVpc2A...
ApplianceVpc2Az.yaml
617:668 (3%)
710:761 (3%)
view
Duplicated Units
The list of top 4 duplicated units.
See data for all 4 unit duplicates...
Size#FoldersFilesLinesCode
36 x 2 python/gwlb
python/gwlb
create_gwlb_tg_listener_sample.py
create_tg_sample.py
0:0 
0:0 
view
23 x 2 python/gwlb
python/gwlb
create_gwlb_tg_listener_sample.py
create_listener_sample.py
0:0 
0:0 
view
24 x 2 python/gwlb
python/gwlb
create_gwlb_tg_listener_sample.py
register_targets_sample.py
0:0 
0:0 
view
14 x 2 python/gwlb
python/gwlb
delete_gwlb_tg_sample.py
delete_tg_sample.py
0:0 
0:0 
view