fog/fog-openstack

View on GitHub

Showing 156 of 616 total issues

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

          def create_user(name, password, email, tenantId = nil, enabled = true)
Severity: Minor
Found in lib/fog/openstack/identity/v2/requests/create_user.rb - About 35 mins to fix

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

            def put_object(container, object, data, options = {}, &block)
    Severity: Minor
    Found in lib/fog/openstack/storage/requests/put_object.rb - About 35 mins to fix

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

              def create_lb_vip(subnet_id, pool_id, protocol, protocol_port, options = {})
      Severity: Minor
      Found in lib/fog/openstack/network/requests/create_lb_vip.rb - About 35 mins to fix

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

                def create_lb_health_monitor(type, delay, timeout, max_retries, options = {})
        Severity: Minor
        Found in lib/fog/openstack/network/requests/create_lb_health_monitor.rb - About 35 mins to fix

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

                  def rebuild(image_ref, name, admin_pass = nil, metadata = nil, personality = nil)
          Severity: Minor
          Found in lib/fog/openstack/compute/models/server.rb - About 35 mins to fix

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

                    def create_lbaas_healthmonitor(type, delay, timeout, max_retries, options = {})
            Severity: Minor
            Found in lib/fog/openstack/network/requests/create_lbaas_healthmonitor.rb - About 35 mins to fix

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

                      def create_security_group_rule(min, max, ip_protocol = "tcp", cidr = "0.0.0.0/0", group_id = nil)
              Severity: Minor
              Found in lib/fog/openstack/compute/models/security_group.rb - About 35 mins to fix

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

                        def create_lbaas_l7rule(l7policy_id, type, compare_type, value, options = {})
                Severity: Minor
                Found in lib/fog/openstack/network/requests/create_lbaas_l7rule.rb - About 35 mins to fix

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

                          def put_object(container, object, data, options = {}, &block)
                  Severity: Minor
                  Found in lib/fog/openstack/storage/requests/put_object.rb - About 35 mins to fix

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

                            def copy_object(source_container_name, source_object_name, target_container_name, target_object_name, options = {})
                    Severity: Minor
                    Found in lib/fog/openstack/storage/requests/copy_object.rb - About 35 mins to fix

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

                              def create_lb_member(pool_id, address, protocol_port, weight, options = {})
                      Severity: Minor
                      Found in lib/fog/openstack/network/requests/create_lb_member.rb - About 35 mins to fix

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

                                def create_lb_health_monitor(type, delay, timeout, max_retries, options = {})
                        Severity: Minor
                        Found in lib/fog/openstack/network/requests/create_lb_health_monitor.rb - About 35 mins to fix

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

                                    def create_recordset(zone_id, name, type, records, options = {})
                          Severity: Minor
                          Found in lib/fog/openstack/dns/v2/requests/create_recordset.rb - About 35 mins to fix

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

                                      def create_recordset(zone_id, name, type, records, options = {})
                            Severity: Minor
                            Found in lib/fog/openstack/dns/v2/requests/create_recordset.rb - About 35 mins to fix

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

                                    def self.new(args = {})
                                      @openstack_auth_uri = URI.parse(args[:openstack_auth_url]) if args[:openstack_auth_url]
                                      if inspect == 'Fog::OpenStack::DNS'
                                        service = Fog::OpenStack::DNS::V2.new(args) unless args.empty?
                                        service ||= Fog::OpenStack::DNS::V1.new(args)
                              Severity: Minor
                              Found in lib/fog/openstack/dns.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 get_template_contents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                      def get_template_contents(template_file)
                                        Fog::Logger.debug("get_template_contents [#{template_file}]")
                              
                                        raise "template_file should be Hash or String, not #{template_file.class.name}" unless
                                          template_file.kind_of?(String) || template_file.kind_of?(Hash)
                              Severity: Minor
                              Found in lib/fog/openstack/orchestration/util/recursive_hot_file_loader.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 new has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def self.new(args = {})
                                      @openstack_auth_uri = URI.parse(args[:openstack_auth_url]) if args[:openstack_auth_url]
                                      if inspect == 'Fog::OpenStack::Image'
                                        service = Fog::OpenStack::Image::V2.new(args) unless args.empty?
                                        service ||= Fog::OpenStack::Image::V1.new(args)
                              Severity: Minor
                              Found in lib/fog/openstack/image.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 headers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                    def headers(additional_headers)
                                      additional_headers ||= {}
                                      unless @microversion.nil? || @microversion.empty?
                                        microversion_value = if @microversion_key == 'Openstack-API-Version'
                                                               "#{@microversion_service_type} #{@microversion}"
                              Severity: Minor
                              Found in lib/fog/openstack/core.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 update_router has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                      def update_router(router_id, options = {})
                                        data = {'router' => {}}
                              
                                        [:name, :admin_state_up, :routes].each do |key|
                                          data['router'][key] = options[key] if options[key]
                              Severity: Minor
                              Found in lib/fog/openstack/network/requests/update_router.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 put_object has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                      def put_object(container, object, data, options = {}, &block)
                                        dgst = Digest::MD5.new
                                        if block_given?
                                          Kernel.loop do
                                            chunk = yield
                              Severity: Minor
                              Found in lib/fog/openstack/storage/requests/put_object.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