crowbar/crowbar-openstack

View on GitHub
chef/cookbooks/watcher/recipes/common.rb

Summary

Maintainability
B
5 hrs
Test Coverage

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

database_user "grant database access for watcher database user" do
  connection db_settings[:connection]
  username node[:watcher][:db][:user]
  password node[:watcher][:db][:password]
  database_name node[:watcher][:db][:database]
Severity: Major
Found in chef/cookbooks/watcher/recipes/common.rb and 8 other locations - About 1 hr to fix
chef/cookbooks/ceilometer/recipes/server.rb on lines 60..70
chef/cookbooks/cinder/recipes/sql.rb on lines 51..61
chef/cookbooks/designate/recipes/sql.rb on lines 47..57
chef/cookbooks/glance/recipes/common.rb on lines 53..63
chef/cookbooks/heat/recipes/server.rb on lines 45..55
chef/cookbooks/keystone/recipes/server.rb on lines 278..288
chef/cookbooks/manila/recipes/sql.rb on lines 34..44
chef/cookbooks/sahara/recipes/sql.rb on lines 47..57

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 60.

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 watcher 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/watcher/recipes/common.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/ec2-api/recipes/ec2api.rb on lines 96..106
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

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 watcher 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/watcher/recipes/common.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/ec2-api/recipes/ec2api.rb on lines 109..119
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

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 8 locations. Consider refactoring.
Open

database_user "create watcher database user" do
  host "%"
  connection db_settings[:connection]
  username node[:watcher][:db][:user]
  password node[:watcher][:db][:password]
Severity: Major
Found in chef/cookbooks/watcher/recipes/common.rb and 7 other locations - About 45 mins to fix
chef/cookbooks/ceilometer/recipes/server.rb on lines 50..57
chef/cookbooks/cinder/recipes/sql.rb on lines 41..48
chef/cookbooks/designate/recipes/sql.rb on lines 37..44
chef/cookbooks/glance/recipes/common.rb on lines 43..50
chef/cookbooks/heat/recipes/server.rb on lines 35..42
chef/cookbooks/manila/recipes/sql.rb on lines 24..31
chef/cookbooks/sahara/recipes/sql.rb on lines 37..44

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 40.

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 11 locations. Consider refactoring.
Open

database "create #{node[:watcher][:db][:database]} database" do
  connection db_settings[:connection]
  database_name node[:watcher][:db][:database]
  provider db_settings[:provider]
  action :create
Severity: Major
Found in chef/cookbooks/watcher/recipes/common.rb and 10 other locations - About 45 mins to fix
chef/cookbooks/barbican/recipes/common.rb on lines 58..63
chef/cookbooks/ceilometer/recipes/server.rb on lines 42..47
chef/cookbooks/cinder/recipes/sql.rb on lines 33..38
chef/cookbooks/designate/recipes/sql.rb on lines 29..34
chef/cookbooks/glance/recipes/common.rb on lines 35..40
chef/cookbooks/heat/recipes/server.rb on lines 27..32
chef/cookbooks/horizon/recipes/server.rb on lines 324..329
chef/cookbooks/keystone/recipes/server.rb on lines 260..265
chef/cookbooks/manila/recipes/sql.rb on lines 16..21
chef/cookbooks/sahara/recipes/sql.rb on lines 29..34

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 39.

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 "watcher wakeup keystone" 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/watcher/recipes/common.rb and 13 other locations - About 30 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 63..70
chef/cookbooks/ceilometer/recipes/server.rb on lines 114..121
chef/cookbooks/cinder/recipes/api.rb on lines 52..59
chef/cookbooks/designate/recipes/api.rb on lines 49..56
chef/cookbooks/glance/recipes/common.rb on lines 84..91
chef/cookbooks/heat/recipes/server.rb on lines 125..132
chef/cookbooks/magnum/recipes/api.rb on lines 38..45
chef/cookbooks/manila/recipes/api.rb on lines 44..51
chef/cookbooks/neutron/recipes/api_register.rb on lines 32..39
chef/cookbooks/nova/recipes/api.rb on lines 47..54
chef/cookbooks/octavia/recipes/keystone.rb on lines 33..40
chef/cookbooks/sahara/recipes/api.rb on lines 37..44
chef/cookbooks/swift/recipes/proxy.rb on lines 182..189

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 32.

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