Showing 248 of 460 total issues

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 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 create_record has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            def create_record(domain_id, name, content, type, options = {})
    Severity: Minor
    Found in lib/fog/rage4/requests/dns/create_record.rb - About 35 mins to fix

      Method create_instance has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def create_instance(name, image_id, instance_type, location, options)
      Severity: Minor
      Found in lib/fog/ibm/core.rb - About 35 mins to fix

        Method create_volume has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                def create_volume(name, offering_id, format, location_id, size)
        Severity: Minor
        Found in lib/fog/ibm/requests/storage/create_volume.rb - About 35 mins to fix

          Method create_instance has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def create_instance(name, image_id, instance_type, location, options={})
          Severity: Minor
          Found in lib/fog/ibm/requests/compute/create_instance.rb - About 35 mins to fix

            Method post_upload_media has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    def post_upload_media(vdc_id, name, image_type, size, options={})
            Severity: Minor
            Found in lib/fog/vcloud_director/requests/compute/post_upload_media.rb - About 35 mins to fix

              Method create_volume has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      def create_volume(name, format, location_id, size, offering_id)
              Severity: Minor
              Found in lib/fog/ibm/core.rb - About 35 mins to fix

                Method grid_server_add has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def grid_server_add(image, ip, name, server_ram, options={})
                Severity: Minor
                Found in lib/fog/go_grid/requests/compute/grid_server_add.rb - About 35 mins to fix

                  Method create_volume has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def create_volume(name, offering_id, format, location_id, size)
                  Severity: Minor
                  Found in lib/fog/ibm/requests/storage/create_volume.rb - About 35 mins to fix

                    Method update_record has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            def update_record(record_id, name, content, type, options = {})
                    Severity: Minor
                    Found in lib/fog/rage4/requests/dns/update_record.rb - About 35 mins to fix

                      Method create_instance has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              def create_instance(name, image_id, instance_type, location, options={})
                      Severity: Minor
                      Found in lib/fog/ibm/requests/compute/create_instance.rb - About 35 mins to fix

                        Method post_upload_media has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                def post_upload_media(vdc_id, name, image_type, size, options={})
                        Severity: Minor
                        Found in lib/fog/vcloud_director/requests/compute/post_upload_media.rb - About 35 mins to fix

                          Method add_nic has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  def add_nic(vlan=nil, ip_v4_conf=nil, ip_v6_conf=nil, model='virtio', boot_order=nil)
                          Severity: Minor
                          Found in lib/fog/cloudsigma/models/server.rb - About 35 mins to fix

                            Method create_record has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    def create_record(domain, name, type, data, options = {})
                            Severity: Minor
                            Found in lib/fog/dnsmadeeasy/requests/dns/create_record.rb - About 35 mins to fix

                              Method linode_disk_createfromdistribution has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      def linode_disk_createfromdistribution(linode_id, distro_id, name, size, password)
                              Severity: Minor
                              Found in lib/fog/linode/requests/compute/linode_disk_createfromdistribution.rb - About 35 mins to fix

                                Method mock_update has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        def mock_update(data, obj_or_collection, status, key, &clean_before_update)
                                Severity: Minor
                                Found in lib/fog/cloudsigma/connection.rb - About 35 mins to fix

                                  Method linode_disk_createfromdistribution has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          def linode_disk_createfromdistribution(linode_id, distro_id, name, size, password)
                                  Severity: Minor
                                  Found in lib/fog/linode/requests/compute/linode_disk_createfromdistribution.rb - About 35 mins to fix

                                    Method extract_attributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      def extract_attributes(attributes_xml)
                                        attributes = {}
                                        until attributes_xml.empty?
                                          if attributes_xml.first.is_a?(Array)
                                            until attributes_xml.first.empty?
                                    Severity: Minor
                                    Found in lib/fog/vcloud_director/compute.rb - About 35 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 non_running? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                            def non_running?
                                              if @service.show_progress? && (@last_progress ||= 0) < 100
                                                if status == 'running' || status == 'queued'
                                                  Fog::Formatador.redisplay_progressbar(progress, 100, :label => operation_name, :started_at => start_time)
                                                  @last_progress = progress
                                    Severity: Minor
                                    Found in lib/fog/vcloud_director/models/compute/task.rb - About 35 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