Showing 248 of 460 total issues

Method put_vapp_metadata_item_metadata has 27 lines of code (exceeds 25 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'

    Method post_configure_edge_gateway_services has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def post_configure_edge_gateway_services(id, configuration)
              unless data[:edge_gateways][id]
                raise Fog::Compute::VcloudDirector::Forbidden.new(
                          "No access to entity \"(com.vmware.vcloud.entity.edgegateway:#{id})\"."
                      )

      Method put_catalog_item_metadata_item_metadata has 27 lines of code (exceeds 25 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'

        Method proxy has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def proxy(vm_resource)
                # Check configurations and VM attributes
                #if !is_running?
                #    return error(400, "VNC Proxy is not running")
                #end
        Severity: Minor
        Found in lib/fog/opennebula/requests/compute/OpenNebulaVNC.rb - About 1 hr to fix

          Method get_catalog has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  def get_catalog(id)
                    unless catalog = data[:catalogs][id]
                      raise Fog::Compute::VcloudDirector::Forbidden.new(
                        "No access to entity \"(com.vmware.vcloud.entity.catalog:#{id})\"."
                      )
          Severity: Minor
          Found in lib/fog/vcloud_director/requests/compute/get_catalog.rb - About 1 hr to fix

            Method post_clone_vapp has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def post_clone_vapp(vdc_id, name, source_id, 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_clone_vapp.rb - About 1 hr to fix

              Method get_mock_vm_body has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def get_mock_vm_body(id)
                        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/get_vapp.rb - About 1 hr to fix

                Method end_element has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                          def end_element(name)
                            case name
                            when 'Enabled'
                              @response[:enabled] = (value == "true")
                            when 'ChangeSid'
                Severity: Minor
                Found in lib/fog/vcloud_director/parsers/compute/vm_customization.rb - About 1 hr to fix

                  Method get_edge_gateway has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def get_edge_gateway(id)
                            response = request(
                                :expects => 200,
                                :idempotent => true,
                                :method => 'GET',
                  Severity: Minor
                  Found in lib/fog/vcloud_director/requests/compute/get_edge_gateway.rb - About 1 hr to fix

                    Method available? has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def available?
                            availability = true
                            for service in services
                              begin
                                service = self.class_for(service)
                    Severity: Minor
                    Found in lib/fog/bin.rb - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                if self.identity
                                  options = {
                                    :serverid => self.identity,
                                    :disksize => disksize,
                                    :memorysize => memorysize,
                      Severity: Major
                      Found in lib/fog/glesys/models/compute/server.rb - About 1 hr to fix

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

                                  def end_element(name)
                                    parse_end_element name, @response[:vm]
                                    case name
                                    when 'IpAddress'
                                      @response[:vm][:ip_address] = value
                        Severity: Minor
                        Found in lib/fog/vcloud_director/parsers/compute/vm.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 update_record has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def update_record(record_id, name, content, type, options = {})
                                  path = "/rapi/updaterecord/#{record_id}"
                                  path << "?name=#{name}&content=#{content}&type=#{type}"
                        
                                  path << "&priority=#{options[:priority]}" if options[:priority]
                        Severity: Minor
                        Found in lib/fog/rage4/requests/dns/update_record.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 create_record has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def create_record(domain_id, name, content, type, options = {})
                                  path = "/rapi/createrecord/#{domain_id}"
                                  path << "?name=#{name}&content=#{content}&type=#{type}"
                        
                                  path << "&priority=#{options[:priority]}" if options[:priority]
                        Severity: Minor
                        Found in lib/fog/rage4/requests/dns/create_record.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 save has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def save
                                  if self.identity
                                    options = {
                                      :serverid => self.identity,
                                      :disksize => disksize,
                        Severity: Minor
                        Found in lib/fog/glesys/models/compute/server.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 create_server has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def create_server(image_id, options = {})
                                  data = {
                                    'server' => {
                                      :vps_os   => image_id,
                                      :vps_hdd => options[:vps_hdd]?options[:vps_hdd]:5,
                        Severity: Minor
                        Found in lib/fog/clodo/requests/compute/create_server.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 parse_end_element has a Cognitive Complexity of 9 (exceeds 5 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 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 do_request has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def do_request(params)
                                  # Convert the uri to a URI if it's a string.
                                  if params[:uri].is_a?(String)
                                    params[:uri] = URI.parse(params[:uri])
                                  end
                        Severity: Minor
                        Found in lib/fog/vcloud/compute.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 build_vapp_instantiation_params has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                                  def build_vapp_instantiation_params(xml)
                                    xml.Description @configuration[:Description] if @configuration[:Description]
                                    
                                    vapp = @configuration[:InstantiationParams]
                                    if vapp 
                        Severity: Minor
                        Found in lib/fog/vcloud_director/generators/compute/compose_common.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 save has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                                def save
                                  requires :name, :type, :value
                                  options = {}
                                  options[:priority] = priority if priority
                                  options[:ttl]  = ttl if ttl
                        Severity: Minor
                        Found in lib/fog/rage4/models/dns/record.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

                        Severity
                        Category
                        Status
                        Source
                        Language