crowbar/crowbar-openstack

View on GitHub

Showing 748 of 748 total issues

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

keystone_register "register nova_legacy service" 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/nova/recipes/api.rb and 18 other locations - About 40 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 74..84
chef/cookbooks/cinder/recipes/api.rb on lines 88..98
chef/cookbooks/cinder/recipes/api.rb on lines 119..129
chef/cookbooks/cinder/recipes/api.rb on lines 150..160
chef/cookbooks/designate/recipes/api.rb on lines 85..95
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 123..133
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 152..162
chef/cookbooks/glance/recipes/api.rb on lines 148..158
chef/cookbooks/heat/recipes/server.rb on lines 245..255
chef/cookbooks/heat/recipes/server.rb on lines 274..284
chef/cookbooks/manila/recipes/api.rb on lines 80..90
chef/cookbooks/manila/recipes/api.rb on lines 112..122
chef/cookbooks/neutron/recipes/api_register.rb on lines 68..78
chef/cookbooks/nova/recipes/api.rb on lines 83..93
chef/cookbooks/nova/recipes/placement_api.rb on lines 69..79
chef/cookbooks/octavia/recipes/keystone.rb on lines 69..79
chef/cookbooks/sahara/recipes/api.rb on lines 73..83
chef/cookbooks/watcher/recipes/server.rb on lines 74..84

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

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

keystone_register "register watcher service" 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/server.rb and 18 other locations - About 40 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 74..84
chef/cookbooks/cinder/recipes/api.rb on lines 88..98
chef/cookbooks/cinder/recipes/api.rb on lines 119..129
chef/cookbooks/cinder/recipes/api.rb on lines 150..160
chef/cookbooks/designate/recipes/api.rb on lines 85..95
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 123..133
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 152..162
chef/cookbooks/glance/recipes/api.rb on lines 148..158
chef/cookbooks/heat/recipes/server.rb on lines 245..255
chef/cookbooks/heat/recipes/server.rb on lines 274..284
chef/cookbooks/manila/recipes/api.rb on lines 80..90
chef/cookbooks/manila/recipes/api.rb on lines 112..122
chef/cookbooks/neutron/recipes/api_register.rb on lines 68..78
chef/cookbooks/nova/recipes/api.rb on lines 83..93
chef/cookbooks/nova/recipes/api.rb on lines 96..106
chef/cookbooks/nova/recipes/placement_api.rb on lines 69..79
chef/cookbooks/octavia/recipes/keystone.rb on lines 69..79
chef/cookbooks/sahara/recipes/api.rb on lines 73..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 38.

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

keystone_register "register neutron service" 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 18 other locations - About 40 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 74..84
chef/cookbooks/cinder/recipes/api.rb on lines 88..98
chef/cookbooks/cinder/recipes/api.rb on lines 119..129
chef/cookbooks/cinder/recipes/api.rb on lines 150..160
chef/cookbooks/designate/recipes/api.rb on lines 85..95
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 123..133
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 152..162
chef/cookbooks/glance/recipes/api.rb on lines 148..158
chef/cookbooks/heat/recipes/server.rb on lines 245..255
chef/cookbooks/heat/recipes/server.rb on lines 274..284
chef/cookbooks/manila/recipes/api.rb on lines 80..90
chef/cookbooks/manila/recipes/api.rb on lines 112..122
chef/cookbooks/nova/recipes/api.rb on lines 83..93
chef/cookbooks/nova/recipes/api.rb on lines 96..106
chef/cookbooks/nova/recipes/placement_api.rb on lines 69..79
chef/cookbooks/octavia/recipes/keystone.rb on lines 69..79
chef/cookbooks/sahara/recipes/api.rb on lines 73..83
chef/cookbooks/watcher/recipes/server.rb on lines 74..84

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

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

    if node[:keystone][:frontend] == "apache"
      notifies :create, resources(ruby_block: "set origin for apache2 restart"), :immediately
      notifies :restart, resources(service: "apache2"), :immediately
    elsif node[:keystone][:frontend] == "uwsgi"
      notifies :restart, resources(service: "keystone-uwsgi"), :immediately
Severity: Minor
Found in chef/cookbooks/keystone/recipes/server.rb and 1 other location - About 40 mins to fix
chef/cookbooks/keystone/recipes/server.rb on lines 377..382

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

      if node[:keystone][:frontend] == "apache"
        notifies :create, resources(ruby_block: "set origin for apache2 restart"), :immediately
        notifies :restart, resources(service: "apache2"), :immediately
      elsif node[:keystone][:frontend] == "uwsgi"
        notifies :restart, resources(service: "keystone-uwsgi"), :immediately
Severity: Minor
Found in chef/cookbooks/keystone/recipes/server.rb and 1 other location - About 40 mins to fix
chef/cookbooks/keystone/recipes/server.rb on lines 341..346

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

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

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

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

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

Refactorings

Further Reading

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

def upgrade(ta, td, a, d)
  a["apic"]["optimized_metadata"] = ta["apic"]["optimized_metadata"] \
    unless a["apic"].key? "optimized_metadata"
  a["apic"]["optimized_dhcp"] = ta["apic"]["optimized_dhcp"] unless a["apic"].key? "optimized_dhcp"

