crowbar/crowbar-openstack

View on GitHub

Showing 748 of 748 total issues

Method validate_dvr has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def validate_dvr(proposal)
    plugin = proposal["attributes"]["neutron"]["networking_plugin"]
    ml2_mechanism_drivers = proposal["attributes"]["neutron"]["ml2_mechanism_drivers"]
    ml2_type_drivers = proposal["attributes"]["neutron"]["ml2_type_drivers"]

Severity: Minor
Found in crowbar_framework/app/models/neutron_service.rb - About 55 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 upgrade has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def upgrade(ta, td, a, d)
  # update shares
  a["shares"].each do |share|
    next if share["backend_driver"] != "generic"
    unless share["generic"].key? "service_instance_password"
Severity: Minor
Found in chef/data_bags/crowbar/migrate/manila/014_generic_required_keys.rb - About 55 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 upgrade has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def upgrade(template_attrs, template_deployment, attrs, deployment)
  unless attrs["volume_defaults"]["rbd"].key? "use_ses"
    attrs["volume_defaults"]["rbd"]["use_ses"] = template_attrs["volume_defaults"]["rbd"]["use_ses"]
  end
  attrs["volumes"].each do |backend|
Severity: Minor
Found in chef/data_bags/crowbar/migrate/cinder/303_add_use_ses.rb - About 55 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 set_boot_kernel_and_trigger_reboot has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.set_boot_kernel_and_trigger_reboot(node, flavor = "default")
    # only default and xen flavor is supported by this helper right now
    if node[:platform] == "suse" && node[:platform_version].to_f < 12.0
      set_boot_kernel_grub1(flavor)
    else
Severity: Minor
Found in chef/cookbooks/nova/libraries/boot_kernel.rb - About 55 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 insecure has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def insecure(barclamp, role)
        attributes = role.default_attributes[barclamp]

        use_ssl = if attributes.key?("api") && attributes["api"].key?("protocol")
          # cinder, glance, heat, keystone, manila, neutron
Severity: Minor
Found in crowbar_framework/lib/openstack/data_bag_config.rb - About 55 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

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

  %w{container account object}.each do |ring|
    execute "pull #{ring} ring" do
      user node[:swift][:user]
      group node[:swift][:group]
      command "rsync #{node[:swift][:user]}@#{compute_node_addr}::ring/#{ring}.ring.gz ."
Severity: Minor
Found in chef/cookbooks/swift/recipes/storage.rb and 1 other location - About 55 mins to fix
chef/cookbooks/swift/recipes/proxy.rb on lines 306..312

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

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 "glance-api" do
  address network_settings[:api][:ha_bind_host]
  port network_settings[:api][:ha_bind_port]
  use_ssl (node[:glance][:api][:protocol] == "https")
  servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "glance", "glance-server", "api")
Severity: Major
Found in chef/cookbooks/glance/recipes/ha.rb and 2 other locations - About 55 mins to fix
chef/cookbooks/octavia/recipes/api_ha.rb on lines 12..19
chef/cookbooks/watcher/recipes/ha.rb on lines 28..35

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

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

  connection db_settings[:connection]
  database_name node[:barbican][:db][:database]
  username node[:barbican][:db][:user]
  password node[:barbican][:db][:password]
  host "%"
Severity: Minor
Found in chef/cookbooks/barbican/recipes/common.rb and 1 other location - About 55 mins to fix
chef/cookbooks/horizon/recipes/server.rb on lines 333..340

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

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

keystone_register "register logs endpoint" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Minor
Found in chef/cookbooks/monasca/recipes/server.rb and 1 other location - About 55 mins to fix
chef/cookbooks/monasca/recipes/server.rb on lines 121..133

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

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

keystone_register "register logs_v2 endpoint" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Minor
Found in chef/cookbooks/monasca/recipes/server.rb and 1 other location - About 55 mins to fix
chef/cookbooks/monasca/recipes/server.rb on lines 95..107

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

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 "watcher-api" do
  address network_settings[:api][:ha_bind_host]
  port network_settings[:api][:ha_bind_port]
  use_ssl (node[:watcher][:api][:protocol] == "https")
  servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "watcher", "watcher-server", "api")
Severity: Major
Found in chef/cookbooks/watcher/recipes/ha.rb and 2 other locations - About 55 mins to fix
chef/cookbooks/glance/recipes/ha.rb on lines 27..34
chef/cookbooks/octavia/recipes/api_ha.rb on lines 12..19

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 45.

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 "octavia-api" do
  address network_settings[:api][:ha_bind_host]
  port network_settings[:api][:ha_bind_port]
  use_ssl node[:octavia][:api][:protocol] == "https"
  servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "octavia", "octavia-api", "api")
