fog/fog-openstack

View on GitHub

Showing 460 of 616 total issues

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

          if !options.kind_of?(Hash)
            if options
              Fog::Logger.deprecation('Calling OpenStack[:compute].volumes.all(true) is deprecated, use .volumes.all')
            else
              Fog::Logger.deprecation('Calling OpenStack[:compute].volumes.all(false) is deprecated, use .volumes.summary')
Severity: Minor
Found in lib/fog/openstack/compute/models/volumes.rb and 1 other location - About 15 mins to fix
lib/fog/openstack/compute/models/snapshots.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 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 2 locations. Consider refactoring.
Open

          def find_by_name(name)
            find { |user| user.name == name } ||
              Fog::OpenStack::Identity::V2::User.new(
                service.get_user_by_name(name).body['user'].merge(
                  'service' => service
Severity: Minor
Found in lib/fog/openstack/identity/v2/models/users.rb and 1 other location - About 15 mins to fix
lib/fog/openstack/identity/v2/models/users.rb on lines 19..26

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

  module OpenStack
    class Identity
      class V3
        class Real
          def list_group_users(id, options = {})
Severity: Minor
Found in lib/fog/openstack/identity/v3/requests/list_group_users.rb and 1 other location - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/list_user_projects.rb on lines 2..18

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

      module Mock
        def update_volume_type(_volume_type_id, _options = {})
          response = Excon::Response.new
          response.status = 202
          response.body = {
Severity: Minor
Found in lib/fog/openstack/volume/requests/update_volume_type.rb and 1 other location - About 15 mins to fix
lib/fog/openstack/volume/requests/create_volume_type.rb on lines 23..36

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

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

          if arg1.kind_of?(Stack)
            # Normal use: delete_stack(stack)
            stack = arg1
            stack_name = stack.stack_name
            stack_id = stack.id
Severity: Minor
Found in lib/fog/openstack/orchestration/requests/delete_stack.rb and 1 other location - About 15 mins to fix
lib/fog/openstack/orchestration/requests/delete_stack.rb on lines 36..45

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

  module OpenStack
    class Network
      class Real
        def delete_quota(tenant_id)
          request(
Severity: Minor
Found in lib/fog/openstack/network/requests/delete_quota.rb and 4 other locations - About 15 mins to fix
lib/fog/openstack/introspection/requests/delete_rules.rb on lines 2..18
lib/fog/openstack/nfv/requests/delete_vnf.rb on lines 2..18
lib/fog/openstack/nfv/requests/delete_vnfd.rb on lines 2..18
lib/fog/openstack/shared_file_system/requests/delete_security_service.rb on lines 2..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 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 2 locations. Consider refactoring.
Open

        recognizes :openstack_auth_token, :openstack_management_url,
                   :persistent, :openstack_service_type, :openstack_service_name,
                   :openstack_tenant, :openstack_tenant_id,
                   :openstack_api_key, :openstack_username, :openstack_identity_endpoint,
                   :current_user, :current_tenant, :openstack_region,
Severity: Minor
Found in lib/fog/openstack/identity/v2.rb and 1 other location - About 15 mins to fix
lib/fog/openstack/shared_file_system.rb on lines 8..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 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 2 locations. Consider refactoring.
Open

action_def = {
  :version => "2.0",
  :myaction => {
    :input => ['execution_id'],
    :base  => "std.email",
Severity: Minor
Found in examples/workflow/workflow-examples.rb and 1 other location - About 15 mins to fix
examples/workflow/workflow-examples.rb on lines 265..276

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

  module OpenStack
    class Identity
      class V3
        class Real
          def list_endpoints(options = {})
Severity: Minor
Found in lib/fog/openstack/identity/v3/requests/list_endpoints.rb and 6 other locations - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/list_domains.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_os_credentials.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_policies.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_roles.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_services.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_users.rb on lines 2..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  module OpenStack
    class Compute
      class Real
        def add_security_group(server_id, group_name)
          body = {'addSecurityGroup' => {"name" => group_name}}
Severity: Minor
Found in lib/fog/openstack/compute/requests/add_security_group.rb and 4 other locations - About 15 mins to fix
lib/fog/openstack/compute/requests/change_server_password.rb on lines 2..15
lib/fog/openstack/compute/requests/get_console_output.rb on lines 2..19
lib/fog/openstack/compute/requests/remove_security_group.rb on lines 2..15
lib/fog/openstack/compute/requests/resize_server.rb on lines 2..15

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  module OpenStack
    class Identity
      class V3
        class Real
          def update_policy(id, policy)
Severity: Major
Found in lib/fog/openstack/identity/v3/requests/update_policy.rb and 8 other locations - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/update_domain.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_endpoint.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_group.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_os_credential.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_project.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_role.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_service.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_user.rb on lines 2..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  module OpenStack
    class Identity
      class V3
        class Real
          def update_os_credential(id, credential)
Severity: Major
Found in lib/fog/openstack/identity/v3/requests/update_os_credential.rb and 8 other locations - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/update_domain.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_endpoint.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_group.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_policy.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_project.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_role.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_service.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_user.rb on lines 2..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

      recognizes :openstack_auth_token, :openstack_management_url,
                 :persistent, :openstack_service_type, :openstack_service_name,
                 :openstack_tenant, :openstack_tenant_id,
                 :openstack_api_key, :openstack_username, :openstack_identity_endpoint,
                 :current_user, :current_tenant, :openstack_region,
Severity: Major
Found in lib/fog/openstack/container_infra.rb and 9 other locations - About 15 mins to fix
lib/fog/openstack/baremetal.rb on lines 7..18
lib/fog/openstack/event.rb on lines 7..18
lib/fog/openstack/image/v1.rb on lines 10..21
lib/fog/openstack/image/v2.rb on lines 10..21
lib/fog/openstack/introspection.rb on lines 9..20
lib/fog/openstack/metering.rb on lines 9..20
lib/fog/openstack/metric.rb on lines 7..18
lib/fog/openstack/orchestration.rb on lines 5..16
lib/fog/openstack/planning.rb on lines 7..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  module OpenStack
    class Identity
      class V3
        class Real
          def list_roles(options = {})
Severity: Minor
Found in lib/fog/openstack/identity/v3/requests/list_roles.rb and 6 other locations - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/list_domains.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_endpoints.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_os_credentials.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_policies.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_services.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_users.rb on lines 2..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  module OpenStack
    class Identity
      class V3
        class Real
          def update_user(id, user)
Severity: Major
Found in lib/fog/openstack/identity/v3/requests/update_user.rb and 8 other locations - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/update_domain.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_endpoint.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_group.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_os_credential.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_policy.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_project.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_role.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_service.rb on lines 2..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  module OpenStack
    class Identity
      class V3
        class Real
          def list_domains(options = {})
Severity: Minor
Found in lib/fog/openstack/identity/v3/requests/list_domains.rb and 6 other locations - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/list_endpoints.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_os_credentials.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_policies.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_roles.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_services.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_users.rb on lines 2..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

      recognizes :openstack_auth_token, :openstack_management_url,
                 :persistent, :openstack_service_type, :openstack_service_name,
                 :openstack_tenant, :openstack_tenant_id,
                 :openstack_api_key, :openstack_username, :openstack_identity_endpoint,
                 :current_user, :current_tenant, :openstack_region,
Severity: Major
Found in lib/fog/openstack/metering.rb and 9 other locations - About 15 mins to fix
lib/fog/openstack/baremetal.rb on lines 7..18
lib/fog/openstack/container_infra.rb on lines 8..19
lib/fog/openstack/event.rb on lines 7..18
lib/fog/openstack/image/v1.rb on lines 10..21
lib/fog/openstack/image/v2.rb on lines 10..21
lib/fog/openstack/introspection.rb on lines 9..20
lib/fog/openstack/metric.rb on lines 7..18
lib/fog/openstack/orchestration.rb on lines 5..16
lib/fog/openstack/planning.rb on lines 7..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  module OpenStack
    class Identity
      class V3
        class Real
          def update_service(id, service)
Severity: Major
Found in lib/fog/openstack/identity/v3/requests/update_service.rb and 8 other locations - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/update_domain.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_endpoint.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_group.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_os_credential.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_policy.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_project.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_role.rb on lines 2..16
lib/fog/openstack/identity/v3/requests/update_user.rb on lines 2..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

  module OpenStack
    class Identity
      class V3
        class Real
          def list_policies(options = {})
Severity: Minor
Found in lib/fog/openstack/identity/v3/requests/list_policies.rb and 6 other locations - About 15 mins to fix
lib/fog/openstack/identity/v3/requests/list_domains.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_endpoints.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_os_credentials.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_roles.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_services.rb on lines 2..18
lib/fog/openstack/identity/v3/requests/list_users.rb on lines 2..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

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

      recognizes :openstack_auth_token, :openstack_management_url,
                 :persistent, :openstack_service_type, :openstack_service_name,
                 :openstack_tenant, :openstack_tenant_id,
                 :openstack_api_key, :openstack_username, :openstack_identity_endpoint,
                 :current_user, :current_tenant, :openstack_region,
Severity: Major
Found in lib/fog/openstack/orchestration.rb and 9 other locations - About 15 mins to fix
lib/fog/openstack/baremetal.rb on lines 7..18
lib/fog/openstack/container_infra.rb on lines 8..19
lib/fog/openstack/event.rb on lines 7..18
lib/fog/openstack/image/v1.rb on lines 10..21
lib/fog/openstack/image/v2.rb on lines 10..21
lib/fog/openstack/introspection.rb on lines 9..20
lib/fog/openstack/metering.rb on lines 9..20
lib/fog/openstack/metric.rb on lines 7..18
lib/fog/openstack/planning.rb on lines 7..18

Duplicated Code

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

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

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

Tuning

This issue has a mass of 25.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language