fog/fog-digitalocean

View on GitHub

Showing 65 of 65 total issues

Method list_flavors has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def list_flavors(filters = {})
          response        = Excon::Response.new
          response.status = 200
          response.body   = {

Severity: Major
Found in lib/fog/compute/digitalocean/requests/list_flavors.rb - About 4 hrs to fix

    Class Server has 26 methods (exceeds 20 allowed). Consider refactoring.
    Open

          class Server < Fog::Compute::Server
            identity :id
            attribute :name
            attribute :memory
            attribute :vcpus
    Severity: Minor
    Found in lib/fog/compute/digitalocean/models/server.rb - About 3 hrs to fix

      Method list_regions has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def list_regions(filters = {})
                response        = Excon::Response.new
                response.status = 200
                response.body   = {
                  'regions' => [
      Severity: Major
      Found in lib/fog/compute/digitalocean/requests/list_regions.rb - About 2 hrs to fix

        Method get_server_details has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def get_server_details(_)
                  response        = Excon::Response.new
                  response.status = 200
        
                  response.body = {
        Severity: Major
        Found in lib/fog/compute/digitalocean/requests/get_server_details.rb - About 2 hrs to fix

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

          Method list_volume_actions has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def list_volume_actions(id)
                    response        = Excon::Response.new
                    response.status = 201
                    response.body   = {
                      "actions" => [
          Severity: Minor
          Found in lib/fog/compute/digitalocean/requests/list_volume_actions.rb - About 1 hr to fix

            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 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 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 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 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 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 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 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_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

            Severity
            Category
            Status
            Source
            Language