Showing 248 of 460 total issues

Method stop has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def stop(force=false)
        pid=get_pid

        if pid
            @logger.info "Killing VNC proxy"
Severity: Minor
Found in lib/fog/opennebula/requests/compute/OpenNebulaVNC.rb - About 55 mins 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 auth_header has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

        def auth_header(type = :basic)
          case type
            when :basic
              unless @username and @password
                raise ArgumentError, 'Username and password required for basic auth'
Severity: Minor
Found in lib/fog/cloudsigma/connection.rb - About 55 mins 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 configure_org_network has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def configure_org_network(vapp_id, vapp_network, vapp_network_uri, org_network, org_network_uri, enable_firewall=false, port_map=nil)
Severity: Major
Found in lib/fog/vcloud/requests/compute/configure_org_network.rb - About 50 mins to fix

    Method generate_configure_org_network_request has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def generate_configure_org_network_request(vapp_id, vapp_network, vapp_network_uri, org_network, org_network_uri, enable_firewall=false, portmap=nil)
    Severity: Major
    Found in lib/fog/vcloud/requests/compute/configure_org_network.rb - About 50 mins to fix

      Method linode_disk_createfromstackscript has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def linode_disk_createfromstackscript(linode_id, script_id, distro_id, name, size, password, options={})
      Severity: Major
      Found in lib/fog/linode/requests/compute/linode_disk_createfromstackscript.rb - About 50 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                            if ipRange = ipRanges[:IpRange]
                                              xml.IpRange {
                                                xml.StartAddress ipRange[:StartAddress]
                                                xml.EndAddress ipRange[:EndAddress]
                                              }
        Severity: Major
        Found in lib/fog/vcloud_director/generators/compute/network_config_section.rb - About 45 mins to fix

          Method put_media_metadata_item_metadata has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

                  def put_media_metadata_item_metadata(id, key, value)
                    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

          Avoid deeply nested control flow statements.
          Open

                                            if h.key?(:IpRange)
                                              IpRange {
                                                StartAddress h[:IpRange][:StartAddress]
                                                EndAddress   h[:IpRange][:EndAddress]
                                              }
          Severity: Major
          Found in lib/fog/vcloud_director/generators/compute/org_vdc_network.rb - About 45 mins to fix

            Method put_vapp_template_metadata_item_metadata has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    def put_vapp_template_metadata_item_metadata(id, key, value)
                      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 build_vpn has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                      def build_vpn(xml)
                        vpn_config = @configuration[:GatewayIpsecVpnService]
                        return unless vpn_config
            
                        xml.GatewayIpsecVpnService {

            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_create_catalog_item has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    def post_create_catalog_item(id, name, entity, options={})
                      body = Nokogiri::XML::Builder.new do
                        attrs = {
                          :xmlns => 'http://www.vmware.com/vcloud/v1.5',
                          :name => name,
            Severity: Minor
            Found in lib/fog/vcloud_director/requests/compute/post_create_catalog_item.rb - About 45 mins 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 put_catalog_item_metadata_item_metadata has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    def put_catalog_item_metadata_item_metadata(id, key, value)
                      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 request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    def request(params)
                      params[:query] ||= {}
                      params[:query].merge!(:api_key => @linode_api_key)
            
                      response = @connection.request(params)
            Severity: Minor
            Found in lib/fog/linode/dns.rb - About 45 mins 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 linode_disk_createfromimage has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def linode_disk_createfromimage(linode_id, image_id, label, size, password, sshkey)
            Severity: Minor
            Found in lib/fog/linode/requests/compute/linode_disk_createfromimage.rb - About 45 mins to fix

              Method post_reconfigure_vm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      def post_reconfigure_vm(id, options={})
                        unless vm = data[:vms][id]
                          raise Fog::Compute::VcloudDirector::Forbidden.new(
                            'This operation is denied.'
                          )
              Severity: Minor
              Found in lib/fog/vcloud_director/requests/compute/post_reconfigure_vm.rb - About 45 mins 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 request has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                      def request(params)
                        params[:query] ||= {}
                        params[:query].merge!(:api_key => @linode_api_key)
              
                        response = @connection.request(params)
              Severity: Minor
              Found in lib/fog/linode/compute.rb - About 45 mins 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

              Avoid deeply nested control flow statements.
              Open

                                if controller >= max_ctlr
                                  raise Fog::CloudSigma::Errors::Error.new("Max channel reached, cannot attach more")
                                end
              Severity: Major
              Found in lib/fog/cloudsigma/models/server.rb - About 45 mins to fix

                Method put_vapp_metadata_item_metadata has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                        def put_vapp_metadata_item_metadata(id, key, value)
                          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 mock_create has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def mock_create(collection, status, data, key, defaults={}, &clean_before_store)
                Severity: Minor
                Found in lib/fog/cloudsigma/connection.rb - About 45 mins to fix

                  Method linode_disk_createfromimage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def linode_disk_createfromimage(linode_id, image_id, label, size, password, sshkey)
                  Severity: Minor
                  Found in lib/fog/linode/requests/compute/linode_disk_createfromimage.rb - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language