aviator/aviator

View on GitHub

Showing 25 of 74 total issues

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

    def scope_hash
      p = {}

      if params[:tenant_name] || params[:tenant_id]
        p[:project] = compact_hash({
Severity: Minor
Found in lib/aviator/openstack/identity/requests/v3/public/create_token.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 build_params_class has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def build_params_class(all_params, param_aliases)
        Struct.new(*all_params) do
          alias :param_getter :[]
          alias :param_setter :[]=

Severity: Minor
Found in lib/aviator/core/request.rb - About 25 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 params_to_querystring has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def params_to_querystring(param_names)
      filters = []

      param_names.each do |param_name|
        filters << "#{ param_name }=#{ params[param_name] }" if params[param_name]
Severity: Minor
Found in lib/aviator/openstack/common/requests/v0/public/base.rb - About 25 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 url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def url
      url = "#{ base_url }/os-hosts"

      filters = []

Severity: Minor
Found in lib/aviator/openstack/compute/requests/v2/admin/list_hosts.rb - About 25 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 url has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def url
      uri = URI(base_url)
      url = "#{ uri.scheme }://#{ uri.host }:#{ uri.port.to_s }/v1/images"

      filters = []
Severity: Minor
Found in lib/aviator/openstack/image/requests/v1/public/list_public_images.rb - About 25 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