Showing 460 of 460 total issues

Method post_update_catalog_item_metadata has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def post_update_catalog_item_metadata(id, metadata={})
          body = Nokogiri::XML::Builder.new do
            attrs = {
              :xmlns => 'http://www.vmware.com/vcloud/v1.5',
              'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method post_update_vapp_metadata has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def post_update_vapp_metadata(id, metadata={})
          body = Nokogiri::XML::Builder.new do
            attrs = {
              :xmlns => 'http://www.vmware.com/vcloud/v1.5',
              'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method all has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def all
          self.href = service.default_vdc_href unless self.href
          data = nil
          if self.href =~ /\/vdc\//
            check_href!("Vdc")
Severity: Minor
Found in lib/fog/vcloud/models/compute/networks.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method slurp has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def self.slurp(error, service=nil)
          major_error_code = nil
          message = nil
          minor_error_code = nil
          stack_trace = nil
Severity: Minor
Found in lib/fog/vcloud_director/core.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method post_update_disk_metadata has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def post_update_disk_metadata(id, metadata={})
          body = Nokogiri::XML::Builder.new do
            attrs = {
              :xmlns => 'http://www.vmware.com/vcloud/v1.5',
              'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method start has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def start
        if is_running?
            message="VNC server already running"
            STDERR.puts message
            @logger.info message
Severity: Minor
Found in lib/fog/opennebula/requests/compute/OpenNebulaVNC.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method post_update_media_metadata has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        def post_update_media_metadata(id, metadata={})
          body = Nokogiri::XML::Builder.new do
            attrs = {
              :xmlns => 'http://www.vmware.com/vcloud/v1.5',
              'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method slurp has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def self.slurp(error, service=nil)
          major_error_code = nil
          message = nil
          minor_error_code = nil
          stack_trace = nil
Severity: Minor
Found in lib/fog/vcloud_director/core.rb - About 1 hr to fix

    Method parse_end_element has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

              def parse_end_element(name, vm)
                case name
                when 'IpAddress'
                  vm[:ip_address] = value
                when 'Description'
    Severity: Minor
    Found in lib/fog/vcloud_director/parsers/compute/vm_parser_helper.rb - About 1 hr to fix

      Method get_current_session has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              def get_current_session
                body =
                  {:href => make_href('session/'),
                   :type => 'application/vnd.vmware.vcloud.session+xml',
                   :org => data[:org][:name],
      Severity: Minor
      Found in lib/fog/vcloud_director/requests/compute/get_current_session.rb - About 1 hr to fix

        Method [] has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def [](service)
              @@connections ||= Hash.new do |hash, key|
                hash[key] = case key
                when :compute
                  Fog::Logger.warning("OpenStack[:compute] is not recommended, use Compute[:openstack] for portability")
        Severity: Minor
        Found in lib/fog/bin/openstack.rb - About 1 hr to fix

          Method class_for has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def class_for(key)
                case key
                when :auto_scale
                  Fog::Rackspace::AutoScale
                when :block_storage
          Severity: Minor
          Found in lib/fog/bin/rackspace.rb - About 1 hr to fix

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

              class << self
                def class_for(key)
                  case key
                  when :dns
                    Fog::DNS::Dreamhost
            Severity: Major
            Found in lib/fog/bin/dreamhost.rb and 3 other locations - About 1 hr to fix
            lib/fog/bin/clodo.rb on lines 2..26
            lib/fog/bin/dnsmadeeasy.rb on lines 2..26
            lib/fog/bin/rage4.rb on lines 2..26

            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

              class << self
                def class_for(key)
                  case key
                  when :dns
                    Fog::DNS::Rage4
            Severity: Major
            Found in lib/fog/bin/rage4.rb and 3 other locations - About 1 hr to fix
            lib/fog/bin/clodo.rb on lines 2..26
            lib/fog/bin/dnsmadeeasy.rb on lines 2..26
            lib/fog/bin/dreamhost.rb on lines 2..26

            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

              class << self
                def class_for(key)
                  case key
                  when :compute
                    Fog::Compute::Clodo
            Severity: Major
            Found in lib/fog/bin/clodo.rb and 3 other locations - About 1 hr to fix
            lib/fog/bin/dnsmadeeasy.rb on lines 2..26
            lib/fog/bin/dreamhost.rb on lines 2..26
            lib/fog/bin/rage4.rb on lines 2..26

            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

              class << self
                def class_for(key)
                  case key
                  when :dns
                    Fog::DNS::DNSMadeEasy
            Severity: Major
            Found in lib/fog/bin/dnsmadeeasy.rb and 3 other locations - About 1 hr to fix
            lib/fog/bin/clodo.rb on lines 2..26
            lib/fog/bin/dreamhost.rb on lines 2..26
            lib/fog/bin/rage4.rb on lines 2..26

            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

            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

              Method post_update_vapp_metadata has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def post_update_vapp_metadata(id, metadata={})
                        body = Nokogiri::XML::Builder.new do
                          attrs = {
                            :xmlns => 'http://www.vmware.com/vcloud/v1.5',
                            'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'

                Method post_update_catalog_item_metadata has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        def post_update_catalog_item_metadata(id, metadata={})
                          body = Nokogiri::XML::Builder.new do
                            attrs = {
                              :xmlns => 'http://www.vmware.com/vcloud/v1.5',
                              'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'

                  Method post_update_disk_metadata has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def post_update_disk_metadata(id, metadata={})
                            body = Nokogiri::XML::Builder.new do
                              attrs = {
                                :xmlns => 'http://www.vmware.com/vcloud/v1.5',
                                'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'
                    Severity
                    Category
                    Status
                    Source
                    Language