crowbar/crowbar-openstack

View on GitHub

Showing 748 of 748 total issues

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

execute "update_dns_domain_for_fixed_network" do
  command "#{env} neutron #{neutron_insecure} net-update fixed --dns-domain #{domain_fixed}"
  not_if "#{openstack_cmd} network show fixed -f value -c dns_domain | grep -q #{domain_fixed}"
  retries 5
  retry_delay 10
Severity: Minor
Found in chef/cookbooks/neutron/recipes/post_install_conf.rb and 1 other location - About 20 mins to fix
chef/cookbooks/neutron/recipes/post_install_conf.rb on lines 229..235

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

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

action :add do
  unless Kernel::system("rabbitmqctl list_vhosts | grep -q #{new_resource.vhost}")
    Chef::Log.info "Adding RabbitMQ vhost '#{new_resource.vhost}'."
    execute "rabbitmqctl add_vhost #{new_resource.vhost}"
    new_resource.updated_by_last_action(true)
Severity: Minor
Found in chef/cookbooks/rabbitmq/providers/vhost.rb and 2 other locations - About 20 mins to fix
chef/cookbooks/rabbitmq/providers/user.rb on lines 36..40
chef/cookbooks/rabbitmq/providers/vhost.rb on lines 28..32

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

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

  def self.api_public_url(node)
    host = monasca_public_host(node)
    # SSL is not supported at this moment
    # protocol = node[:monasca][:api][:ssl] ? "https" : "http"
    protocol = "http"
Severity: Minor
Found in chef/cookbooks/monasca/libraries/helper.rb and 5 other locations - About 15 mins to fix
chef/cookbooks/monasca/libraries/helper.rb on lines 40..46
chef/cookbooks/monasca/libraries/helper.rb on lines 49..55
chef/cookbooks/monasca/libraries/helper.rb on lines 97..102
chef/cookbooks/monasca/libraries/helper.rb on lines 105..110
chef/cookbooks/monasca/libraries/helper.rb on lines 113..118

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

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

