fog/fog-google

View on GitHub

Showing 198 of 329 total issues

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

  module Google
    class Pubsub
      class Real
        # Gets a list of all subscriptions for a given project.
        #
Severity: Minor
Found in lib/fog/google/requests/pubsub/list_subscriptions.rb and 1 other location - About 25 mins to fix
lib/fog/google/requests/pubsub/list_topics.rb on lines 2..25

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

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 Google
    class Pubsub
      class Real
        # Gets a list of all topics for a given project.
        #
Severity: Minor
Found in lib/fog/google/requests/pubsub/list_topics.rb and 1 other location - About 25 mins to fix
lib/fog/google/requests/pubsub/list_subscriptions.rb on lines 2..25

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

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

          string_to_sign = <<-DATA
#{params[:method]}
#{params[:headers]['Content-MD5']}
#{params[:headers]['Content-Type']}
Severity: Minor
Found in lib/fog/storage/google_json/real.rb and 1 other location - About 20 mins to fix
lib/fog/storage/google_xml/real.rb on lines 41..44

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

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

          string_to_sign = <<-DATA
#{params[:method]}
#{params[:headers]['Content-MD5']}
#{params[:headers]['Content-Type']}
Severity: Minor
Found in lib/fog/storage/google_xml/real.rb and 1 other location - About 20 mins to fix
lib/fog/storage/google_json/real.rb on lines 29..32

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

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 create(opts)
          requires :name

          data = service.insert_http_health_check(name, opts)
          operation = Fog::Compute::Google::Operations.new(service: service)
Severity: Minor
Found in lib/fog/compute/google/models/http_health_check.rb and 1 other location - About 20 mins to fix
lib/fog/compute/google/models/http_health_check.rb on lines 60..66

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

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 update(opts)
          requires :name
          data = service.update_http_health_check(name, opts)
          operation = Fog::Compute::Google::Operations.new(service: service)
                                                      .get(data.name, data.zone)
Severity: Minor
Found in lib/fog/compute/google/models/http_health_check.rb and 1 other location - About 20 mins to fix
lib/fog/compute/google/models/http_health_check.rb on lines 50..57

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

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 get_by_ip_address(ip_address)
          addresses = service.list_aggregated_addresses(filter: "address eq .*#{ip_address}").items
          address = addresses.each_value.select(&:addresses)

          return nil if address.empty?
Severity: Minor
Found in lib/fog/compute/google/models/addresses.rb and 1 other location - About 20 mins to fix
lib/fog/compute/google/models/addresses.rb on lines 58..63

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

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 get_by_name(ip_name)
          names = service.list_aggregated_addresses(filter: "name eq .*#{ip_name}").items
          name = names.each_value.select(&:addresses)

          return nil if name.empty?
Severity: Minor
Found in lib/fog/compute/google/models/addresses.rb and 1 other location - About 20 mins to fix
lib/fog/compute/google/models/addresses.rb on lines 50..55

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

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

  module Compute
    class Google
      class Mock
        def get_target_instance(_target_name, _zone)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/get_target_instance.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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

        def save
          requires :name

          data = service.insert_image(name, attributes)
          operation = Fog::Compute::Google::Operations.new(:service => service)
Severity: Minor
Found in lib/fog/compute/google/models/image.rb and 2 other locations - About 15 mins to fix
lib/fog/compute/google/models/global_address.rb on lines 24..31
lib/fog/compute/google/models/network.rb on lines 29..38

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

  module Compute
    class Google
      class Mock
        def delete_zone_operation(_zone, _operation)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/delete_zone_operation.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def get_disk(_disk_name, _zone_name)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/get_disk.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def delete_region_operation(_region, _operation)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/delete_region_operation.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def delete_disk(_disk_name, _zone_name)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/delete_disk.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def get_machine_type(_machine_type, _zone)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/get_machine_type.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def delete_subnetwork(_subnetwork_name, _region_name)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/delete_subnetwork.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def delete_forwarding_rule(_rule, _region)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/delete_forwarding_rule.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def get_target_pool(_target_pool, _region)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/get_target_pool.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def delete_target_instance(_target_name, _zone)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/delete_target_instance.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_forwarding_rule.rb on lines 2..17
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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 13 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def get_forwarding_rule(_rule, _region)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/get_forwarding_rule.rb and 12 other locations - About 15 mins to fix
lib/fog/compute/google/requests/delete_disk.rb on lines 2..20
lib/fog/compute/google/requests/delete_forwarding_rule.rb on lines 2..15
lib/fog/compute/google/requests/delete_region_operation.rb on lines 2..17
lib/fog/compute/google/requests/delete_subnetwork.rb on lines 2..26
lib/fog/compute/google/requests/delete_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/delete_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/delete_zone_operation.rb on lines 2..17
lib/fog/compute/google/requests/get_disk.rb on lines 2..19
lib/fog/compute/google/requests/get_machine_type.rb on lines 2..15
lib/fog/compute/google/requests/get_target_instance.rb on lines 2..15
lib/fog/compute/google/requests/get_target_pool.rb on lines 2..15
lib/fog/compute/google/requests/get_zone_operation.rb on lines 2..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 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

Severity
Category
Status
Source
Language