crowbar/crowbar-openstack

View on GitHub

Showing 511 of 748 total issues

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

  CiscoPorts.prototype.writeJson = function(key, value, type) {
    return $(this.options.storage).writeJsonAttribute(
      '{0}/{1}'.format(
        this.options.path,
        key
crowbar_framework/app/assets/javascripts/barclamps/neutron/application.js on lines 206..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 65.

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

def upgrade(ta, td, a, d)
  d["element_states"] = td["element_states"]
  d["element_order"] = td["element_order"]
  d["element_run_list_order"] = td["element_run_list_order"]

chef/data_bags/crowbar/migrate/ceilometer/103_remove_hyperv.rb on lines 1..19
chef/data_bags/crowbar/migrate/nova/113_remove_hyperv.rb on lines 1..19

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

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

def upgrade(template_attrs, template_deployment, attrs, deployment)
  deployment["element_states"] = template_deployment["element_states"]
  deployment["element_order"] = template_deployment["element_order"]
  deployment["element_run_list_order"] = template_deployment["element_run_list_order"]

chef/data_bags/crowbar/migrate/nova/302_remove_xen.rb on lines 1..17

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

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

def upgrade(ta, td, a, d)
  d["element_states"] = td["element_states"]
  d["element_order"] = td["element_order"]
  d["element_run_list_order"] = td["element_run_list_order"]

chef/data_bags/crowbar/migrate/nova/111_remove_nova_docker.rb on lines 1..19
chef/data_bags/crowbar/migrate/nova/113_remove_hyperv.rb on lines 1..19

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

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

def upgrade(template_attrs, template_deployment, attrs, deployment)
  deployment["element_states"] = template_deployment["element_states"]
  deployment["element_order"] = template_deployment["element_order"]
  deployment["element_run_list_order"] = template_deployment["element_run_list_order"]

Severity: Major
Found in chef/data_bags/crowbar/migrate/nova/302_remove_xen.rb and 1 other location - About 1 hr to fix
chef/data_bags/crowbar/migrate/monasca/312_remove_monasca_master_role.rb on lines 1..17

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

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

def upgrade(ta, td, a, d)
  d["element_states"] = td["element_states"]
  d["element_order"] = td["element_order"]
  d["element_run_list_order"] = td["element_run_list_order"]

Severity: Major
Found in chef/data_bags/crowbar/migrate/nova/113_remove_hyperv.rb and 2 other locations - About 1 hr to fix
chef/data_bags/crowbar/migrate/ceilometer/103_remove_hyperv.rb on lines 1..19
chef/data_bags/crowbar/migrate/nova/111_remove_nova_docker.rb on lines 1..19

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

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

database_user "grant database access for sahara database user" do
  connection db_settings[:connection]
  username node[:sahara][:db][:user]
  password node[:sahara][:db][:password]
  database_name node[:sahara][:db][:database]
Severity: Major
Found in chef/cookbooks/sahara/recipes/sql.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/watcher/recipes/common.rb on lines 52..62

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

database_user "grant database access for designate database user" do
  connection db_settings[:connection]
  username node[:designate][:db][:user]
  password node[:designate][:db][:password]
  database_name node[:designate][:db][:database]
Severity: Major
Found in chef/cookbooks/designate/recipes/sql.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/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
chef/cookbooks/watcher/recipes/common.rb on lines 52..62

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

    db_synced = node[:neutron][:db_synced_apic_ml2]
    is_founder = CrowbarPacemakerHelper.is_cluster_founder?(node)
    execute "apic-ml2-db-manage upgrade head" do
      user node[:neutron][:user]
      group node[:neutron][:group]
Severity: Major
Found in chef/cookbooks/neutron/recipes/server.rb and 1 other location - About 1 hr to fix
chef/cookbooks/neutron/recipes/server.rb on lines 366..382

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

database_user "grant database access for ceilometer database user" do
  connection db_settings[:connection]
  username node[:ceilometer][:db][:user]
  password node[:ceilometer][:db][:password]
  database_name node[:ceilometer][:db][:database]
Severity: Major
Found in chef/cookbooks/ceilometer/recipes/server.rb and 8 other locations - About 1 hr to fix
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
chef/cookbooks/watcher/recipes/common.rb on lines 52..62

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

database_user "grant database access for glance database user" do
  connection db_settings[:connection]
  username node[:glance][:db][:user]
  password node[:glance][:db][:password]
  database_name node[:glance][:db][:database]
Severity: Major
Found in chef/cookbooks/glance/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/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
chef/cookbooks/watcher/recipes/common.rb on lines 52..62

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

database_user "grant database access for heat database user" do
  connection db_settings[:connection]
  username node[:heat][:db][:user]
  password node[:heat][:db][:password]
  database_name node[:heat][:db][:database]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.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/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
chef/cookbooks/watcher/recipes/common.rb on lines 52..62

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

database_user "grant database access for keystone database user" do
    connection db_settings[:connection]
    username node[:keystone][:db][:user]
    password node[:keystone][:db][:password]
    database_name node[:keystone][:db][:database]
Severity: Major
Found in chef/cookbooks/keystone/recipes/server.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/manila/recipes/sql.rb on lines 34..44
chef/cookbooks/sahara/recipes/sql.rb on lines 47..57
chef/cookbooks/watcher/recipes/common.rb on lines 52..62

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

    external_networks.each do |net|
      next if node[:crowbar_wall][:network][:nets][net].nil?
      next unless neutron[:neutron][:use_dvr] ||
          node.roles.include?("neutron-network") || net == "octavia"
      ext_iface = node[:crowbar_wall][:network][:nets][net].last
Severity: Major
Found in chef/cookbooks/neutron/recipes/common_agent.rb and 1 other location - About 1 hr to fix
chef/cookbooks/neutron/recipes/common_agent.rb on lines 219..225

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

    external_networks.each do |net|
      next if node[:crowbar_wall][:network][:nets][net].nil?
      next unless neutron[:neutron][:use_dvr] ||
          node.roles.include?("neutron-network") || net == "octavia"
      ext_iface = node[:crowbar_wall][:network][:nets][net].last
Severity: Major
Found in chef/cookbooks/neutron/recipes/common_agent.rb and 1 other location - About 1 hr to fix
chef/cookbooks/neutron/recipes/common_agent.rb on lines 187..196

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

database_user "grant database access for cinder database user" do
    connection db_settings[:connection]
    username node[:cinder][:db][:user]
    password node[:cinder][:db][:password]
    database_name node[:cinder][:db][:database]
Severity: Major
Found in chef/cookbooks/cinder/recipes/sql.rb and 8 other locations - About 1 hr to fix
chef/cookbooks/ceilometer/recipes/server.rb on lines 60..70
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
chef/cookbooks/watcher/recipes/common.rb on lines 52..62

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

database_user "grant database access for manila database user" do
  connection db_settings[:connection]
  username node[:manila][:db][:user]
  password node[:manila][:db][:password]
  database_name node[:manila][:db][:database]
Severity: Major
Found in chef/cookbooks/manila/recipes/sql.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/sahara/recipes/sql.rb on lines 47..57
chef/cookbooks/watcher/recipes/common.rb on lines 52..62

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

    db_synced = node[:neutron][:db_synced_apic_gbp]
    is_founder = CrowbarPacemakerHelper.is_cluster_founder?(node)
    execute "gbp-db-manage upgrade head" do
      user node[:neutron][:user]
      group node[:neutron][:group]
Severity: Major
Found in chef/cookbooks/neutron/recipes/server.rb and 1 other location - About 1 hr to fix
chef/cookbooks/neutron/recipes/server.rb on lines 347..363

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

def upgrade(ta, td, a, d)
  # new defaults
  a["volume_defaults"]["eqlx"]["ssh_conn_timeout"] = \
    ta["volume_defaults"]["eqlx"]["ssh_conn_timeout"]
  a["volume_defaults"]["eqlx"].delete "eqlx_cli_timeout"
chef/data_bags/crowbar/migrate/cinder/015_rename_vmware_volume_folder.rb on lines 20..30

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

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

Severity
Category
Status
Source
Language