def upgrade(ta, td, a, d)
  if a["memcache_secret_key"].nil? || a["memcache_secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    a["memcache_secret_key"] = service.random_password
  end
chef/data_bags/crowbar/migrate/barbican/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ceilometer/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/cinder/202_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/glance/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/heat/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/horizon/200_add_dashboard_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ironic/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/magnum/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/manila/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/monasca/306_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/204_add_placement_password.rb on lines 1..7
chef/data_bags/crowbar/migrate/octavia/301_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/sahara/202_add_memcache_secret_key.rb on lines 1..6

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

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

def upgrade(ta, td, a, d)
  if a["placement_service_password"].nil? || a["placement_service_password"].empty?
    service = ServiceObject.new "fake-logger"
    a["placement_service_password"] = service.random_password
  end
chef/data_bags/crowbar/migrate/barbican/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ceilometer/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/cinder/202_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/glance/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/heat/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/horizon/200_add_dashboard_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ironic/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/magnum/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/manila/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/monasca/306_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/neutron/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/octavia/301_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/sahara/202_add_memcache_secret_key.rb on lines 1..6

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

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

def upgrade(ta, td, a, d)
  if a["memcache_secret_key"].nil? || a["memcache_secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    a["memcache_secret_key"] = service.random_password
  end
chef/data_bags/crowbar/migrate/barbican/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ceilometer/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/cinder/202_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/glance/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/heat/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/horizon/200_add_dashboard_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ironic/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/magnum/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/monasca/306_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/neutron/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/204_add_placement_password.rb on lines 1..7
chef/data_bags/crowbar/migrate/octavia/301_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/sahara/202_add_memcache_secret_key.rb on lines 1..6

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

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

def downgrade(template_attrs, template_deployment, attrs, deployment)
  attrs["sql"]["min_pool_size"] = template_attrs["sql"]["min_pool_size"]
  attrs["ovs"]["ovsdb_interface"] = template_attrs["ovs"]["ovsdb_interface"]
  return attrs, deployment
chef/data_bags/crowbar/migrate/glance/011_fix_vsphere.rb on lines 1..4
chef/data_bags/crowbar/migrate/keystone/022_pool_user_enabled_invert.rb on lines 1..4
chef/data_bags/crowbar/migrate/keystone/111_add_wsgi_params.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/003_remove_cisco_database.rb on lines 8..12
chef/data_bags/crowbar/migrate/neutron/048_zvm_add_zhcp_nodename.rb on lines 1..4
chef/data_bags/crowbar/migrate/nova/038_add_vmware_insecure.rb on lines 1..4
chef/data_bags/crowbar/migrate/nova/118_add_vmware_dvs_attrs.rb on lines 1..4

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

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

  def self.api_admin_url(node)
    host = monasca_admin_host(node)
    # SSL is not supported at this moment
    # protocol = node[:monasca][:api][:ssl] ? "https" : "http"
    protocol = "http"
Severity: Minor
Found in chef/cookbooks/monasca/libraries/helper.rb and 5 other locations - About 15 mins to fix
chef/cookbooks/monasca/libraries/helper.rb on lines 31..37
chef/cookbooks/monasca/libraries/helper.rb on lines 49..55
chef/cookbooks/monasca/libraries/helper.rb on lines 97..102
chef/cookbooks/monasca/libraries/helper.rb on lines 105..110
chef/cookbooks/monasca/libraries/helper.rb on lines 113..118

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

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

  def self.api_internal_url(node)
    host = get_host_for_monitoring_url(node)
    # SSL is not supported at this moment
    # protocol = node[:monasca][:api][:ssl] ? "https" : "http"
    protocol = "http"
Severity: Minor
Found in chef/cookbooks/monasca/libraries/helper.rb and 5 other locations - About 15 mins to fix
chef/cookbooks/monasca/libraries/helper.rb on lines 31..37
chef/cookbooks/monasca/libraries/helper.rb on lines 40..46
chef/cookbooks/monasca/libraries/helper.rb on lines 97..102
chef/cookbooks/monasca/libraries/helper.rb on lines 105..110
chef/cookbooks/monasca/libraries/helper.rb on lines 113..118

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

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

  def self.logs_search_public_url(node)
    host = monasca_public_host(node)
    # SSL is not supported at this moment
    protocol = "http"
    port = node[:monasca][:kibana][:bind_port]
Severity: Minor
Found in chef/cookbooks/monasca/libraries/helper.rb and 5 other locations - About 15 mins to fix
chef/cookbooks/monasca/libraries/helper.rb on lines 31..37
chef/cookbooks/monasca/libraries/helper.rb on lines 40..46
chef/cookbooks/monasca/libraries/helper.rb on lines 49..55
chef/cookbooks/monasca/libraries/helper.rb on lines 105..110
chef/cookbooks/monasca/libraries/helper.rb on lines 113..118

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

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

def upgrade(ta, td, a, d)
  if a["memcache_secret_key"].nil? || a["memcache_secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    a["memcache_secret_key"] = service.random_password
  end
chef/data_bags/crowbar/migrate/barbican/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/cinder/202_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/glance/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/heat/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/horizon/200_add_dashboard_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ironic/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/magnum/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/manila/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/monasca/306_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/neutron/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/204_add_placement_password.rb on lines 1..7
chef/data_bags/crowbar/migrate/octavia/301_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/sahara/202_add_memcache_secret_key.rb on lines 1..6

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

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

def upgrade(ta, td, a, d)
  a["vcenter"]["dvs_name"] = ta["vcenter"]["dvs_name"]
  a["vcenter"]["dvs_security_groups"] = ta["vcenter"]["dvs_security_groups"]
  return a, d
chef/data_bags/crowbar/migrate/glance/011_fix_vsphere.rb on lines 1..4
chef/data_bags/crowbar/migrate/keystone/022_pool_user_enabled_invert.rb on lines 1..4
chef/data_bags/crowbar/migrate/keystone/111_add_wsgi_params.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/003_remove_cisco_database.rb on lines 8..12
chef/data_bags/crowbar/migrate/neutron/048_zvm_add_zhcp_nodename.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/303_remove_rocky_deprecations.rb on lines 7..10
chef/data_bags/crowbar/migrate/nova/038_add_vmware_insecure.rb on lines 1..4

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

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

Identical blocks of code found in 3 locations. Consider refactoring.
Open

register_auth_hash = { user: node[:keystone][:admin][:username],
                       password: node[:keystone][:admin][:password],
                       project: node[:keystone][:admin][:project] }
Severity: Minor
Found in chef/cookbooks/keystone/recipes/server.rb and 2 other locations - About 15 mins to fix
chef/cookbooks/keystone/recipes/server.rb on lines 308..310
chef/cookbooks/keystone/recipes/update_endpoint.rb on lines 43..45

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

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

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

  def network_present?(network_name)
    net_svc = NetworkService.new @logger
    network_proposal = Proposal.find_by(barclamp: net_svc.bc_name, name: "default")
    !network_proposal["attributes"]["network"]["networks"][network_name].nil?
Severity: Minor
Found in crowbar_framework/app/models/monasca_service.rb and 1 other location - About 15 mins to fix
crowbar_framework/app/models/nova_service.rb on lines 592..595

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

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

def upgrade(ta, td, a, d)
  if a["memcache_secret_key"].nil? || a["memcache_secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    a["memcache_secret_key"] = service.random_password
  end
chef/data_bags/crowbar/migrate/barbican/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ceilometer/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/glance/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/heat/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/horizon/200_add_dashboard_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ironic/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/magnum/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/manila/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/monasca/306_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/neutron/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/204_add_placement_password.rb on lines 1..7
chef/data_bags/crowbar/migrate/octavia/301_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/sahara/202_add_memcache_secret_key.rb on lines 1..6

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

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

def upgrade(ta, td, a, d)
  if a["memcache_secret_key"].nil? || a["memcache_secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    a["memcache_secret_key"] = service.random_password
  end
chef/data_bags/crowbar/migrate/ceilometer/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/cinder/202_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/glance/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/heat/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/horizon/200_add_dashboard_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ironic/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/magnum/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/manila/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/monasca/306_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/neutron/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/204_add_placement_password.rb on lines 1..7
chef/data_bags/crowbar/migrate/octavia/301_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/sahara/202_add_memcache_secret_key.rb on lines 1..6

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

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

def downgrade ta, td, a, d
  a["db"]["cisco_database"] = ta["db"]["cisco_database"]
  a["db"]["cisco_user"] = ta["db"]["cisco_user"]
  # leave password empty, it's optional
  return a, d
chef/data_bags/crowbar/migrate/glance/011_fix_vsphere.rb on lines 1..4
chef/data_bags/crowbar/migrate/keystone/022_pool_user_enabled_invert.rb on lines 1..4
chef/data_bags/crowbar/migrate/keystone/111_add_wsgi_params.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/048_zvm_add_zhcp_nodename.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/303_remove_rocky_deprecations.rb on lines 7..10
chef/data_bags/crowbar/migrate/nova/038_add_vmware_insecure.rb on lines 1..4
chef/data_bags/crowbar/migrate/nova/118_add_vmware_dvs_attrs.rb on lines 1..4

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

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

def upgrade(ta, td, a, d)
  a["api"]["processes"] = ta["api"]["processes"]
  a["api"]["threads"] = ta["api"]["threads"]
  return a, d
Severity: Major
Found in chef/data_bags/crowbar/migrate/keystone/111_add_wsgi_params.rb and 7 other locations - About 15 mins to fix
chef/data_bags/crowbar/migrate/glance/011_fix_vsphere.rb on lines 1..4
chef/data_bags/crowbar/migrate/keystone/022_pool_user_enabled_invert.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/003_remove_cisco_database.rb on lines 8..12
chef/data_bags/crowbar/migrate/neutron/048_zvm_add_zhcp_nodename.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/303_remove_rocky_deprecations.rb on lines 7..10
chef/data_bags/crowbar/migrate/nova/038_add_vmware_insecure.rb on lines 1..4
chef/data_bags/crowbar/migrate/nova/118_add_vmware_dvs_attrs.rb on lines 1..4

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

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

def upgrade ta, td, a, d
  a["ldap"]["user_enabled_invert"] = ta["ldap"]["user_enabled_invert"]
  a["ldap"]["use_pool"] = ta["ldap"]["use_pool"]
  return a, d
chef/data_bags/crowbar/migrate/glance/011_fix_vsphere.rb on lines 1..4
chef/data_bags/crowbar/migrate/keystone/111_add_wsgi_params.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/003_remove_cisco_database.rb on lines 8..12
chef/data_bags/crowbar/migrate/neutron/048_zvm_add_zhcp_nodename.rb on lines 1..4
chef/data_bags/crowbar/migrate/neutron/303_remove_rocky_deprecations.rb on lines 7..10
chef/data_bags/crowbar/migrate/nova/038_add_vmware_insecure.rb on lines 1..4
chef/data_bags/crowbar/migrate/nova/118_add_vmware_dvs_attrs.rb on lines 1..4

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

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

def upgrade(ta, td, a, d)
  if a["memcache_secret_key"].nil? || a["memcache_secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    a["memcache_secret_key"] = service.random_password
  end
chef/data_bags/crowbar/migrate/barbican/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ceilometer/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/cinder/202_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/glance/201_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/horizon/200_add_dashboard_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/ironic/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/magnum/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/manila/200_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/monasca/306_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/neutron/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/203_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/nova/204_add_placement_password.rb on lines 1..7
chef/data_bags/crowbar/migrate/octavia/301_add_memcache_secret_key.rb on lines 1..6
chef/data_bags/crowbar/migrate/sahara/202_add_memcache_secret_key.rb on lines 1..6

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

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