crowbar/crowbar-openstack

View on GitHub

Showing 511 of 748 total issues

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

keystone_register "register designate endpoint" 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/designate/recipes/api.rb and 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register cinder endpoint" 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/cinder/recipes/api.rb and 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register cinder endpoint v3" 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/cinder/recipes/api.rb and 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register nova_legacy endpoint" 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 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register nova endpoint" 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 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register sahara endpoint" 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/sahara/recipes/api.rb and 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94

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

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

keystone_register "register neutron endpoint" 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 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register manila endpoint" 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 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register magnum endpoint" 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/magnum/recipes/api.rb and 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register manila endpoint v2" 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 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 132..147
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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

keystone_register "register cinder endpoint v2" 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/cinder/recipes/api.rb and 11 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 101..116
chef/cookbooks/cinder/recipes/api.rb on lines 163..178
chef/cookbooks/designate/recipes/api.rb on lines 98..110
chef/cookbooks/magnum/recipes/api.rb on lines 86..101
chef/cookbooks/manila/recipes/api.rb on lines 93..108
chef/cookbooks/manila/recipes/api.rb on lines 125..140
chef/cookbooks/neutron/recipes/api_register.rb on lines 81..93
chef/cookbooks/nova/recipes/api.rb on lines 109..124
chef/cookbooks/nova/recipes/api.rb on lines 127..142
chef/cookbooks/octavia/recipes/keystone.rb on lines 82..94
chef/cookbooks/sahara/recipes/api.rb on lines 86..98

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

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 apply_role_pre_chef_call(_old_role, role, all_nodes)
    @logger.debug("Barbican apply_role_pre_chef_call: "\
                  "entering #{all_nodes.inspect}")

    server_elements,
Severity: Major
Found in crowbar_framework/app/models/barbican_service.rb and 2 other locations - About 1 hr to fix
crowbar_framework/app/models/magnum_service.rb on lines 109..133
crowbar_framework/app/models/monasca_service.rb on lines 164..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 70.

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 apply_role_pre_chef_call(_old_role, role, all_nodes)
    @logger.debug("Monasca apply_role_pre_chef_call: "\
                  "entering #{all_nodes.inspect}")

    server_elements,
Severity: Major
Found in crowbar_framework/app/models/monasca_service.rb and 2 other locations - About 1 hr to fix
crowbar_framework/app/models/barbican_service.rb on lines 90..118
crowbar_framework/app/models/magnum_service.rb on lines 109..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 70.

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 apply_role_pre_chef_call(old_role, role, all_nodes)
    @logger.debug("Magnum apply_role_pre_chef_call: entering #{all_nodes.inspect}")

    server_elements, server_nodes, ha_enabled = role_expand_elements(role, "magnum-server")
    reset_sync_marks_on_clusters_founders(server_elements)
Severity: Major
Found in crowbar_framework/app/models/magnum_service.rb and 2 other locations - About 1 hr to fix
crowbar_framework/app/models/barbican_service.rb on lines 90..118
crowbar_framework/app/models/monasca_service.rb on lines 164..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 70.

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(template_attrs, template_deployment, attrs, deployment)
  attrs["elasticsearch"]["tunables"]["limit_nproc"] =
    attrs["elasticsearch"]["tunables"]["max_procs"]
  attrs["elasticsearch"]["tunables"]["limit_nofile"] =
    attrs["elasticsearch"]["tunables"]["max_open_files_hard_limit"]
chef/data_bags/crowbar/migrate/monasca/304_rename_elastic_params.rb on lines 14..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 69.

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(template_attrs, template_deployment, attrs, deployment)
  attrs["elasticsearch"]["tunables"]["max_procs"] =
    attrs["elasticsearch"]["tunables"]["limit_nproc"]
  attrs["elasticsearch"]["tunables"]["max_open_files_hard_limit"] =
    attrs["elasticsearch"]["tunables"]["limit_nofile"]
chef/data_bags/crowbar/migrate/monasca/304_rename_elastic_params.rb on lines 1..11

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

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

keystone_register "register placement endpoint" 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/placement_api.rb and 4 other locations - About 1 hr to fix
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 136..148
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 165..177
chef/cookbooks/glance/recipes/api.rb on lines 161..173
chef/cookbooks/watcher/recipes/server.rb on lines 87..99

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

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

keystone_register "register watcher endpoint" 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 4 other locations - About 1 hr to fix
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 136..148
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 165..177
chef/cookbooks/glance/recipes/api.rb on lines 161..173
chef/cookbooks/nova/recipes/placement_api.rb on lines 82..94

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

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

keystone_register "register glance endpoint" 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/glance/recipes/api.rb and 4 other locations - About 1 hr to fix
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 136..148
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 165..177
chef/cookbooks/nova/recipes/placement_api.rb on lines 82..94
chef/cookbooks/watcher/recipes/server.rb on lines 87..99

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

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

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

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

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

Refactorings

Further Reading

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

        def client
          client_options = {
            host: new_resource.connection[:host],
            socket: new_resource.connection[:socket],
            username: new_resource.connection[:username],
chef/cookbooks/database/libraries/provider_database_mysql_user.rb on lines 143..160

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

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