crowbar/crowbar-openstack

View on GitHub
chef/cookbooks/ec2-api/recipes/ec2api.rb

Summary

Maintainability
B
6 hrs
Test Coverage

Similar blocks of code found in 5 locations. Consider refactoring.
Open

keystone_register "register ec2-metadata endpoint" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/ec2-api/recipes/ec2api.rb and 4 other locations - About 1 hr to fix
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 136..148
chef/cookbooks/glance/recipes/api.rb on lines 161..173
chef/cookbooks/nova/recipes/placement_api.rb on lines 82..94
chef/cookbooks/watcher/recipes/server.rb on lines 87..99

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 5 locations. Consider refactoring.
Open

keystone_register "register ec2-api endpoint" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/ec2-api/recipes/ec2api.rb and 4 other locations - About 1 hr to fix
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 165..177
chef/cookbooks/glance/recipes/api.rb on lines 161..173
chef/cookbooks/nova/recipes/placement_api.rb on lines 82..94
chef/cookbooks/watcher/recipes/server.rb on lines 87..99

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 68.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

keystone_register "register ec2 user" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/ec2-api/recipes/ec2api.rb and 13 other locations - About 55 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 103..113
chef/cookbooks/cinder/recipes/api.rb on lines 62..72
chef/cookbooks/designate/recipes/api.rb on lines 59..69
chef/cookbooks/glance/recipes/common.rb on lines 94..104
chef/cookbooks/heat/recipes/server.rb on lines 135..145
chef/cookbooks/magnum/recipes/api.rb on lines 48..58
chef/cookbooks/manila/recipes/api.rb on lines 54..64
chef/cookbooks/neutron/recipes/api_register.rb on lines 42..52
chef/cookbooks/nova/recipes/api.rb on lines 57..67
chef/cookbooks/octavia/recipes/keystone.rb on lines 43..53
chef/cookbooks/sahara/recipes/api.rb on lines 47..57
chef/cookbooks/swift/recipes/proxy.rb on lines 205..215
chef/cookbooks/watcher/recipes/common.rb on lines 93..103

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 18 locations. Consider refactoring.
Open

keystone_register "give ec2 user access" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/ec2-api/recipes/ec2api.rb and 17 other locations - About 50 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 116..126
chef/cookbooks/barbican/recipes/api.rb on lines 140..150
chef/cookbooks/barbican/recipes/api.rb on lines 164..174
chef/cookbooks/barbican/recipes/api.rb on lines 188..198
chef/cookbooks/barbican/recipes/api.rb on lines 212..222
chef/cookbooks/cinder/recipes/api.rb on lines 75..85
chef/cookbooks/designate/recipes/api.rb on lines 72..82
chef/cookbooks/glance/recipes/common.rb on lines 107..117
chef/cookbooks/heat/recipes/server.rb on lines 148..158
chef/cookbooks/magnum/recipes/api.rb on lines 61..71
chef/cookbooks/manila/recipes/api.rb on lines 67..77
chef/cookbooks/neutron/recipes/api_register.rb on lines 55..65
chef/cookbooks/nova/recipes/api.rb on lines 70..80
chef/cookbooks/octavia/recipes/keystone.rb on lines 56..66
chef/cookbooks/sahara/recipes/api.rb on lines 60..70
chef/cookbooks/swift/recipes/proxy.rb on lines 218..228
chef/cookbooks/watcher/recipes/common.rb on lines 106..116

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

keystone_register "register ec2-metadata service" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/ec2-api/recipes/ec2api.rb and 18 other locations - About 40 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 74..84
chef/cookbooks/cinder/recipes/api.rb on lines 88..98
chef/cookbooks/cinder/recipes/api.rb on lines 119..129
chef/cookbooks/cinder/recipes/api.rb on lines 150..160
chef/cookbooks/designate/recipes/api.rb on lines 85..95
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 123..133
chef/cookbooks/glance/recipes/api.rb on lines 148..158
chef/cookbooks/heat/recipes/server.rb on lines 245..255
chef/cookbooks/heat/recipes/server.rb on lines 274..284
chef/cookbooks/manila/recipes/api.rb on lines 80..90
chef/cookbooks/manila/recipes/api.rb on lines 112..122
chef/cookbooks/neutron/recipes/api_register.rb on lines 68..78
chef/cookbooks/nova/recipes/api.rb on lines 83..93
chef/cookbooks/nova/recipes/api.rb on lines 96..106
chef/cookbooks/nova/recipes/placement_api.rb on lines 69..79
chef/cookbooks/octavia/recipes/keystone.rb on lines 69..79
chef/cookbooks/sahara/recipes/api.rb on lines 73..83
chef/cookbooks/watcher/recipes/server.rb on lines 74..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 19 locations. Consider refactoring.
Open

keystone_register "register ec2-api service" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/ec2-api/recipes/ec2api.rb and 18 other locations - About 40 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 74..84
chef/cookbooks/cinder/recipes/api.rb on lines 88..98
chef/cookbooks/cinder/recipes/api.rb on lines 119..129
chef/cookbooks/cinder/recipes/api.rb on lines 150..160
chef/cookbooks/designate/recipes/api.rb on lines 85..95
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 152..162
chef/cookbooks/glance/recipes/api.rb on lines 148..158
chef/cookbooks/heat/recipes/server.rb on lines 245..255
chef/cookbooks/heat/recipes/server.rb on lines 274..284
chef/cookbooks/manila/recipes/api.rb on lines 80..90
chef/cookbooks/manila/recipes/api.rb on lines 112..122
chef/cookbooks/neutron/recipes/api_register.rb on lines 68..78
chef/cookbooks/nova/recipes/api.rb on lines 83..93
chef/cookbooks/nova/recipes/api.rb on lines 96..106
chef/cookbooks/nova/recipes/placement_api.rb on lines 69..79
chef/cookbooks/octavia/recipes/keystone.rb on lines 69..79
chef/cookbooks/sahara/recipes/api.rb on lines 73..83
chef/cookbooks/watcher/recipes/server.rb on lines 74..84

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 38.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

There are no issues that match your filters.

Category
Status