crowbar/crowbar-openstack

View on GitHub

Showing 748 of 748 total issues

Method node_is_remote_ha? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def node_is_remote_ha?(node, new_role)
    new_role.override_attributes[@bc_name]["elements"].each do |role_name, elements|
      next unless role_name =~ /^nova-compute-/
      elements.each do |element|
        if is_remotes?(element)
Severity: Minor
Found in crowbar_framework/app/models/nova_service.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method validate_proposal_after_save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def validate_proposal_after_save(proposal)
    validate_one_for_role proposal, "horizon-server"

    if proposal["attributes"][@bc_name]["multi_domain_support"]
      ks_svc = KeystoneService.new @logger
Severity: Minor
Found in crowbar_framework/app/models/horizon_service.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

haproxy_loadbalancer "ec2-metadata" do
  address "0.0.0.0"
  port node[:nova][:ports][:ec2_metadata]
  use_ssl node[:nova]["ec2-api"][:ssl][:enabled]
  servers CrowbarPacemakerHelper.haproxy_servers_for_service(
Severity: Minor
Found in chef/cookbooks/ec2-api/recipes/ec2api_ha.rb and 2 other locations - About 35 mins to fix
chef/cookbooks/ec2-api/recipes/ec2api_ha.rb on lines 18..26
chef/cookbooks/ec2-api/recipes/ec2api_ha.rb on lines 38..46

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

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

haproxy_loadbalancer "ec2-s3" do
  address "0.0.0.0"
  port node[:nova][:ports][:ec2_s3]
  use_ssl node[:nova]["ec2-api"][:ssl][:enabled]
  servers CrowbarPacemakerHelper.haproxy_servers_for_service(
Severity: Minor
Found in chef/cookbooks/ec2-api/recipes/ec2api_ha.rb and 2 other locations - About 35 mins to fix
chef/cookbooks/ec2-api/recipes/ec2api_ha.rb on lines 18..26
chef/cookbooks/ec2-api/recipes/ec2api_ha.rb on lines 28..36

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

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

haproxy_loadbalancer "ec2-api" do
  address "0.0.0.0"
  port node[:nova][:ports][:ec2_api]
  use_ssl node[:nova]["ec2-api"][:ssl][:enabled]
  servers CrowbarPacemakerHelper.haproxy_servers_for_service(
Severity: Minor
Found in chef/cookbooks/ec2-api/recipes/ec2api_ha.rb and 2 other locations - About 35 mins to fix
chef/cookbooks/ec2-api/recipes/ec2api_ha.rb on lines 28..36
chef/cookbooks/ec2-api/recipes/ec2api_ha.rb on lines 38..46

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

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

bash "upload_ironic_deploy_kernel_image" do
  code "#{openstack_cmd} #{openstack_args_glance} image create \
  --disk-format aki --container-format aki --public \
  --file #{image_path}/vmlinux #{kernel_image_prefix}-#{image_version_cmd}"
  not_if "#{openstack_cmd} #{openstack_args_glance} image list -f value -c Name | grep -q #{kernel_image_prefix}-#{image_version_cmd}"
Severity: Minor
Found in chef/cookbooks/ironic/recipes/post_install.rb and 1 other location - About 35 mins to fix
chef/cookbooks/ironic/recipes/post_install.rb on lines 52..56

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

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

  service "nova-serialproxy" do
    service_name "openstack-nova-serialproxy" if ["rhel", "suse"].include?(node[:platform_family])
    supports status: true, restart: true
    action [:enable, :start]
    subscribes :restart, resources(template: node[:nova][:config_file]), :delayed
Severity: Minor
Found in chef/cookbooks/nova/recipes/vncproxy.rb and 1 other location - About 35 mins to fix
chef/cookbooks/nova/recipes/vncproxy.rb on lines 38..43

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

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

  when volume[:backend_driver] == "emc"
    template "/etc/cinder/cinder_emc_config-#{backend_id}.xml" do
      source "cinder_emc_config.xml.erb"
      owner "root"
      group node[:cinder][:group]
Severity: Minor
Found in chef/cookbooks/cinder/recipes/volume.rb and 1 other location - About 35 mins to fix
chef/cookbooks/cinder/recipes/volume.rb on lines 224..233

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

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.get_public_listen_address(node)
    if node[:rabbitmq][:ha][:enabled] && !node[:rabbitmq][:cluster]
      vhostname = get_ha_vhostname(node)
      CrowbarPacemakerHelper.cluster_vip(node, "public", vhostname)
    else
Severity: Minor
Found in chef/cookbooks/rabbitmq/libraries/crowbar.rb and 1 other location - About 35 mins to fix
chef/cookbooks/rabbitmq/libraries/crowbar.rb on lines 10..16

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

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.get_listen_address(node)
    if node[:rabbitmq][:ha][:enabled] && !node[:rabbitmq][:cluster]
      vhostname = get_ha_vhostname(node)
      CrowbarPacemakerHelper.cluster_vip(node, "admin", vhostname)
    else
Severity: Minor
Found in chef/cookbooks/rabbitmq/libraries/crowbar.rb and 1 other location - About 35 mins to fix
chef/cookbooks/rabbitmq/libraries/crowbar.rb on lines 19..25

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

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

  when volume[:backend_driver] == "eternus"
    template "/etc/cinder/cinder_eternus_dx_config-#{backend_id}.xml" do
      source "cinder_eternus_dx_config.xml.erb"
      owner "root"
      group node[:cinder][:group]
Severity: Minor
Found in chef/cookbooks/cinder/recipes/volume.rb and 1 other location - About 35 mins to fix
chef/cookbooks/cinder/recipes/volume.rb on lines 183..192

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

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

  service "nova-novncproxy" do
    service_name "openstack-nova-novncproxy" if %w(rhel suse).include?(node[:platform_family])
    supports status: true, restart: true
    action [:enable, :start]
    subscribes :restart, resources(template: node[:nova][:config_file]), :delayed
Severity: Minor
Found in chef/cookbooks/nova/recipes/vncproxy.rb and 1 other location - About 35 mins to fix
chef/cookbooks/nova/recipes/vncproxy.rb on lines 53..58

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

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

end

bash "upload_ironic_deploy_ramdisk_image" do
  code "#{openstack_cmd} #{openstack_args_glance} image create \
  --disk-format ari --container-format ari --public \
Severity: Minor
Found in chef/cookbooks/ironic/recipes/post_install.rb and 1 other location - About 35 mins to fix
chef/cookbooks/ironic/recipes/post_install.rb on lines 46..50

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

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

haproxy_loadbalancer "heat-api" do
  address "0.0.0.0"
  port node[:heat][:api][:port]
  use_ssl (node[:heat][:api][:protocol] == "https")
  servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "heat", "heat-server", "api_port")
Severity: Minor
Found in chef/cookbooks/heat/recipes/ha.rb and 1 other location - About 35 mins to fix
chef/cookbooks/heat/recipes/ha.rb on lines 26..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 35.

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

haproxy_loadbalancer "heat-api-cfn" do
  address "0.0.0.0"
  port node[:heat][:api][:cfn_port]
  use_ssl (node[:heat][:api][:protocol] == "https")
  servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "heat", "heat-server", "cfn_port")
Severity: Minor
Found in chef/cookbooks/heat/recipes/ha.rb and 1 other location - About 35 mins to fix
chef/cookbooks/heat/recipes/ha.rb on lines 18..24

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

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

if node.attribute?(:cookbook) and node[:cookbook] == "nova"
  neutrons = node_search_with_cache("roles:neutron-server", node[:nova][:neutron_instance])
  neutron = neutrons.first || raise("Neutron instance '#{node[:nova][:neutron_instance]}' for nova not found")
else
  neutron = node
Severity: Minor
Found in chef/cookbooks/neutron/recipes/common_config.rb and 2 other locations - About 35 mins to fix
chef/cookbooks/neutron/recipes/cisco_apic_agents.rb on lines 18..23
chef/cookbooks/neutron/recipes/vmware_support.rb on lines 17..22

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

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

keystone_register "add heat stack user role" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 9 other locations - About 35 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 129..137
chef/cookbooks/barbican/recipes/api.rb on lines 153..161
chef/cookbooks/barbican/recipes/api.rb on lines 177..185
chef/cookbooks/barbican/recipes/api.rb on lines 201..209
chef/cookbooks/octavia/recipes/keystone.rb on lines 97..105
chef/cookbooks/octavia/recipes/keystone.rb on lines 108..116
chef/cookbooks/octavia/recipes/keystone.rb on lines 119..127
chef/cookbooks/octavia/recipes/keystone.rb on lines 130..138
chef/cookbooks/octavia/recipes/keystone.rb on lines 141..149

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

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

keystone_register "add creator role for barbican" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/barbican/recipes/api.rb and 9 other locations - About 35 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 129..137
chef/cookbooks/barbican/recipes/api.rb on lines 177..185
chef/cookbooks/barbican/recipes/api.rb on lines 201..209
chef/cookbooks/heat/recipes/server.rb on lines 161..169
chef/cookbooks/octavia/recipes/keystone.rb on lines 97..105
chef/cookbooks/octavia/recipes/keystone.rb on lines 108..116
chef/cookbooks/octavia/recipes/keystone.rb on lines 119..127
chef/cookbooks/octavia/recipes/keystone.rb on lines 130..138
chef/cookbooks/octavia/recipes/keystone.rb on lines 141..149

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

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

keystone_register "add audit role for barbican" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/barbican/recipes/api.rb and 9 other locations - About 35 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 129..137
chef/cookbooks/barbican/recipes/api.rb on lines 153..161
chef/cookbooks/barbican/recipes/api.rb on lines 177..185
chef/cookbooks/heat/recipes/server.rb on lines 161..169
chef/cookbooks/octavia/recipes/keystone.rb on lines 97..105
chef/cookbooks/octavia/recipes/keystone.rb on lines 108..116
chef/cookbooks/octavia/recipes/keystone.rb on lines 119..127
chef/cookbooks/octavia/recipes/keystone.rb on lines 130..138
chef/cookbooks/octavia/recipes/keystone.rb on lines 141..149

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

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

keystone_register "add load-balancer_observer role for octavia" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/octavia/recipes/keystone.rb and 9 other locations - About 35 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 129..137
chef/cookbooks/barbican/recipes/api.rb on lines 153..161
chef/cookbooks/barbican/recipes/api.rb on lines 177..185
chef/cookbooks/barbican/recipes/api.rb on lines 201..209
chef/cookbooks/heat/recipes/server.rb on lines 161..169
chef/cookbooks/octavia/recipes/keystone.rb on lines 108..116
chef/cookbooks/octavia/recipes/keystone.rb on lines 119..127
chef/cookbooks/octavia/recipes/keystone.rb on lines 130..138
chef/cookbooks/octavia/recipes/keystone.rb on lines 141..149

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

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