crowbar/crowbar-openstack

View on GitHub

Showing 511 of 748 total issues

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

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

keystone_register "register ec2-api 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/ec2-api/recipes/ec2api.rb and 4 other locations - About 1 hr to fix
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
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.rb on lines 76..93

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

def downgrade(ta, td, a, d)
  d["element_states"] = td["element_states"]
  d["element_order"] = td["element_order"]
  d["element_run_list_order"] = td["element_run_list_order"]

chef/data_bags/crowbar/migrate/ceilometer/023_rename_ceilometer_cagent_role.rb on lines 1..20
chef/data_bags/crowbar/migrate/ceilometer/023_rename_ceilometer_cagent_role.rb on lines 23..42

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

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)
  d["element_states"] = td["element_states"]
  d["element_order"] = td["element_order"]
  d["element_run_list_order"] = td["element_run_list_order"]

chef/data_bags/crowbar/migrate/ceilometer/023_rename_ceilometer_cagent_role.rb on lines 23..42
chef/data_bags/crowbar/migrate/ceilometer/101_bring-central-role-back.rb on lines 25..43

Duplicated Code

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

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

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

Tuning

This issue has a mass of 66.

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 downgrade(ta, td, a, d)
  d["element_states"] = td["element_states"]
  d["element_order"] = td["element_order"]
  d["element_run_list_order"] = td["element_run_list_order"]

chef/data_bags/crowbar/migrate/ceilometer/023_rename_ceilometer_cagent_role.rb on lines 1..20
chef/data_bags/crowbar/migrate/ceilometer/101_bring-central-role-back.rb on lines 25..43

Duplicated Code

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

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

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

Tuning

This issue has a mass of 66.

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
  d["elements"]["neutron-network"] = d["elements"]["neutron-l3"]
  d["elements"].delete("neutron-l3")

  d["element_states"] = td["element_states"]
chef/data_bags/crowbar/migrate/neutron/026_rename_l3_role.rb on lines 23..42

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

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

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

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

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

Refactorings

Further Reading

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

def downgrade ta, td, a, d
  d["elements"]["neutron-l3"] = d["elements"]["neutron-network"]
  d["elements"].delete("neutron-network")

  d["element_states"] = td["element_states"]
chef/data_bags/crowbar/migrate/neutron/026_rename_l3_role.rb on lines 1..20

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

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("Heat apply_role_pre_chef_call: entering #{all_nodes.inspect}")
    return if all_nodes.empty?

    vip_networks = ["admin", "public"]
Severity: Major
Found in crowbar_framework/app/models/heat_service.rb and 2 other locations - About 1 hr to fix
crowbar_framework/app/models/designate_service.rb on lines 129..151
crowbar_framework/app/models/sahara_service.rb on lines 99..121

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

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("sahara apply_role_pre_chef_call: entering #{all_nodes.inspect}")
    return if all_nodes.empty?

    vip_networks = ["admin", "public"]
Severity: Major
Found in crowbar_framework/app/models/sahara_service.rb and 2 other locations - About 1 hr to fix
crowbar_framework/app/models/designate_service.rb on lines 129..151
crowbar_framework/app/models/heat_service.rb on lines 91..112

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

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("Designate apply_role_pre_chef_call: entering #{all_nodes.inspect}")
    return if all_nodes.empty?

    vip_networks = ["admin", "public"]
Severity: Major
Found in crowbar_framework/app/models/designate_service.rb and 2 other locations - About 1 hr to fix
crowbar_framework/app/models/heat_service.rb on lines 91..112
crowbar_framework/app/models/sahara_service.rb on lines 99..121

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

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

if node[:neutron][:api][:protocol] == "https"
  ssl_setup "setting up ssl for neutron" do
    generate_certs node[:neutron][:ssl][:generate_certs]
    certfile node[:neutron][:ssl][:certfile]
    keyfile node[:neutron][:ssl][:keyfile]
Severity: Major
Found in chef/cookbooks/neutron/recipes/server.rb and 7 other locations - About 1 hr to fix
chef/cookbooks/barbican/recipes/api.rb on lines 38..46
chef/cookbooks/cinder/recipes/api.rb on lines 34..42
chef/cookbooks/designate/recipes/api.rb on lines 26..34
chef/cookbooks/glance/recipes/api.rb on lines 30..38
chef/cookbooks/heat/recipes/server.rb on lines 93..101
chef/cookbooks/manila/recipes/common.rb on lines 146..154
chef/cookbooks/watcher/recipes/server.rb on lines 11..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

if node[:barbican][:api][:protocol] == "https"
  ssl_setup "setting up ssl for barbican" do
    generate_certs node[:barbican][:ssl][:generate_certs]
    certfile node[:barbican][:ssl][:certfile]
    keyfile node[:barbican][:ssl][:keyfile]
Severity: Major
Found in chef/cookbooks/barbican/recipes/api.rb and 7 other locations - About 1 hr to fix
chef/cookbooks/cinder/recipes/api.rb on lines 34..42
chef/cookbooks/designate/recipes/api.rb on lines 26..34
chef/cookbooks/glance/recipes/api.rb on lines 30..38
chef/cookbooks/heat/recipes/server.rb on lines 93..101
chef/cookbooks/manila/recipes/common.rb on lines 146..154
chef/cookbooks/neutron/recipes/server.rb on lines 41..49
chef/cookbooks/watcher/recipes/server.rb on lines 11..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

