fog/fog-google

View on GitHub

Showing 198 of 329 total issues

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

def test
  connection = Fog::Google::Monitoring.new

  puts "Listing all MonitoredResourceDescriptors..."
  puts "--------------------------------"
Severity: Minor
Found in examples/monitoring/monitored_resource_descriptors.rb and 1 other location - About 35 mins to fix
examples/monitoring/metric_descriptors.rb on lines 10..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 35.

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 set_private_ip_google_access(access, async = true)
          requires :identity, :region

          data = service.set_subnetwork_private_ip_google_access(
            identity, region, access
Severity: Minor
Found in lib/fog/compute/google/models/subnetwork.rb and 1 other location - About 35 mins to fix
lib/fog/compute/google/models/subnetwork.rb on lines 48..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 35.

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(async = true)
          requires :identity, :region
          data = service.delete_target_pool(identity, region)
          operation = Fog::Compute::Google::Operations
                      .new(:service => service)
Severity: Minor
Found in lib/fog/compute/google/models/target_pool.rb and 2 other locations - About 35 mins to fix
lib/fog/compute/google/models/forwarding_rule.rb on lines 45..51
lib/fog/compute/google/models/subnetwork.rb on lines 33..40

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

                                        "n1-highcpu-2" => {
                                          "kind" => "compute#machineType",
                                          "id" => "13043554592196512955",
                                          "creationTimestamp" => "2012-11-16T11:46:10.572-08:00",
                                          "name" => "n1-highcpu-2",
Severity: Major
Found in lib/fog/compute/google/mock.rb and 11 other locations - About 35 mins to fix
lib/fog/compute/google/mock.rb on lines 389..401
lib/fog/compute/google/mock.rb on lines 403..415
lib/fog/compute/google/mock.rb on lines 450..462
lib/fog/compute/google/mock.rb on lines 483..495
lib/fog/compute/google/mock.rb on lines 519..531
lib/fog/compute/google/mock.rb on lines 552..564
lib/fog/compute/google/mock.rb on lines 585..597
lib/fog/compute/google/mock.rb on lines 621..633
lib/fog/compute/google/mock.rb on lines 654..666
lib/fog/compute/google/mock.rb on lines 687..699
lib/fog/compute/google/mock.rb on lines 720..732

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

                                        "n1-highmem-2" => {
                                          "kind" => "compute#machineType",
                                          "id" => "13043551079318055993",
                                          "creationTimestamp" => "2012-11-16T11:40:06.129-08:00",
                                          "name" => "n1-highmem-2",
Severity: Major
Found in lib/fog/compute/google/mock.rb and 11 other locations - About 35 mins to fix
lib/fog/compute/google/mock.rb on lines 389..401
lib/fog/compute/google/mock.rb on lines 403..415
lib/fog/compute/google/mock.rb on lines 417..429
lib/fog/compute/google/mock.rb on lines 450..462
lib/fog/compute/google/mock.rb on lines 483..495
lib/fog/compute/google/mock.rb on lines 552..564
lib/fog/compute/google/mock.rb on lines 585..597
lib/fog/compute/google/mock.rb on lines 621..633
lib/fog/compute/google/mock.rb on lines 654..666
lib/fog/compute/google/mock.rb on lines 687..699
lib/fog/compute/google/mock.rb on lines 720..732

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

  module Compute
    class Google
      class Mock
        def list_forwarding_rules(_region, _opts = {})
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_forwarding_rules.rb and 3 other locations - About 35 mins to fix
lib/fog/compute/google/requests/list_addresses.rb on lines 2..23
lib/fog/compute/google/requests/list_disks.rb on lines 2..23
lib/fog/compute/google/requests/list_instance_group_managers.rb on lines 2..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 34.

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

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

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

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

Refactorings

Further Reading

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

        def destroy(async = true)
          requires :identity, :region
          data = service.delete_forwarding_rule(identity, region)
          operation = Fog::Compute::Google::Operations.new(:service => service)
                                                      .get(data.name, nil, data.region)
Severity: Minor
Found in lib/fog/compute/google/models/forwarding_rule.rb and 2 other locations - About 35 mins to fix
lib/fog/compute/google/models/subnetwork.rb on lines 33..40
lib/fog/compute/google/models/target_pool.rb on lines 32..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 34.

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

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

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

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

Refactorings

Further Reading

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

        def destroy(async = true)
          requires :identity, :region

          data = service.delete_subnetwork(identity, region)
          operation = Fog::Compute::Google::Operations.new(:service => service)
Severity: Minor
Found in lib/fog/compute/google/models/subnetwork.rb and 2 other locations - About 35 mins to fix
lib/fog/compute/google/models/forwarding_rule.rb on lines 45..51
lib/fog/compute/google/models/target_pool.rb on lines 32..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 34.

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

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

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

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

Refactorings

Further Reading

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

                                        "n1-highcpu-4" => {
                                          "kind" => "compute#machineType",
                                          "id" => "13043555705736970382",
                                          "creationTimestamp" => "2012-11-16T11:48:06.087-08:00",
                                          "name" => "n1-highcpu-4",
Severity: Major
Found in lib/fog/compute/google/mock.rb and 11 other locations - About 35 mins to fix
lib/fog/compute/google/mock.rb on lines 389..401
lib/fog/compute/google/mock.rb on lines 403..415
lib/fog/compute/google/mock.rb on lines 417..429
lib/fog/compute/google/mock.rb on lines 483..495
lib/fog/compute/google/mock.rb on lines 519..531
lib/fog/compute/google/mock.rb on lines 552..564
lib/fog/compute/google/mock.rb on lines 585..597
lib/fog/compute/google/mock.rb on lines 621..633
lib/fog/compute/google/mock.rb on lines 654..666
lib/fog/compute/google/mock.rb on lines 687..699
lib/fog/compute/google/mock.rb on lines 720..732

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

                                        "f1-micro" => {
                                          "kind" => "compute#machineType",
                                          "id" => "4618642685664990776",
                                          "creationTimestamp" => "2013-04-25T13:32:49.088-07:00",
                                          "name" => "f1-micro",
Severity: Major
Found in lib/fog/compute/google/mock.rb and 11 other locations - About 35 mins to fix
lib/fog/compute/google/mock.rb on lines 403..415
lib/fog/compute/google/mock.rb on lines 417..429
lib/fog/compute/google/mock.rb on lines 450..462
lib/fog/compute/google/mock.rb on lines 483..495
lib/fog/compute/google/mock.rb on lines 519..531
lib/fog/compute/google/mock.rb on lines 552..564
lib/fog/compute/google/mock.rb on lines 585..597
lib/fog/compute/google/mock.rb on lines 621..633
lib/fog/compute/google/mock.rb on lines 654..666
lib/fog/compute/google/mock.rb on lines 687..699
lib/fog/compute/google/mock.rb on lines 720..732

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

                                        "g1-small" => {
                                          "kind" => "compute#machineType",
                                          "id" => "7224129552184485774",
                                          "creationTimestamp" => "2013-04-25T13:32:45.550-07:00",
                                          "name" => "g1-small",
Severity: Major
Found in lib/fog/compute/google/mock.rb and 11 other locations - About 35 mins to fix
lib/fog/compute/google/mock.rb on lines 389..401
lib/fog/compute/google/mock.rb on lines 417..429
lib/fog/compute/google/mock.rb on lines 450..462
lib/fog/compute/google/mock.rb on lines 483..495
lib/fog/compute/google/mock.rb on lines 519..531
lib/fog/compute/google/mock.rb on lines 552..564
lib/fog/compute/google/mock.rb on lines 585..597
lib/fog/compute/google/mock.rb on lines 621..633
lib/fog/compute/google/mock.rb on lines 654..666
lib/fog/compute/google/mock.rb on lines 687..699
lib/fog/compute/google/mock.rb on lines 720..732

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

  module Compute
    class Google
      class Mock
        def list_disks(_zone_name, _opts = {})
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_disks.rb and 3 other locations - About 35 mins to fix
lib/fog/compute/google/requests/list_addresses.rb on lines 2..23
lib/fog/compute/google/requests/list_forwarding_rules.rb on lines 2..20
lib/fog/compute/google/requests/list_instance_group_managers.rb on lines 2..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 34.

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

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

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

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

Refactorings

Further Reading

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

                                        "n1-standard-1" => {
                                          "kind" => "compute#machineType",
                                          "id" => "12907738072351752276",
                                          "creationTimestamp" => "2012-06-07T13:48:14.670-07:00",
                                          "name" => "n1-standard-1",
Severity: Major
Found in lib/fog/compute/google/mock.rb and 11 other locations - About 35 mins to fix
lib/fog/compute/google/mock.rb on lines 389..401
lib/fog/compute/google/mock.rb on lines 403..415
lib/fog/compute/google/mock.rb on lines 417..429
lib/fog/compute/google/mock.rb on lines 450..462
lib/fog/compute/google/mock.rb on lines 483..495
lib/fog/compute/google/mock.rb on lines 519..531
lib/fog/compute/google/mock.rb on lines 552..564
lib/fog/compute/google/mock.rb on lines 585..597
lib/fog/compute/google/mock.rb on lines 654..666
lib/fog/compute/google/mock.rb on lines 687..699
lib/fog/compute/google/mock.rb on lines 720..732

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

                                        "n1-standard-8" => {
                                          "kind" => "compute#machineType",
                                          "id" => "12908560197989714867",
                                          "creationTimestamp" => "2012-06-07T13:50:42.334-07:00",
                                          "name" => "n1-standard-8",
Severity: Major
Found in lib/fog/compute/google/mock.rb and 11 other locations - About 35 mins to fix
lib/fog/compute/google/mock.rb on lines 389..401
lib/fog/compute/google/mock.rb on lines 403..415
lib/fog/compute/google/mock.rb on lines 417..429
lib/fog/compute/google/mock.rb on lines 450..462
lib/fog/compute/google/mock.rb on lines 483..495
lib/fog/compute/google/mock.rb on lines 519..531
lib/fog/compute/google/mock.rb on lines 552..564
lib/fog/compute/google/mock.rb on lines 585..597
lib/fog/compute/google/mock.rb on lines 621..633
lib/fog/compute/google/mock.rb on lines 654..666
lib/fog/compute/google/mock.rb on lines 687..699

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

                                        "n1-highmem-4" => {
                                          "kind" => "compute#machineType",
                                          "id" => "13043552263604939569",
                                          "creationTimestamp" => "2012-11-16T11:42:08.983-08:00",
                                          "name" => "n1-highmem-4",
Severity: Major
Found in lib/fog/compute/google/mock.rb and 11 other locations - About 35 mins to fix
lib/fog/compute/google/mock.rb on lines 389..401
lib/fog/compute/google/mock.rb on lines 403..415
lib/fog/compute/google/mock.rb on lines 417..429
lib/fog/compute/google/mock.rb on lines 450..462
lib/fog/compute/google/mock.rb on lines 483..495
lib/fog/compute/google/mock.rb on lines 519..531
lib/fog/compute/google/mock.rb on lines 585..597
lib/fog/compute/google/mock.rb on lines 621..633
lib/fog/compute/google/mock.rb on lines 654..666
lib/fog/compute/google/mock.rb on lines 687..699
lib/fog/compute/google/mock.rb on lines 720..732

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

  module Compute
    class Google
      class Mock
        def list_instance_group_managers(_zone, _opts = {})
          # :no-coverage:
lib/fog/compute/google/requests/list_addresses.rb on lines 2..23
lib/fog/compute/google/requests/list_disks.rb on lines 2..23
lib/fog/compute/google/requests/list_forwarding_rules.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 34.

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

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

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

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

Refactorings

Further Reading

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

  module DNS
    class Google
      class Real
        include Fog::Google::Shared

Severity: Minor
Found in lib/fog/dns/google/real.rb and 1 other location - About 35 mins to fix
lib/fog/google/monitoring/real.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 34.

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

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

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

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

Refactorings

Further Reading

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

  module Google
    class Monitoring
      class Real
        include Fog::Google::Shared

Severity: Minor
Found in lib/fog/google/monitoring/real.rb and 1 other location - About 35 mins to fix
lib/fog/dns/google/real.rb on lines 2..14

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

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

  module Compute
    class Google
      class Mock
        def list_addresses(_region_name, _opts = {})
          # :no-coverage:
Severity: Major
Found in lib/fog/compute/google/requests/list_addresses.rb and 3 other locations - About 35 mins to fix
lib/fog/compute/google/requests/list_disks.rb on lines 2..23
lib/fog/compute/google/requests/list_forwarding_rules.rb on lines 2..20
lib/fog/compute/google/requests/list_instance_group_managers.rb on lines 2..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 34.

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

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

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

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

Refactorings

Further Reading

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

  module DNS
    class Google
      ##
      # Enumerates Resource Record Sets that have been created but not yet deleted.
      #
Severity: Minor
Found in lib/fog/dns/google/requests/list_resource_record_sets.rb and 1 other location - About 35 mins to fix
lib/fog/dns/google/requests/list_changes.rb on lines 2..24

Duplicated Code

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

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

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

Tuning

This issue has a mass of 34.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language