fog/fog-profitbricks

View on GitHub
lib/fog/profitbricks/compute.rb

Summary

Maintainability
F
1 wk
Test Coverage

Method data has 1040 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def self.data
          dc1_id   = Fog::UUID.uuid
          dc2_id   = Fog::UUID.uuid
          serv1_id = Fog::UUID.uuid
          vol1_id  = Fog::UUID.uuid
Severity: Major
Found in lib/fog/profitbricks/compute.rb - About 5 days to fix

    File compute.rb has 1246 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Fog
      module Compute
        class ProfitBricks < Fog::Service
          API_VERSION = 'v4'.freeze
    
    
    Severity: Major
    Found in lib/fog/profitbricks/compute.rb - About 3 days to fix

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

                        {
                          'id'        => req2_id,
                          'type'      => 'request',
                          'href'      => "https=>//api.profitbricks.com/rest/v2/requests/#{req2_id}",
                          'metadata'  => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 842..870

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

      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

                        {
                          'id'        => req1_id,
                          'type'      => 'request',
                          'href'      => "https=>//api.profitbricks.com/rest/v2/requests/#{req1_id}",
                          'metadata'  => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 873..901

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

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

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

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

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

      Refactorings

      Further Reading

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

                            'bootVolume'    => {
                              'id'          => 'c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1',
                              'type'        => 'volume',
                              'href'        => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1",
                              'metadata'    => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 360..389

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

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

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

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

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

      Refactorings

      Further Reading

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

                                {
                                  'id'          => 'c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1',
                                  'type'        => 'volume',
                                  'href'        => "https=>//api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/volumes/c04a2198-7e60-4bc0-b869-6e9c9dbcb8e1",
                                  'metadata'    => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 313..342

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

      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

                        {
                          'id'    => fwr1_id,
                          'type'  => 'firewall-rule',
                          'href'  => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}/firewallrules/#{fwr1_id}",
                          'metadata' => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 1006..1031

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

      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

                        {
                          'id'    => fwr2_id,
                          'type'  => 'firewall-rule',
                          'href'  => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}/servers/#{serv1_id}/nics/#{nic1_id}/firewallrules/#{fwr2_id}",
                          'metadata' => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 979..1004

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

      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

                        {
                          'id'              => 'dfcb40db-28b5-11e6-9336-52540005ab80',
                          'type'            => 'image',
                          'href'            => 'https=>//api.profitbricks.com/rest/v2/images/dfcb40db-28b5-11e6-9336-52540005ab80',
                          'metadata'        => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 3 other locations - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 540..569
      lib/fog/profitbricks/compute.rb on lines 572..601
      lib/fog/profitbricks/requests/compute/create_server.rb on lines 224..253

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

      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

                        {
                          'id'              => 'dfcb40db-28b5-11e6-9336-52540005ab80',
                          'type'            => 'image',
                          'href'            => 'https=>//api.profitbricks.com/rest/v2/images/dfcb40db-28b5-11e6-9336-52540005ab80',
                          'metadata'        => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 3 other locations - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 508..537
      lib/fog/profitbricks/compute.rb on lines 572..601
      lib/fog/profitbricks/requests/compute/create_server.rb on lines 224..253

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

      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

                        {
                          'id'              => '05cadf29-6c12-11e4-beeb-52540066fee9',
                          'type'            => 'image',
                          'href'            => 'https=>//api.profitbricks.com/rest/v2/images/05cadf29-6c12-11e4-beeb-52540066fee9',
                          'metadata'        => {
      Severity: Major
      Found in lib/fog/profitbricks/compute.rb and 3 other locations - About 1 hr to fix
      lib/fog/profitbricks/compute.rb on lines 508..537
      lib/fog/profitbricks/compute.rb on lines 540..569
      lib/fog/profitbricks/requests/compute/create_server.rb on lines 224..253

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

      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

                        {
                          'id' => ipb1_id,
                          'type' => 'ipblock',
                          'href' => "https://api.profitbricks.com/cloudapi/v4/um/resources/ipblock/#{ipb1_id}",
                          'metadata' => {
      Severity: Minor
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 40 mins to fix
      lib/fog/profitbricks/compute.rb on lines 1176..1193

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

      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

                        {
                          'id'        => dc1_id,
                          'type'      => 'datacenter',
                          'href'      => "https://api.profitbricks.com/cloudapi/v4/um/resources/datacenter/#{dc1_id}",
                          'metadata'  => {
      Severity: Minor
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 40 mins to fix
      lib/fog/profitbricks/compute.rb on lines 1239..1256

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

      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

                        {
                          'id'        => dc2_id,
                          'type'      => 'datacenter',
                          'href'      => "https://api.profitbricks.com/rest/v2/datacenters/#{dc2_id}",
                          'metadata'  => {
      Severity: Minor
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 40 mins to fix
      lib/fog/profitbricks/compute.rb on lines 247..264

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

      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

                        {
                          'id'        => dc1_id,
                          'type'      => 'datacenter',
                          'href'      => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}",
                          'metadata'  => {
      Severity: Minor
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 40 mins to fix
      lib/fog/profitbricks/compute.rb on lines 267..284

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

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

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

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

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

      Refactorings

      Further Reading

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

                          'properties' => {
                            'name'                => 'Docker Registry Volume',
                            'type'                => 'HDD',
                            'size'                => 50,
                            'bus'                 => 'VIRTIO',
      Severity: Minor
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 30 mins to fix
      lib/fog/profitbricks/compute.rb on lines 404..420

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 33.

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

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

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

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

      Refactorings

      Further Reading

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

                        {
                          'id'              => 'dfcb40db-28b5-11e6-9336-52540005ab80',
                          'type'            => 'image',
                          'href'            => 'https://api.profitbricks.com/cloudapi/v4/um/resources/image/dfcb40db-28b5-11e6-9336-52540005ab80',
                          'metadata'        => {
      Severity: Minor
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 30 mins to fix
      lib/fog/profitbricks/compute.rb on lines 1218..1235

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 33.

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

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

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

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

      Refactorings

      Further Reading

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

                                  'properties' => {
                                    'name'                => 'Docker Registry Volume',
                                    'type'                => 'HDD',
                                    'size'                => 50,
                                    'bus'                 => 'VIRTIO',
      Severity: Minor
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 30 mins to fix
      lib/fog/profitbricks/compute.rb on lines 674..690

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 33.

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

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

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

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

      Refactorings

      Further Reading

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

                        {
                          'id'          => '3d52b13d-bec4-49de-ad05-fd2f8c687be6',
                          'type'        => 'snapshot',
                          'href'        => 'https://api.profitbricks.com/cloudapi/v4/um/resources/snapshot/3d52b13d-bec4-49de-ad05-fd2f8c687be6',
                          'metadata'    => {
      Severity: Minor
      Found in lib/fog/profitbricks/compute.rb and 1 other location - About 30 mins to fix
      lib/fog/profitbricks/compute.rb on lines 1197..1214

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 33.

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

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

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

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

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status