chef/data_bags/crowbar/migrate/monasca/200_add_libvirt_plugin_settings.rb on lines 1..8
chef/data_bags/crowbar/migrate/neutron/107_add_ovs_interface_attributes.rb on lines 1..10

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

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

        node[:keystone][:endpoint] = {
          insecure: node[:keystone][:ssl][:insecure],
          protocol: node[:keystone][:api][:protocol],
          internal_url_host: node[:keystone][:api][:internal_url_host],
          port: node[:keystone][:api][:admin_port]
Severity: Minor
Found in crowbar_framework/app/models/keystone_service.rb and 1 other location - About 40 mins to fix
crowbar_framework/app/models/keystone_service.rb on lines 177..182

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

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

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

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

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

Refactorings

Further Reading

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

def upgrade(ta, td, a, d)
  a["agent"]["monitor_libvirt"] = ta["agent"]["monitor_libvirt"] unless
    a["agent"].key?("monitor_libvirt")

  a["agent"]["plugins"] = ta["agent"]["plugins"] unless
chef/data_bags/crowbar/migrate/neutron/107_add_ovs_interface_attributes.rb on lines 1..10
chef/data_bags/crowbar/migrate/neutron/206_add_apic_optimized_dhcp_metadata.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 38.

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

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

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

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

Refactorings

Further Reading

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

def upgrade(ta, td, a, d)
  unless a["ovs"].key? "of_interface"
    a["ovs"]["of_interface"] = ta["ovs"]["of_interface"]
  end

chef/data_bags/crowbar/migrate/monasca/200_add_libvirt_plugin_settings.rb on lines 1..8
chef/data_bags/crowbar/migrate/neutron/206_add_apic_optimized_dhcp_metadata.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 38.

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

      node[:keystone][:endpoint] = {
        insecure: node[:keystone][:ssl][:insecure],
        protocol: node[:keystone][:api][:protocol],
        internal_url_host: node[:keystone][:api][:internal_url_host],
        port: node[:keystone][:api][:admin_port]
Severity: Minor
Found in crowbar_framework/app/models/keystone_service.rb and 1 other location - About 40 mins to fix
crowbar_framework/app/models/keystone_service.rb on lines 158..163

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

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 "ADD"
                if server_version < "11.00.0000.00"
                  alter_statement = "EXEC sp_addsrvrolemember '#{@new_resource.username}', '#{sql_sys_role}'"
                else
                  alter_statement = "ALTER SERVER ROLE #{sql_role} #{role_action} MEMBER [#{@new_resource.username}]"
chef/cookbooks/database/libraries/provider_database_sql_server_user.rb on lines 127..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 38.

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

  ssl_setup "setting up ssl for magnum" do
    generate_certs node[:magnum][:ssl][:generate_certs]
    certfile node[:magnum][:ssl][:certfile]
    keyfile node[:magnum][:ssl][:keyfile]
    group node[:magnum][:group]
Severity: Minor
Found in chef/cookbooks/magnum/recipes/common.rb and 1 other location - About 40 mins to fix
chef/cookbooks/swift/recipes/proxy.rb on lines 275..280

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

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["placement_db"] = ta["placement_db"]

  if a["placement_db"]["password"].nil? || a["placement_db"]["password"].empty?
    service = ServiceObject.new "fake-logger"
Severity: Minor
Found in chef/data_bags/crowbar/migrate/nova/200_placement_api.rb and 1 other location - About 40 mins to fix
chef/data_bags/crowbar/migrate/nova/101_nova_api_db.rb on lines 1..9

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

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 RadosGW service" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  auth register_auth_hash
Severity: Minor
Found in chef/cookbooks/keystone/recipes/ses.rb and 1 other location - About 40 mins to fix
chef/cookbooks/swift/recipes/proxy.rb on lines 231..241

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

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 swift service" do
       protocol keystone_settings["protocol"]
       insecure keystone_settings["insecure"]
       host keystone_settings["internal_url_host"]
       auth register_auth_hash
Severity: Minor
Found in chef/cookbooks/swift/recipes/proxy.rb and 1 other location - About 40 mins to fix
chef/cookbooks/keystone/recipes/ses.rb on lines 29..39

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

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["api_db"] = ta["api_db"]

  if a["api_db"]["password"].nil? || a["api_db"]["password"].empty?
    service = ServiceObject.new "fake-logger"
Severity: Minor
Found in chef/data_bags/crowbar/migrate/nova/101_nova_api_db.rb and 1 other location - About 40 mins to fix
chef/data_bags/crowbar/migrate/nova/200_placement_api.rb on lines 1..9

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

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 "DROP"
                if server_version < "11.00.0000.00"
                  alter_statement = "EXEC sp_dropsrvrolemember '#{@new_resource.username}', '#{sql_sys_role}'"
                else
                  alter_statement = "ALTER SERVER ROLE #{sql_role} #{role_action} MEMBER [#{@new_resource.username}]"
chef/cookbooks/database/libraries/provider_database_sql_server_user.rb on lines 120..126

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

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

  ssl_setup "setting up ssl for swift" do
    generate_certs node[:swift][:ssl][:generate_certs]
    certfile node[:swift][:ssl][:certfile]
    keyfile node[:swift][:ssl][:keyfile]
    group node[:swift][:group]
Severity: Minor
Found in chef/cookbooks/swift/recipes/proxy.rb and 1 other location - About 40 mins to fix
chef/cookbooks/magnum/recipes/common.rb on lines 46..51

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

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

Consider simplifying this complex logical expression.
Open

if CrowbarPacemakerHelper.cluster_nodes(node).size > 2 && !node_upgrading
  template "/usr/bin/rabbitmq-alert-handler.sh" do
    source "rabbitmq-alert-handler.erb"
    owner "root"
    group "root"
Severity: Major
Found in chef/cookbooks/rabbitmq/recipes/ha_cluster.rb - About 40 mins to fix

Consider simplifying this complex logical expression.
Open

unless node[:database][:database_bootstrapped]
  database_user "create db_maker database user" do
    connection db_connection
    username "db_maker"
    password node[:database][:db_maker_password]
Severity: Major
Found in chef/cookbooks/mysql/recipes/server.rb - About 40 mins to fix
Severity
Category
Status
Source
Language