Severity: Major
Found in chef/cookbooks/octavia/recipes/api_ha.rb and 2 other locations - About 55 mins to fix
chef/cookbooks/glance/recipes/ha.rb on lines 27..34
chef/cookbooks/watcher/recipes/ha.rb on lines 28..35

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

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

  %w{container account object}.each { |ring|
    execute "pull #{ring} ring" do
      user node[:swift][:user]
      group node[:swift][:group]
      command "rsync #{node[:swift][:user]}@#{compute_node_addr}::ring/#{ring}.ring.gz ."
Severity: Minor
Found in chef/cookbooks/swift/recipes/proxy.rb and 1 other location - About 55 mins to fix
chef/cookbooks/swift/recipes/storage.rb on lines 77..83

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

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

    connection db_settings[:connection]
    database_name node[:horizon][:db][:database]
    username node[:horizon][:db][:user]
    password node[:horizon][:db][:password]
    host "%"
Severity: Minor
Found in chef/cookbooks/horizon/recipes/server.rb and 1 other location - About 55 mins to fix
chef/cookbooks/barbican/recipes/common.rb on lines 67..74

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

keystone_register "register heat user" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 13 other locations - About 55 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 103..113
chef/cookbooks/cinder/recipes/api.rb on lines 62..72
chef/cookbooks/designate/recipes/api.rb on lines 59..69
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 96..106
chef/cookbooks/glance/recipes/common.rb on lines 94..104
chef/cookbooks/magnum/recipes/api.rb on lines 48..58
chef/cookbooks/manila/recipes/api.rb on lines 54..64
chef/cookbooks/neutron/recipes/api_register.rb on lines 42..52
chef/cookbooks/nova/recipes/api.rb on lines 57..67
chef/cookbooks/octavia/recipes/keystone.rb on lines 43..53
chef/cookbooks/sahara/recipes/api.rb on lines 47..57
chef/cookbooks/swift/recipes/proxy.rb on lines 205..215
chef/cookbooks/watcher/recipes/common.rb on lines 93..103

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

keystone_register "register neutron user" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/neutron/recipes/api_register.rb and 13 other locations - About 55 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 103..113
chef/cookbooks/cinder/recipes/api.rb on lines 62..72
chef/cookbooks/designate/recipes/api.rb on lines 59..69
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 96..106
chef/cookbooks/glance/recipes/common.rb on lines 94..104
chef/cookbooks/heat/recipes/server.rb on lines 135..145
chef/cookbooks/magnum/recipes/api.rb on lines 48..58
chef/cookbooks/manila/recipes/api.rb on lines 54..64
chef/cookbooks/nova/recipes/api.rb on lines 57..67
chef/cookbooks/octavia/recipes/keystone.rb on lines 43..53
chef/cookbooks/sahara/recipes/api.rb on lines 47..57
chef/cookbooks/swift/recipes/proxy.rb on lines 205..215
chef/cookbooks/watcher/recipes/common.rb on lines 93..103

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def upgrade ta, td, a, d
  a["networking_backend"] = "neutron" if a["networking_backend"] == "quantum"
  if a["quantum_metadata_proxy_shared_secret"]
    a["neutron_metadata_proxy_shared_secret"] = a["quantum_metadata_proxy_shared_secret"]
    a.delete "quantum_metadata_proxy_shared_secret"
Severity: Minor
Found in chef/data_bags/crowbar/migrate/nova/002_neutron_rename.rb and 1 other location - About 55 mins to fix
chef/data_bags/crowbar/migrate/nova/002_neutron_rename.rb on lines 16..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

def downgrade ta, td, a, d
  a["networking_backend"] = "quantum" if a["networking_backend"] == "neutron"
  if a["neutron_metadata_proxy_shared_secret"]
    a["quantum_metadata_proxy_shared_secret"] = a["neutron_metadata_proxy_shared_secret"]
    a.delete "neutron_metadata_proxy_shared_secret"
Severity: Minor
Found in chef/data_bags/crowbar/migrate/nova/002_neutron_rename.rb and 1 other location - About 55 mins to fix
chef/data_bags/crowbar/migrate/nova/002_neutron_rename.rb on lines 2..13

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

keystone_register "register manila user" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/manila/recipes/api.rb and 13 other locations - About 55 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 103..113
chef/cookbooks/cinder/recipes/api.rb on lines 62..72
chef/cookbooks/designate/recipes/api.rb on lines 59..69
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 96..106
chef/cookbooks/glance/recipes/common.rb on lines 94..104
chef/cookbooks/heat/recipes/server.rb on lines 135..145
chef/cookbooks/magnum/recipes/api.rb on lines 48..58
chef/cookbooks/neutron/recipes/api_register.rb on lines 42..52
chef/cookbooks/nova/recipes/api.rb on lines 57..67
chef/cookbooks/octavia/recipes/keystone.rb on lines 43..53
chef/cookbooks/sahara/recipes/api.rb on lines 47..57
chef/cookbooks/swift/recipes/proxy.rb on lines 205..215
chef/cookbooks/watcher/recipes/common.rb on lines 93..103

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

keystone_register "register watcher user" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/watcher/recipes/common.rb and 13 other locations - About 55 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 103..113
chef/cookbooks/cinder/recipes/api.rb on lines 62..72
chef/cookbooks/designate/recipes/api.rb on lines 59..69
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 96..106
chef/cookbooks/glance/recipes/common.rb on lines 94..104
chef/cookbooks/heat/recipes/server.rb on lines 135..145
chef/cookbooks/magnum/recipes/api.rb on lines 48..58
chef/cookbooks/manila/recipes/api.rb on lines 54..64
chef/cookbooks/neutron/recipes/api_register.rb on lines 42..52
chef/cookbooks/nova/recipes/api.rb on lines 57..67
chef/cookbooks/octavia/recipes/keystone.rb on lines 43..53
chef/cookbooks/sahara/recipes/api.rb on lines 47..57
chef/cookbooks/swift/recipes/proxy.rb on lines 205..215

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language