lib/fog/ibm/compute.rb

Summary

Maintainability
C
1 day
Test Coverage

Method populate_locations has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def self.populate_locations
          locations = {}
          locations["41"] = {
            "state"=>1,
            "location"=>"RTP",
Severity: Major
Found in lib/fog/ibm/compute.rb - About 2 hrs to fix

    Method populate_images has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def self.populate_images
              images = {}
              images["20010001"] = {
                "name"=>"SUSE Linux Enterprise Server 11 SP1 for x86",
                "manifest"=>"https://www-147.ibm.com/cloud/enterprise/ram.ws/RAMSecure/artifact/{6CD09CE4-E99B-D72F-6C29-233C9B2A1676}/1.0/parameters.xml",
    Severity: Minor
    Found in lib/fog/ibm/compute.rb - About 1 hr to fix

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

            class Real
              def initialize(options={})
                @connection = Fog::IBM::Connection.new(options[:ibm_username], options[:ibm_password])
              end
      
      
      Severity: Minor
      Found in lib/fog/ibm/compute.rb and 1 other location - About 55 mins to fix
      lib/fog/ibm/storage.rb on lines 25..42

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

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

                locations["61"] = {
                  "state"=>1,
                  "location"=>"EHN",
                  "capabilities"=>[
                    {"entries"=>{"EXT3"=>["ext3"], "RAW"=>["raw"]}, "id"=>"oss.storage.format"},
      Severity: Major
      Found in lib/fog/ibm/compute.rb and 5 other locations - About 50 mins to fix
      lib/fog/ibm/compute.rb on lines 153..163
      lib/fog/ibm/compute.rb on lines 177..187
      lib/fog/ibm/compute.rb on lines 189..199
      lib/fog/ibm/compute.rb on lines 201..211
      lib/fog/ibm/compute.rb on lines 213..223

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

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

                locations["101"] = {
                  "state"=>1,
                  "location"=>"ca-on-dc1",
                  "capabilities"=>[
                    {"entries"=>{"EXT3"=>["ext3"], "RAW"=>["raw"]}, "id"=>"oss.storage.format"},
      Severity: Major
      Found in lib/fog/ibm/compute.rb and 5 other locations - About 50 mins to fix
      lib/fog/ibm/compute.rb on lines 153..163
      lib/fog/ibm/compute.rb on lines 165..175
      lib/fog/ibm/compute.rb on lines 177..187
      lib/fog/ibm/compute.rb on lines 201..211
      lib/fog/ibm/compute.rb on lines 213..223

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

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

                locations["121"] = {
                  "state"=>1,
                  "location"=>"ap-jp-dc1",
                  "capabilities"=>[
                    {"entries"=>{"EXT3"=>["ext3"], "RAW"=>["raw"]}, "id"=>"oss.storage.format"},
      Severity: Major
      Found in lib/fog/ibm/compute.rb and 5 other locations - About 50 mins to fix
      lib/fog/ibm/compute.rb on lines 153..163
      lib/fog/ibm/compute.rb on lines 165..175
      lib/fog/ibm/compute.rb on lines 177..187
      lib/fog/ibm/compute.rb on lines 189..199
      lib/fog/ibm/compute.rb on lines 213..223

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

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

                locations["82"] = {
                  "state"=>1,
                  "location"=>"us-co-dc1",
                  "capabilities"=>[
                    {"entries"=>{"EXT3"=>["ext3"], "RAW"=>["raw"]}, "id"=>"oss.storage.format"},
      Severity: Major
      Found in lib/fog/ibm/compute.rb and 5 other locations - About 50 mins to fix
      lib/fog/ibm/compute.rb on lines 153..163
      lib/fog/ibm/compute.rb on lines 165..175
      lib/fog/ibm/compute.rb on lines 189..199
      lib/fog/ibm/compute.rb on lines 201..211
      lib/fog/ibm/compute.rb on lines 213..223

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

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

                locations["141"] = {
                  "state"=>1,
                  "location"=>"ap-sg-dc1",
                  "capabilities"=>[
                    {"entries"=>{"EXT3"=>["ext3"], "RAW"=>["raw"]}, "id"=>"oss.storage.format"},
      Severity: Major
      Found in lib/fog/ibm/compute.rb and 5 other locations - About 50 mins to fix
      lib/fog/ibm/compute.rb on lines 153..163
      lib/fog/ibm/compute.rb on lines 165..175
      lib/fog/ibm/compute.rb on lines 177..187
      lib/fog/ibm/compute.rb on lines 189..199
      lib/fog/ibm/compute.rb on lines 201..211

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

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

                locations["41"] = {
                  "state"=>1,
                  "location"=>"RTP",
                  "capabilities"=>[
                    {"entries"=>{"EXT3"=>["ext3"], "RAW"=>["raw"]}, "id"=>"oss.storage.format"},
      Severity: Major
      Found in lib/fog/ibm/compute.rb and 5 other locations - About 50 mins to fix
      lib/fog/ibm/compute.rb on lines 165..175
      lib/fog/ibm/compute.rb on lines 177..187
      lib/fog/ibm/compute.rb on lines 189..199
      lib/fog/ibm/compute.rb on lines 201..211
      lib/fog/ibm/compute.rb on lines 213..223

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

      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