fog/fog-digitalocean

View on GitHub

Showing 47 of 65 total issues

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

  module Compute
    class DigitalOcean
      class Real
        def snapshot(id, name)
          body = { :type => "snapshot", :name => name }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/snapshot.rb and 4 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/change_kernel.rb on lines 2..39
lib/fog/compute/digitalocean/requests/rebuild.rb on lines 2..39
lib/fog/compute/digitalocean/requests/rename.rb on lines 2..39
lib/fog/compute/digitalocean/requests/restore.rb on lines 2..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 72.

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

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

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

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

Refactorings

Further Reading

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

  module Compute
    class DigitalOcean
      class Real
        def restore(id, image)
          body = { :type => "restore", :image => image }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/restore.rb and 4 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/change_kernel.rb on lines 2..39
lib/fog/compute/digitalocean/requests/rebuild.rb on lines 2..39
lib/fog/compute/digitalocean/requests/rename.rb on lines 2..39
lib/fog/compute/digitalocean/requests/snapshot.rb on lines 2..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 72.

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

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

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

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

Refactorings

Further Reading

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

  module Compute
    class DigitalOcean
      class Real
        def rename(id, name)
          body = { :type => "rename", :name => name }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/rename.rb and 4 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/change_kernel.rb on lines 2..39
lib/fog/compute/digitalocean/requests/rebuild.rb on lines 2..39
lib/fog/compute/digitalocean/requests/restore.rb on lines 2..39
lib/fog/compute/digitalocean/requests/snapshot.rb on lines 2..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 72.

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

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

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

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

Refactorings

Further Reading

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

  module Compute
    class DigitalOcean
      class Real
        def change_kernel(id, kernel)
          body = { :type => "change_kernel", :kernel => kernel }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/change_kernel.rb and 4 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/rebuild.rb on lines 2..39
lib/fog/compute/digitalocean/requests/rename.rb on lines 2..39
lib/fog/compute/digitalocean/requests/restore.rb on lines 2..39
lib/fog/compute/digitalocean/requests/snapshot.rb on lines 2..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 72.

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

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

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

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

Refactorings

Further Reading

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

  module Compute
    class DigitalOcean
      class Real
        def rebuild(id, image)
          body = { :type => "rebuild", :image => image }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/rebuild.rb and 4 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/change_kernel.rb on lines 2..39
lib/fog/compute/digitalocean/requests/rename.rb on lines 2..39
lib/fog/compute/digitalocean/requests/restore.rb on lines 2..39
lib/fog/compute/digitalocean/requests/snapshot.rb on lines 2..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 72.

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

  module Compute
    class DigitalOcean
      class Real
        def password_reset(id)
          body = { :type => "password_reset" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/password_reset.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def upgrade(id)
          body = { :type => "upgrade" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/upgrade.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def power_on(id)
          body = { :type => "power_on" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/power_on.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def disable_backups(id)
          body = { :type => "disable_backups" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/disable_backups.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def enable_private_networking(id)
          body = { :type => "enable_private_networking" }
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def enable_ipv6(id)
          body = { :type => "enable_ipv6" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/enable_ipv6.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def power_off(id)
          body = { :type => "power_off" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/power_off.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def reboot_server(id)
          body = { :type => "reboot" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/reboot_server.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def power_cycle(id)
          body = { :type => "power_cycle" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/power_cycle.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/shutdown.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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

  module Compute
    class DigitalOcean
      class Real
        def shutdown(id)
          body = { :type => "shutdown" }
Severity: Major
Found in lib/fog/compute/digitalocean/requests/shutdown.rb and 9 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/requests/disable_backups.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_ipv6.rb on lines 2..39
lib/fog/compute/digitalocean/requests/enable_private_networking.rb on lines 2..39
lib/fog/compute/digitalocean/requests/password_reset.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_cycle.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_off.rb on lines 2..39
lib/fog/compute/digitalocean/requests/power_on.rb on lines 2..39
lib/fog/compute/digitalocean/requests/reboot_server.rb on lines 2..39
lib/fog/compute/digitalocean/requests/upgrade.rb on lines 2..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 70.

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 detach_volume(volume_id, droplet_id, region)
          body = { :type => 'detach', droplet_id: droplet_id, region: region}

          encoded_body = Fog::JSON.encode(body)
Severity: Major
Found in lib/fog/compute/digitalocean/requests/detach_volume.rb and 1 other location - About 1 hr to fix
lib/fog/compute/digitalocean/requests/attach_volume.rb on lines 4..34

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

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 attach_volume(volume_id, droplet_id, region)
          body = { :type => 'attach', droplet_id: droplet_id, region: region}

          encoded_body = Fog::JSON.encode(body)
Severity: Major
Found in lib/fog/compute/digitalocean/requests/attach_volume.rb and 1 other location - About 1 hr to fix
lib/fog/compute/digitalocean/requests/detach_volume.rb on lines 4..33

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

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 detach_volume_by_name(volume_name, droplet_id, region)
          response         = Excon::Response.new
          response.status  = 201
                    response.body    = {
                        "action" => {
Severity: Major
Found in lib/fog/compute/digitalocean/requests/detach_volume.rb and 1 other location - About 1 hr to fix
lib/fog/compute/digitalocean/requests/detach_volume.rb on lines 38..76

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

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 detach_volume(volume_id, droplet_id, region)
          response         = Excon::Response.new
          response.status  = 201
                    response.body    = {
                        "action" => {
Severity: Major
Found in lib/fog/compute/digitalocean/requests/detach_volume.rb and 1 other location - About 1 hr to fix
lib/fog/compute/digitalocean/requests/detach_volume.rb on lines 78..116

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

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 Fog
  module Compute
    class DigitalOcean
      class Volumes < Fog::Compute::DigitalOcean::PagingCollection
        model Fog::Compute::DigitalOcean::Volume
Severity: Major
Found in lib/fog/compute/digitalocean/models/volumes.rb and 3 other locations - About 1 hr to fix
lib/fog/compute/digitalocean/models/images.rb on lines 3..36
lib/fog/compute/digitalocean/models/servers.rb on lines 5..38
lib/fog/compute/digitalocean/models/ssh_keys.rb on lines 3..35

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

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