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

          when "authenticated-read"
            {
              "AccessControlList" => [
                {
                  "Permission" => "FULL_CONTROL",
Severity: Minor
Found in lib/fog/storage/google_xml/mock.rb and 1 other location - About 15 mins to fix
lib/fog/storage/google_xml/mock.rb on lines 19..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 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 get_zone_operation(_zone_name, _operation)
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/get_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/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

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

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

        def save
          requires :identity

          data = service.insert_network(identity, attributes)
          operation = Fog::Compute::Google::Operations.new(:service => service)
Severity: Minor
Found in lib/fog/compute/google/models/network.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/image.rb on lines 65..72

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 :identity

          data = service.insert_global_address(identity, attributes)
          operation = Fog::Compute::Google::Operations.new(:service => service)
Severity: Minor
Found in lib/fog/compute/google/models/global_address.rb and 2 other locations - About 15 mins to fix
lib/fog/compute/google/models/image.rb on lines 65..72
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 2 locations. Consider refactoring.
Open

        def get(identity)
          if project = service.get_project(identity).to_h
            new(project)
          end
        rescue ::Google::Apis::ClientError => e
Severity: Minor
Found in lib/fog/dns/google/models/projects.rb and 1 other location - About 15 mins to fix
lib/fog/dns/google/models/zones.rb on lines 21..28

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

          when "public-read"
            {
              "AccessControlList" => [
                {
                  "Permission" => "FULL_CONTROL",
Severity: Minor
Found in lib/fog/storage/google_xml/mock.rb and 1 other location - About 15 mins to fix
lib/fog/storage/google_xml/mock.rb on lines 51..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 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 ready?
          requires :identity

          service.get_target_https_proxy(identity)
          true
Severity: Minor
Found in lib/fog/compute/google/models/target_https_proxy.rb and 2 other locations - About 15 mins to fix
lib/fog/compute/google/models/target_http_proxy.rb on lines 45..53
lib/fog/storage/google_json/models/directory.rb on lines 31..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 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 3 locations. Consider refactoring.
Open

        def reload
          requires :name, :region

          return unless data = begin
            collection.get(name, region)
Severity: Minor
Found in lib/fog/compute/google/models/target_pool.rb and 2 other locations - About 15 mins to fix
lib/fog/compute/google/models/disk.rb on lines 126..137
lib/fog/compute/google/models/forwarding_rule.rb on lines 63..74

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

        def reload
          requires :name, :region

          return unless data = begin
            collection.get(name, region)
Severity: Minor
Found in lib/fog/compute/google/models/forwarding_rule.rb and 2 other locations - About 15 mins to fix
lib/fog/compute/google/models/disk.rb on lines 126..137
lib/fog/compute/google/models/target_pool.rb on lines 153..164

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

        def ready?
          requires :identity

          service.get_target_http_proxy(identity)
          true
Severity: Minor
Found in lib/fog/compute/google/models/target_http_proxy.rb and 2 other locations - About 15 mins to fix
lib/fog/compute/google/models/target_https_proxy.rb on lines 77..85
lib/fog/storage/google_json/models/directory.rb on lines 31..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 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 2 locations. Consider refactoring.
Open

      class Real
        def list_snapshots(project = @project, filter: nil, max_results: nil,
                           order_by: nil, page_token: nil)
          @compute.list_snapshots(project,
                                  :filter => filter, :max_results => max_results,
Severity: Minor
Found in lib/fog/compute/google/requests/list_snapshots.rb and 1 other location - About 15 mins to fix
lib/fog/compute/google/requests/list_images.rb on lines 12..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 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 2 locations. Consider refactoring.
Open

      class Real
        def list_images(project = @project,
                        filter: nil, max_results: nil,
                        order_by: nil, page_token: nil)
          @compute.list_images(
Severity: Minor
Found in lib/fog/compute/google/requests/list_images.rb and 1 other location - About 15 mins to fix
lib/fog/compute/google/requests/list_snapshots.rb on lines 12..17

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

        def reload
          requires :identity, :zone

          return unless data = begin
            collection.get(identity, zone_name)
Severity: Minor
Found in lib/fog/compute/google/models/disk.rb and 2 other locations - About 15 mins to fix
lib/fog/compute/google/models/forwarding_rule.rb on lines 63..74
lib/fog/compute/google/models/target_pool.rb on lines 153..164

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

        def destroy
          requires :key
          service.delete_bucket(key)
          true
        rescue ::Google::Apis::ClientError => e
Severity: Minor
Found in lib/fog/storage/google_json/models/directory.rb and 2 other locations - About 15 mins to fix
lib/fog/compute/google/models/target_http_proxy.rb on lines 45..53
lib/fog/compute/google/models/target_https_proxy.rb on lines 77..85

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