if node[:cinder][:api][:protocol] == "https"
  ssl_setup "setting up ssl for cinder" do
    generate_certs node[:cinder][:ssl][:generate_certs]
    certfile node[:cinder][:ssl][:certfile]
    keyfile node[:cinder][:ssl][:keyfile]
Severity: Major
Found in chef/cookbooks/cinder/recipes/api.rb and 7 other locations - About 1 hr to fix
chef/cookbooks/barbican/recipes/api.rb on lines 38..46
chef/cookbooks/designate/recipes/api.rb on lines 26..34
chef/cookbooks/glance/recipes/api.rb on lines 30..38
chef/cookbooks/heat/recipes/server.rb on lines 93..101
chef/cookbooks/manila/recipes/common.rb on lines 146..154
chef/cookbooks/neutron/recipes/server.rb on lines 41..49
chef/cookbooks/watcher/recipes/server.rb on lines 11..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

if node[:designate][:api][:protocol] == "https"
  ssl_setup "setting up ssl for designate" do
    generate_certs node[:designate][:ssl][:generate_certs]
    certfile node[:designate][:ssl][:certfile]
    keyfile node[:designate][:ssl][:keyfile]
Severity: Major
Found in chef/cookbooks/designate/recipes/api.rb and 7 other locations - About 1 hr to fix
chef/cookbooks/barbican/recipes/api.rb on lines 38..46
chef/cookbooks/cinder/recipes/api.rb on lines 34..42
chef/cookbooks/glance/recipes/api.rb on lines 30..38
chef/cookbooks/heat/recipes/server.rb on lines 93..101
chef/cookbooks/manila/recipes/common.rb on lines 146..154
chef/cookbooks/neutron/recipes/server.rb on lines 41..49
chef/cookbooks/watcher/recipes/server.rb on lines 11..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

if node[:manila][:api][:protocol] == "https"
  ssl_setup "setting up ssl for manila" do
    generate_certs node[:manila][:ssl][:generate_certs]
    certfile node[:manila][:ssl][:certfile]
    keyfile node[:manila][:ssl][:keyfile]
Severity: Major
Found in chef/cookbooks/manila/recipes/common.rb and 7 other locations - About 1 hr to fix
chef/cookbooks/barbican/recipes/api.rb on lines 38..46
chef/cookbooks/cinder/recipes/api.rb on lines 34..42
chef/cookbooks/designate/recipes/api.rb on lines 26..34
chef/cookbooks/glance/recipes/api.rb on lines 30..38
chef/cookbooks/heat/recipes/server.rb on lines 93..101
chef/cookbooks/neutron/recipes/server.rb on lines 41..49
chef/cookbooks/watcher/recipes/server.rb on lines 11..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

if node[:watcher][:api][:protocol] == "https"
  ssl_setup "setting up ssl for watcher" do
    generate_certs node[:watcher][:ssl][:generate_certs]
    certfile node[:watcher][:ssl][:certfile]
    keyfile node[:watcher][:ssl][:keyfile]
Severity: Major
Found in chef/cookbooks/watcher/recipes/server.rb and 7 other locations - About 1 hr to fix
chef/cookbooks/barbican/recipes/api.rb on lines 38..46
chef/cookbooks/cinder/recipes/api.rb on lines 34..42
chef/cookbooks/designate/recipes/api.rb on lines 26..34
chef/cookbooks/glance/recipes/api.rb on lines 30..38
chef/cookbooks/heat/recipes/server.rb on lines 93..101
chef/cookbooks/manila/recipes/common.rb on lines 146..154
chef/cookbooks/neutron/recipes/server.rb on lines 41..49

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

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

if node[:glance][:api][:protocol] == "https"
  ssl_setup "setting up ssl for glance" do
    generate_certs node[:glance][:ssl][:generate_certs]
    certfile node[:glance][:ssl][:certfile]
    keyfile node[:glance][:ssl][:keyfile]
Severity: Major
Found in chef/cookbooks/glance/recipes/api.rb and 7 other locations - About 1 hr to fix
chef/cookbooks/barbican/recipes/api.rb on lines 38..46
chef/cookbooks/cinder/recipes/api.rb on lines 34..42
chef/cookbooks/designate/recipes/api.rb on lines 26..34
chef/cookbooks/heat/recipes/server.rb on lines 93..101
chef/cookbooks/manila/recipes/common.rb on lines 146..154
chef/cookbooks/neutron/recipes/server.rb on lines 41..49
chef/cookbooks/watcher/recipes/server.rb on lines 11..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

if node[:heat][:api][:protocol] == "https"
  ssl_setup "setting up ssl for heat" do
    generate_certs node[:heat][:ssl][:generate_certs]
    certfile node[:heat][:ssl][:certfile]
    keyfile node[:heat][:ssl][:keyfile]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 7 other locations - About 1 hr to fix
chef/cookbooks/barbican/recipes/api.rb on lines 38..46
chef/cookbooks/cinder/recipes/api.rb on lines 34..42
chef/cookbooks/designate/recipes/api.rb on lines 26..34
chef/cookbooks/glance/recipes/api.rb on lines 30..38
chef/cookbooks/manila/recipes/common.rb on lines 146..154
chef/cookbooks/neutron/recipes/server.rb on lines 41..49
chef/cookbooks/watcher/recipes/server.rb on lines 11..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 64.

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

  CiscoPorts.prototype.removeJson = function(key, value, type) {
    return $(this.options.storage).removeJsonAttribute(
      '{0}/{1}'.format(
        this.options.path,
        key
crowbar_framework/app/assets/javascripts/barclamps/neutron/application.js on lines 195..204

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

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