crowbar/crowbar-openstack

View on GitHub

Showing 511 of 748 total issues

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

    swift_db["dispersion_reports"].each do |dr|
      raise ServiceError, I18n.t("barclamp.#{@bc_name}.run.duplicate") if dr["node"] == node and dr["status"] == "running"
    end
Severity: Minor
Found in crowbar_framework/app/models/swift_service.rb and 1 other location - About 15 mins to fix
crowbar_framework/app/models/tempest_service.rb on lines 201..203

Duplicated Code

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

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

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

Tuning

This issue has a mass of 26.

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

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

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

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

Refactorings

Further Reading

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

monitor_url = "#{node[:glance][:api][:protocol]}://#{network_settings[:api][:bind_host]}:" \
              "#{network_settings[:api][:bind_port]}/"
Severity: Minor
Found in chef/cookbooks/glance/recipes/monitor_monasca.rb and 3 other locations - About 15 mins to fix
chef/cookbooks/designate/recipes/monitor_monasca.rb on lines 22..23
chef/cookbooks/sahara/recipes/monitor_monasca.rb on lines 22..23
chef/cookbooks/watcher/recipes/monitor_monasca.rb on lines 22..23

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

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

monitor_url = "#{node[:watcher][:api][:protocol]}://#{network_settings[:api][:bind_host]}:" \
              "#{network_settings[:api][:bind_port]}/"
Severity: Minor
Found in chef/cookbooks/watcher/recipes/monitor_monasca.rb and 3 other locations - About 15 mins to fix
chef/cookbooks/designate/recipes/monitor_monasca.rb on lines 22..23
chef/cookbooks/glance/recipes/monitor_monasca.rb on lines 22..23
chef/cookbooks/sahara/recipes/monitor_monasca.rb on lines 22..23

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

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

monitor_url = "#{node[:sahara][:api][:protocol]}://#{network_settings[:api][:bind_host]}:" \
              "#{network_settings[:api][:bind_port]}/"
Severity: Minor
Found in chef/cookbooks/sahara/recipes/monitor_monasca.rb and 3 other locations - About 15 mins to fix
chef/cookbooks/designate/recipes/monitor_monasca.rb on lines 22..23
chef/cookbooks/glance/recipes/monitor_monasca.rb on lines 22..23
chef/cookbooks/watcher/recipes/monitor_monasca.rb on lines 22..23

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

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

monitor_url = "#{node[:designate][:api][:protocol]}://#{network_settings[:api][:bind_host]}:" \
              "#{network_settings[:api][:bind_port]}/"
Severity: Minor
Found in chef/cookbooks/designate/recipes/monitor_monasca.rb and 3 other locations - About 15 mins to fix
chef/cookbooks/glance/recipes/monitor_monasca.rb on lines 22..23
chef/cookbooks/sahara/recipes/monitor_monasca.rb on lines 22..23
chef/cookbooks/watcher/recipes/monitor_monasca.rb on lines 22..23

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

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

    { "built_by" => new_resource.built_by,
      "dimensions" => new_resource.dimensions,
      "match_pattern" => new_resource.match_pattern,
      "timeout" => new_resource.timeout,
      "name" => new_resource.name,
Severity: Minor
Found in chef/cookbooks/monasca/providers/agent_plugin_http_check.rb and 1 other location - About 15 mins to fix
chef/cookbooks/monasca/providers/agent_plugin_ovs.rb on lines 21..29

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

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

        rbd_non_ses_ceph_conf ||= !volume["rbd"]["use_ses"] && \
          !volume["rbd"]["use_crowbar"] && \
          (volume["rbd"]["config_file"].strip == "/etc/ceph/ceph.conf")

        if volume["rbd"]["use_crowbar"] && volume["rbd"]["use_ses"]
Severity: Minor
Found in crowbar_framework/app/models/cinder_service.rb and 1 other location - About 15 mins to fix
crowbar_framework/app/models/cinder_service.rb on lines 147..151

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

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

        rbd_non_crowbar_ceph_conf ||= !volume["rbd"]["use_crowbar"] && \
          !volume["rbd"]["use_ses"] && \
          (volume["rbd"]["config_file"].strip == "/etc/ceph/ceph.conf")

        rbd_ses ||= volume["rbd"]["use_ses"]
Severity: Minor
Found in crowbar_framework/app/models/cinder_service.rb and 1 other location - About 15 mins to fix
crowbar_framework/app/models/cinder_service.rb on lines 152..156

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

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

  config = {
    "username" => new_resource.username,
    "user_domain_name" => new_resource.user_domain_name,
    "password" => new_resource.password,
    "project_name" => new_resource.project_name,
Severity: Minor
Found in chef/cookbooks/monasca/providers/agent_plugin_ovs.rb and 1 other location - About 15 mins to fix
chef/cookbooks/monasca/providers/agent_plugin_http_check.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 25.

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

  default[:cinder][:ha][:api_ra] = "systemd:cinder-api"
  default[:cinder][:ha][:scheduler_ra] = "systemd:cinder-scheduler"
  default[:cinder][:ha][:volume_ra] = "systemd:cinder-volume"
Severity: Minor
Found in chef/cookbooks/cinder/attributes/default.rb and 1 other location - About 15 mins to fix
chef/cookbooks/cinder/attributes/default.rb on lines 46..48

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

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

  default[:cinder][:ha][:api_ra] = "systemd:openstack-cinder-api"
  default[:cinder][:ha][:scheduler_ra] = "systemd:openstack-cinder-scheduler"
  default[:cinder][:ha][:volume_ra] = "systemd:openstack-cinder-volume"
Severity: Minor
Found in chef/cookbooks/cinder/attributes/default.rb and 1 other location - About 15 mins to fix
chef/cookbooks/cinder/attributes/default.rb on lines 50..52

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

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