fog/fog-openstack

View on GitHub

Showing 156 of 615 total issues

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

          def credentials
            if @token
              identity = {'token' => {'id' => @token}}
            else
              raise CredentialsError, "#{self.class}: User name is required" if @user.name.nil?
Severity: Minor
Found in lib/fog/openstack/auth/token/v2.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 list_snapshots has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def list_snapshots(options = true, options_deprecated = {})
          if options.kind_of?(Hash)
            path  = 'snapshots'
            query = options
          else
Severity: Minor
Found in lib/fog/openstack/volume/requests/list_snapshots.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 convert_update_params has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def convert_update_params(params)
          params = params.map do |key, value|
          {
            "path"  => "/#{key}",
            "op"    => value ? "replace" : "remove"
Severity: Minor
Found in lib/fog/openstack/container_infra/models/base.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 list_snapshots has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def list_snapshots(options = true)
          if options.kind_of?(Hash)
            path = 'os-snapshots'
            query = options
          else
Severity: Minor
Found in lib/fog/openstack/compute/requests/list_snapshots.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 list_volumes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

        def list_volumes(options = true, options_deprecated = {})
          if options.kind_of?(Hash)
            path  = 'volumes'
            query = options
          else
Severity: Minor
Found in lib/fog/openstack/volume/requests/list_volumes.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_security_group_rule has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def create_security_group_rule(parent_group_id, ip_protocol, from_port, to_port, cidr, group_id = nil)
Severity: Minor
Found in lib/fog/openstack/compute/requests/create_security_group_rule.rb - About 45 mins to fix

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

            def create_temp_url(container, object, expires, method, options = {})
              raise ArgumentError, "Insufficient parameters specified." unless container && object && expires && method
              raise ArgumentError, "Storage must be instantiated with the :openstack_temp_url_key option" if @openstack_temp_url_key.nil?
    
              scheme = options[:scheme] || @openstack_management_uri.scheme
    Severity: Minor
    Found in lib/fog/openstack/storage/requests/get_object_https_url.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_stack has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

            def create_stack(arg1, arg2 = nil)
              if arg1.kind_of?(Hash)
                # Normal use: create_stack(options)
                options = arg1
              else
    Severity: Minor
    Found in lib/fog/openstack/orchestration/requests/create_stack.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 list_volumes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

            def list_volumes(options = true)
              if options.kind_of?(Hash)
                path = 'os-volumes'
                query = options
              else
    Severity: Minor
    Found in lib/fog/openstack/compute/requests/list_volumes.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 update_meta has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

            def update_meta(collection_name, parent_id, key, value)
              if collection_name == "images"
                unless list_images_detail.body['images'].find { |image| image['id'] == parent_id }
                  raise Fog::OpenStack::Compute::NotFound
                end
    Severity: Minor
    Found in lib/fog/openstack/compute/requests/update_meta.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_lbaas_healthmonitor has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

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

              def rebuild_server(server_id, image_ref, name, admin_pass = nil, metadata = nil, personality = nil)
      Severity: Minor
      Found in lib/fog/openstack/compute/requests/rebuild_server.rb - About 45 mins to fix

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

                def rebuild_server(server_id, _image_ref, _name, _admin_pass = nil, _metadata = nil, _personality = nil)
        Severity: Minor
        Found in lib/fog/openstack/compute/requests/rebuild_server.rb - About 45 mins to fix

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

                  def get_endpoint_url(names, interfaces, region = nil)
                    # TODO: Inject OpenStack Service Types Authority
                    names_list = if names.kind_of?(String)
                                   [names]
                                 else
          Severity: Minor
          Found in lib/fog/openstack/auth/catalog.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_security_group_rule has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def create_security_group_rule(parent_group_id, ip_protocol, from_port, to_port, cidr, group_id = nil)
          Severity: Minor
          Found in lib/fog/openstack/compute/requests/create_security_group_rule.rb - About 45 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 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_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 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
                      Severity
                      Category
                      Status
                      Source
                      Language