crowbar/crowbar-openstack

View on GitHub

Showing 748 of 748 total issues

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/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

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["vsphere"]["datacenter_path"] = ta["vsphere"]["datacenter_path"]
  a["vsphere"]["store_image_dir"] = ta["vsphere"]["store_image_dir"]
  return a, d
Severity: Major
Found in chef/data_bags/crowbar/migrate/glance/011_fix_vsphere.rb and 7 other locations - About 15 mins to fix
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
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.logs_search_internal_url(node)
    host = get_host_for_monitoring_url(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 97..102
chef/cookbooks/monasca/libraries/helper.rb on lines 105..110

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 451..453
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

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

def upgrade(template_attrs, template_deployment, attrs, deployment)
  if attrs["memcache_secret_key"].nil? || attrs["memcache_secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    attrs["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/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/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

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/update_endpoint.rb and 2 other locations - About 15 mins to fix
chef/cookbooks/keystone/recipes/server.rb on lines 308..310
chef/cookbooks/keystone/recipes/server.rb on lines 451..453

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"]["ca_file"] = ta["vcenter"]["ca_file"]
  a["vcenter"]["insecure"] = ta["vcenter"]["insecure"]
  return a, d
Severity: Major
Found in chef/data_bags/crowbar/migrate/nova/038_add_vmware_insecure.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/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/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/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

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/nova_service.rb and 1 other location - About 15 mins to fix
crowbar_framework/app/models/monasca_service.rb on lines 195..198

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/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["secret_key"].nil? || a["secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    a["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/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/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/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(template_attrs, template_deployment, attrs, deployment)
  if attrs["memcache_secret_key"].nil? || attrs["memcache_secret_key"].empty?
    service = ServiceObject.new "fake-logger"
    attrs["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/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/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/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 6 locations. Consider refactoring.
Open

  def self.logs_search_admin_url(node)
    host = monasca_admin_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 97..102
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 8 locations. Consider refactoring.
Open

def upgrade(ta, td, a, d)
  a["zvm"]["zvm_xcat_zhcp_nodename"] = ta["zvm"]["zvm_xcat_zhcp_nodename"]
  a["zvm"]["zvm_xcat_mgt_vswitch"] = ta["zvm"]["zvm_xcat_mgt_vswitch"]
  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/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 2 locations. Consider refactoring.
Open

  def self.internal_auth_url(node, admin_host)
    versioned_service_URL(node[:keystone][:api][:protocol],
                          admin_host,
                          node[:keystone][:api][:service_port],
                          node[:keystone][:api][:version])
Severity: Minor
Found in chef/cookbooks/keystone/libraries/helpers.rb and 1 other location - About 15 mins to fix
chef/cookbooks/keystone/libraries/helpers.rb on lines 17..21

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


execute "heat-manage db_sync" do
  user node[:heat][:user]
  group node[:heat][:group]
  command "heat-manage db_sync"
Severity: Minor
Found in chef/cookbooks/heat/recipes/server.rb and 2 other locations - About 15 mins to fix
chef/cookbooks/heat/recipes/server.rb on lines 404..408
chef/cookbooks/heat/recipes/server.rb on lines 414..418

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

def downgrade(template_attrs, template_deployment, attrs, deployment)
  attrs["ssl"] = template_attrs["ssl"] unless attrs.key?("ssl")
  attrs["api"] = template_attrs["api"] unless attrs.key?("api")
  return attrs, deployment
Severity: Minor
Found in chef/data_bags/crowbar/migrate/ceilometer/303_api_cleanup.rb and 2 other locations - About 15 mins to fix
chef/data_bags/crowbar/migrate/keystone/032_add_domain_specific_drivers.rb on lines 1..8
chef/data_bags/crowbar/migrate/neutron/046_infoblox.rb on lines 1..8

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

  supports status: true, restart: true
  action [:enable, :start]
  subscribes :restart, resources("template[/etc/heat/heat.conf.d/100-heat.conf]")
end
utils_systemd_service_restart "heat-engine" do
Severity: Minor
Found in chef/cookbooks/heat/recipes/server.rb and 2 other locations - About 15 mins to fix
chef/cookbooks/heat/recipes/server.rb on lines 385..389
chef/cookbooks/heat/recipes/server.rb on lines 404..408

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