crowbar/crowbar-openstack

View on GitHub
chef/cookbooks/heat/recipes/server.rb

Summary

Maintainability
D
2 days
Test Coverage

File server.rb has 370 lines of code (exceeds 250 allowed). Consider refactoring.
Open

ha_enabled = node[:heat][:ha][:enabled]

db_settings = fetch_database_settings

include_recipe "database::client"
Severity: Minor
Found in chef/cookbooks/heat/recipes/server.rb - About 4 hrs to fix

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

  EOF
  environment ({
    "OS_USERNAME" => keystone_settings["admin_user"],
    "OS_PASSWORD" => keystone_settings["admin_password"],
    "OS_TENANT_NAME" => keystone_settings["admin_tenant"],
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 1 other location - About 3 hrs to fix
chef/cookbooks/heat/recipes/server.rb on lines 287..305

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

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

  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
  auth register_auth_hash
  endpoint_service "heat-cfn"
  endpoint_region keystone_settings["endpoint_region"]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 1 other location - About 3 hrs to fix
chef/cookbooks/heat/recipes/server.rb on lines 258..270

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

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

database_user "grant database access for heat database user" do
  connection db_settings[:connection]
  username node[:heat][:db][:user]
  password node[:heat][:db][:password]
  database_name node[:heat][:db][:database]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 8 other locations - About 1 hr to fix
chef/cookbooks/ceilometer/recipes/server.rb on lines 60..70
chef/cookbooks/cinder/recipes/sql.rb on lines 51..61
chef/cookbooks/designate/recipes/sql.rb on lines 47..57
chef/cookbooks/glance/recipes/common.rb on lines 53..63
chef/cookbooks/keystone/recipes/server.rb on lines 278..288
chef/cookbooks/manila/recipes/sql.rb on lines 34..44
chef/cookbooks/sahara/recipes/sql.rb on lines 47..57
chef/cookbooks/watcher/recipes/common.rb on lines 52..62

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

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 44.

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

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

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

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

Refactorings

Further Reading

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

keystone_register "give heat user access" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 17 other locations - About 50 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 116..126
chef/cookbooks/barbican/recipes/api.rb on lines 140..150
chef/cookbooks/barbican/recipes/api.rb on lines 164..174
chef/cookbooks/barbican/recipes/api.rb on lines 188..198
chef/cookbooks/barbican/recipes/api.rb on lines 212..222
chef/cookbooks/cinder/recipes/api.rb on lines 75..85
chef/cookbooks/designate/recipes/api.rb on lines 72..82
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 109..119
chef/cookbooks/glance/recipes/common.rb on lines 107..117
chef/cookbooks/magnum/recipes/api.rb on lines 61..71
chef/cookbooks/manila/recipes/api.rb on lines 67..77
chef/cookbooks/neutron/recipes/api_register.rb on lines 55..65
chef/cookbooks/nova/recipes/api.rb on lines 70..80
chef/cookbooks/octavia/recipes/keystone.rb on lines 56..66
chef/cookbooks/sahara/recipes/api.rb on lines 60..70
chef/cookbooks/swift/recipes/proxy.rb on lines 218..228
chef/cookbooks/watcher/recipes/common.rb on lines 106..116

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

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

database_user "create heat database user" do
  host "%"
  connection db_settings[:connection]
  username node[:heat][:db][:user]
  password node[:heat][:db][:password]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 7 other locations - About 45 mins to fix
chef/cookbooks/ceilometer/recipes/server.rb on lines 50..57
chef/cookbooks/cinder/recipes/sql.rb on lines 41..48
chef/cookbooks/designate/recipes/sql.rb on lines 37..44
chef/cookbooks/glance/recipes/common.rb on lines 43..50
chef/cookbooks/manila/recipes/sql.rb on lines 24..31
chef/cookbooks/sahara/recipes/sql.rb on lines 37..44
chef/cookbooks/watcher/recipes/common.rb on lines 42..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 40.

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

database "create #{node[:heat][:db][:database]} database" do
  connection db_settings[:connection]
  database_name node[:heat][:db][:database]
  provider db_settings[:provider]
  action :create
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 10 other locations - About 45 mins to fix
chef/cookbooks/barbican/recipes/common.rb on lines 58..63
chef/cookbooks/ceilometer/recipes/server.rb on lines 42..47
chef/cookbooks/cinder/recipes/sql.rb on lines 33..38
chef/cookbooks/designate/recipes/sql.rb on lines 29..34
chef/cookbooks/glance/recipes/common.rb on lines 35..40
chef/cookbooks/horizon/recipes/server.rb on lines 324..329
chef/cookbooks/keystone/recipes/server.rb on lines 260..265
chef/cookbooks/manila/recipes/sql.rb on lines 16..21
chef/cookbooks/sahara/recipes/sql.rb on lines 29..34
chef/cookbooks/watcher/recipes/common.rb on lines 34..39

Duplicated Code

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

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

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

Tuning

This issue has a mass of 39.

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

    protocol keystone_settings["protocol"]
    insecure keystone_settings["insecure"]
    host keystone_settings["internal_url_host"]
    port keystone_settings["admin_port"]
    auth register_auth_hash
Severity: Minor
Found in chef/cookbooks/heat/recipes/server.rb and 1 other location - About 45 mins to fix
chef/cookbooks/ceilometer/recipes/server.rb on lines 125..134

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

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

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

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

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

Refactorings

Further Reading

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

            --password #{node[:heat][:stack_domain_admin_password]} \
            --description "Manages users and projects created by heat" \
            #{node[:heat][:stack_domain_admin]})
    fi

Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 18 other locations - About 40 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 74..84
chef/cookbooks/cinder/recipes/api.rb on lines 88..98
chef/cookbooks/cinder/recipes/api.rb on lines 119..129
chef/cookbooks/cinder/recipes/api.rb on lines 150..160
chef/cookbooks/designate/recipes/api.rb on lines 85..95
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 123..133
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 152..162
chef/cookbooks/glance/recipes/api.rb on lines 148..158
chef/cookbooks/heat/recipes/server.rb on lines 274..284
chef/cookbooks/manila/recipes/api.rb on lines 80..90
chef/cookbooks/manila/recipes/api.rb on lines 112..122
chef/cookbooks/neutron/recipes/api_register.rb on lines 68..78
chef/cookbooks/nova/recipes/api.rb on lines 83..93
chef/cookbooks/nova/recipes/api.rb on lines 96..106
chef/cookbooks/nova/recipes/placement_api.rb on lines 69..79
chef/cookbooks/octavia/recipes/keystone.rb on lines 69..79
chef/cookbooks/sahara/recipes/api.rb on lines 73..83
chef/cookbooks/watcher/recipes/server.rb on lines 74..84

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

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

  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
  auth register_auth_hash
  service_name "heat-cfn"
  service_type "cloudformation"
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 18 other locations - About 40 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 74..84
chef/cookbooks/cinder/recipes/api.rb on lines 88..98
chef/cookbooks/cinder/recipes/api.rb on lines 119..129
chef/cookbooks/cinder/recipes/api.rb on lines 150..160
chef/cookbooks/designate/recipes/api.rb on lines 85..95
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 123..133
chef/cookbooks/ec2-api/recipes/ec2api.rb on lines 152..162
chef/cookbooks/glance/recipes/api.rb on lines 148..158
chef/cookbooks/heat/recipes/server.rb on lines 245..255
chef/cookbooks/manila/recipes/api.rb on lines 80..90
chef/cookbooks/manila/recipes/api.rb on lines 112..122
chef/cookbooks/neutron/recipes/api_register.rb on lines 68..78
chef/cookbooks/nova/recipes/api.rb on lines 83..93
chef/cookbooks/nova/recipes/api.rb on lines 96..106
chef/cookbooks/nova/recipes/placement_api.rb on lines 69..79
chef/cookbooks/octavia/recipes/keystone.rb on lines 69..79
chef/cookbooks/sahara/recipes/api.rb on lines 73..83
chef/cookbooks/watcher/recipes/server.rb on lines 74..84

Duplicated Code

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

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

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

Tuning

This issue has a mass of 38.

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

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

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

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

Refactorings

Further Reading

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

keystone_register "add heat stack user role" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 9 other locations - About 35 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 129..137
chef/cookbooks/barbican/recipes/api.rb on lines 153..161
chef/cookbooks/barbican/recipes/api.rb on lines 177..185
chef/cookbooks/barbican/recipes/api.rb on lines 201..209
chef/cookbooks/octavia/recipes/keystone.rb on lines 97..105
chef/cookbooks/octavia/recipes/keystone.rb on lines 108..116
chef/cookbooks/octavia/recipes/keystone.rb on lines 119..127
chef/cookbooks/octavia/recipes/keystone.rb on lines 130..138
chef/cookbooks/octavia/recipes/keystone.rb on lines 141..149

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

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

    lazy {
      {
        debug: node[:heat][:debug],
        rabbit_settings: fetch_rabbitmq_settings,
        keystone_settings: keystone_settings,
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 4 other locations - About 30 mins to fix
chef/cookbooks/barbican/recipes/common.rb on lines 90..99
chef/cookbooks/neutron/recipes/server.rb on lines 274..280
chef/cookbooks/neutron/recipes/server.rb on lines 309..313
chef/cookbooks/neutron/recipes/server.rb on lines 327..331

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

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

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

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

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

Refactorings

Further Reading

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

keystone_register "heat wakeup keystone" do
  protocol keystone_settings["protocol"]
  insecure keystone_settings["insecure"]
  host keystone_settings["internal_url_host"]
  port keystone_settings["admin_port"]
Severity: Major
Found in chef/cookbooks/heat/recipes/server.rb and 13 other locations - About 30 mins to fix
chef/cookbooks/barbican/recipes/api.rb on lines 63..70
chef/cookbooks/ceilometer/recipes/server.rb on lines 114..121
chef/cookbooks/cinder/recipes/api.rb on lines 52..59
chef/cookbooks/designate/recipes/api.rb on lines 49..56
chef/cookbooks/glance/recipes/common.rb on lines 84..91
chef/cookbooks/magnum/recipes/api.rb on lines 38..45
chef/cookbooks/manila/recipes/api.rb on lines 44..51
chef/cookbooks/neutron/recipes/api_register.rb on lines 32..39
chef/cookbooks/nova/recipes/api.rb on lines 47..54
chef/cookbooks/octavia/recipes/keystone.rb on lines 33..40
chef/cookbooks/sahara/recipes/api.rb on lines 37..44
chef/cookbooks/swift/recipes/proxy.rb on lines 182..189
chef/cookbooks/watcher/recipes/common.rb on lines 83..90

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

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

    protocol keystone_settings["protocol"]
    insecure keystone_settings["insecure"]
    host keystone_settings["internal_url_host"]
    port keystone_settings["admin_port"]
    auth register_auth_hash
Severity: Minor
Found in chef/cookbooks/heat/recipes/server.rb and 1 other location - About 25 mins to fix
chef/cookbooks/swift/recipes/proxy.rb on lines 195..202

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

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

    node.save
  end
  action :nothing
  subscribes :create, "execute[heat-manage db_sync]", :immediately
end
Severity: Minor
Found in chef/cookbooks/heat/recipes/server.rb and 2 other locations - About 15 mins to fix
chef/cookbooks/heat/recipes/server.rb on lines 385..389
chef/cookbooks/heat/recipes/server.rb on lines 414..418

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


execute "heat-manage db_sync" do
  user node[:heat][:user]
  group node[:heat][:group]
  command "heat-manage db_sync"
Severity: Minor
Found in chef/cookbooks/heat/recipes/server.rb and 2 other locations - About 15 mins to fix
chef/cookbooks/heat/recipes/server.rb on lines 404..408
chef/cookbooks/heat/recipes/server.rb on lines 414..418

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

  supports status: true, restart: true
  action [:enable, :start]
  subscribes :restart, resources("template[/etc/heat/heat.conf.d/100-heat.conf]")
end
utils_systemd_service_restart "heat-engine" do
Severity: Minor
Found in chef/cookbooks/heat/recipes/server.rb and 2 other locations - About 15 mins to fix
chef/cookbooks/heat/recipes/server.rb on lines 385..389
chef/cookbooks/heat/recipes/server.rb on lines 404..408

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

There are no issues that match your filters.

Category
Status