fog/fog-google

View on GitHub

Showing 198 of 329 total issues

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

  module Compute
    class Google
      class Mock
        def list_aggregated_target_instances(_options = {})
          # :no-coverage:
lib/fog/compute/google/requests/list_aggregated_disk_types.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_disks.rb on lines 2..27
lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb on lines 2..21
lib/fog/compute/google/requests/list_aggregated_machine_types.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_servers.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_subnetworks.rb on lines 2..31
lib/fog/compute/google/requests/list_aggregated_target_pools.rb on lines 2..21
lib/fog/compute/google/requests/list_global_addresses.rb on lines 2..21
lib/fog/compute/google/requests/list_global_forwarding_rules.rb on lines 2..19
lib/fog/compute/google/requests/list_networks.rb on lines 2..19
lib/fog/compute/google/requests/list_routes.rb on lines 2..23

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

  module Compute
    class Google
      class Mock
        def list_routes(_options = {})
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_routes.rb and 12 other locations - About 30 mins to fix
lib/fog/compute/google/requests/list_aggregated_disk_types.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_disks.rb on lines 2..27
lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb on lines 2..21
lib/fog/compute/google/requests/list_aggregated_machine_types.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_servers.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_subnetworks.rb on lines 2..31
lib/fog/compute/google/requests/list_aggregated_target_instances.rb on lines 2..21
lib/fog/compute/google/requests/list_aggregated_target_pools.rb on lines 2..21
lib/fog/compute/google/requests/list_global_addresses.rb on lines 2..21
lib/fog/compute/google/requests/list_global_forwarding_rules.rb on lines 2..19
lib/fog/compute/google/requests/list_networks.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 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 5 locations. Consider refactoring.
Open

        def destroy(async = true)
          requires :name, :zone

          data = service.delete_server(name, zone_name)
          operation = Fog::Compute::Google::Operations
Severity: Major
Found in lib/fog/compute/google/models/server.rb and 4 other locations - About 30 mins to fix
lib/fog/compute/google/models/disk.rb on lines 61..68
lib/fog/compute/google/models/server.rb on lines 320..328
lib/fog/compute/google/models/server.rb on lines 331..339
lib/fog/compute/google/models/target_instance.rb on lines 33..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 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 5 locations. Consider refactoring.
Open

        def destroy(async = true)
          requires :name, :zone

          data = service.delete_disk(name, zone_name)
          operation = Fog::Compute::Google::Operations.new(:service => service)
Severity: Major
Found in lib/fog/compute/google/models/disk.rb and 4 other locations - About 30 mins to fix
lib/fog/compute/google/models/server.rb on lines 206..214
lib/fog/compute/google/models/server.rb on lines 320..328
lib/fog/compute/google/models/server.rb on lines 331..339
lib/fog/compute/google/models/target_instance.rb on lines 33..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 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 2 locations. Consider refactoring.
Open

        def all
          requires :zone

          data = service.list_changes(zone.identity).to_h[:changes] || []
          load(data)
Severity: Minor
Found in lib/fog/dns/google/models/changes.rb and 1 other location - About 30 mins to fix
lib/fog/dns/google/models/records.rb on lines 13..22

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

  module Compute
    class Google
      class Mock
        def list_aggregated_instance_group_managers(_opts = {})
          # :no-coverage:
lib/fog/compute/google/requests/list_aggregated_disk_types.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_disks.rb on lines 2..27
lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_machine_types.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_servers.rb on lines 2..19
lib/fog/compute/google/requests/list_aggregated_subnetworks.rb on lines 2..31
lib/fog/compute/google/requests/list_aggregated_target_instances.rb on lines 2..21
lib/fog/compute/google/requests/list_aggregated_target_pools.rb on lines 2..21
lib/fog/compute/google/requests/list_global_addresses.rb on lines 2..21
lib/fog/compute/google/requests/list_global_forwarding_rules.rb on lines 2..19
lib/fog/compute/google/requests/list_networks.rb on lines 2..19
lib/fog/compute/google/requests/list_routes.rb on lines 2..23

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

        def all
          requires :zone

          data = service.list_resource_record_sets(zone.identity)
                        .to_h[:rrsets] || []
Severity: Minor
Found in lib/fog/dns/google/models/records.rb and 1 other location - About 30 mins to fix
lib/fog/dns/google/models/changes.rb on lines 13..21

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

        def reset_ssl_config(async: true)
          requires :identity

          data = service.reset_instance_ssl_config(identity)
          operation = Fog::Google::SQL::Operations.new(:service => service).get(data.name)
Severity: Minor
Found in lib/fog/google/models/sql/instance.rb and 1 other location - About 30 mins to fix
lib/fog/google/models/sql/instance.rb on lines 256..261

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

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

  module Compute
    class Google
      class Mock
        def insert_network(_network_name, _opts = {})
          # :no-coverage:
Severity: Minor
Found in lib/fog/compute/google/requests/insert_network.rb and 1 other location - About 30 mins to fix
lib/fog/compute/google/requests/insert_global_forwarding_rule.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 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

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

        def restart(async: true)
          requires :identity

          data = service.restart_instance(identity)
          operation = Fog::Google::SQL::Operations.new(:service => service).get(data.name)
Severity: Minor
Found in lib/fog/google/models/sql/instance.rb and 1 other location - About 30 mins to fix
lib/fog/google/models/sql/instance.rb on lines 243..248

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

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

  module Compute
    class Google
      class Mock
        def insert_global_forwarding_rule(_rule_name, _opts = {})
          # :no-coverage:
lib/fog/compute/google/requests/insert_network.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 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

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

  module Compute
    class Google
      class Mock
        def list_target_https_proxies
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_target_https_proxies.rb and 7 other locations - About 25 mins to fix
lib/fog/compute/google/requests/list_firewalls.rb on lines 2..19
lib/fog/compute/google/requests/list_global_operations.rb on lines 2..22
lib/fog/compute/google/requests/list_http_health_checks.rb on lines 2..19
lib/fog/compute/google/requests/list_instance_templates.rb on lines 2..21
lib/fog/compute/google/requests/list_regions.rb on lines 2..18
lib/fog/compute/google/requests/list_ssl_certificates.rb on lines 2..21
lib/fog/compute/google/requests/list_zones.rb on lines 2..21

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

  module Compute
    class Google
      class Mock
        def list_zones
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_zones.rb and 7 other locations - About 25 mins to fix
lib/fog/compute/google/requests/list_firewalls.rb on lines 2..19
lib/fog/compute/google/requests/list_global_operations.rb on lines 2..22
lib/fog/compute/google/requests/list_http_health_checks.rb on lines 2..19
lib/fog/compute/google/requests/list_instance_templates.rb on lines 2..21
lib/fog/compute/google/requests/list_regions.rb on lines 2..18
lib/fog/compute/google/requests/list_ssl_certificates.rb on lines 2..21
lib/fog/compute/google/requests/list_target_https_proxies.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 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 8 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def list_ssl_certificates
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_ssl_certificates.rb and 7 other locations - About 25 mins to fix
lib/fog/compute/google/requests/list_firewalls.rb on lines 2..19
lib/fog/compute/google/requests/list_global_operations.rb on lines 2..22
lib/fog/compute/google/requests/list_http_health_checks.rb on lines 2..19
lib/fog/compute/google/requests/list_instance_templates.rb on lines 2..21
lib/fog/compute/google/requests/list_regions.rb on lines 2..18
lib/fog/compute/google/requests/list_target_https_proxies.rb on lines 2..19
lib/fog/compute/google/requests/list_zones.rb on lines 2..21

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

  module Compute
    class Google
      class Mock
        def list_global_operations
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_global_operations.rb and 7 other locations - About 25 mins to fix
lib/fog/compute/google/requests/list_firewalls.rb on lines 2..19
lib/fog/compute/google/requests/list_http_health_checks.rb on lines 2..19
lib/fog/compute/google/requests/list_instance_templates.rb on lines 2..21
lib/fog/compute/google/requests/list_regions.rb on lines 2..18
lib/fog/compute/google/requests/list_ssl_certificates.rb on lines 2..21
lib/fog/compute/google/requests/list_target_https_proxies.rb on lines 2..19
lib/fog/compute/google/requests/list_zones.rb on lines 2..21

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

  module Compute
    class Google
      class Mock
        def list_firewalls
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_firewalls.rb and 7 other locations - About 25 mins to fix
lib/fog/compute/google/requests/list_global_operations.rb on lines 2..22
lib/fog/compute/google/requests/list_http_health_checks.rb on lines 2..19
lib/fog/compute/google/requests/list_instance_templates.rb on lines 2..21
lib/fog/compute/google/requests/list_regions.rb on lines 2..18
lib/fog/compute/google/requests/list_ssl_certificates.rb on lines 2..21
lib/fog/compute/google/requests/list_target_https_proxies.rb on lines 2..19
lib/fog/compute/google/requests/list_zones.rb on lines 2..21

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

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

          if params[:query]
            filtered = params[:query].reject { |k, v| k.nil? || v.nil? }
            query = filtered.map { |k, v| [k.to_s, Fog::Google.escape(v)].join("=") }
Severity: Minor
Found in lib/fog/storage/google_json/utils.rb and 1 other location - About 25 mins to fix
lib/fog/storage/google_xml/utils.rb on lines 36..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 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 8 locations. Consider refactoring.
Open

  module Compute
    class Google
      class Mock
        def list_regions
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_regions.rb and 7 other locations - About 25 mins to fix
lib/fog/compute/google/requests/list_firewalls.rb on lines 2..19
lib/fog/compute/google/requests/list_global_operations.rb on lines 2..22
lib/fog/compute/google/requests/list_http_health_checks.rb on lines 2..19
lib/fog/compute/google/requests/list_instance_templates.rb on lines 2..21
lib/fog/compute/google/requests/list_ssl_certificates.rb on lines 2..21
lib/fog/compute/google/requests/list_target_https_proxies.rb on lines 2..19
lib/fog/compute/google/requests/list_zones.rb on lines 2..21

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

        def save
          requires :identity, :region

          data = service.insert_address(identity, region, attributes)
          operation = Fog::Compute::Google::Operations
Severity: Minor
Found in lib/fog/compute/google/models/address.rb and 1 other location - About 25 mins to fix
lib/fog/compute/google/models/forwarding_rule.rb on lines 24..31

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

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

          if params[:query]
            filtered = params[:query].reject { |k, v| k.nil? || v.nil? }
            query = filtered.map { |k, v| [k.to_s, Fog::Google.escape(v)].join("=") }
Severity: Minor
Found in lib/fog/storage/google_xml/utils.rb and 1 other location - About 25 mins to fix
lib/fog/storage/google_json/utils.rb on lines 28..30

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

Severity
Category
Status
Source
Language