3scale/porta

View on GitHub

Showing 307 of 5,713 total issues

Method up has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def self.up
    model = ApiDocs::Service

    add_column :api_docs_services, :base_path, :string
    docs = model.connection.select_all "SELECT id, body FROM api_docs_services"
Severity: Minor
Found in db/migrate/20120511140727_add_base_path_to_api_docs_service.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 deserialize_argument has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def deserialize_argument(argument)
      case argument
      when String
        argument
      when *PERMITTED_TYPES
Severity: Minor
Found in lib/active_job/arguments.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 assign_to_mail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def assign_to_mail(mail)
      mail[:subject] = @subject if @subject
      mail[:bcc] = @bcc if @bcc
      mail[:cc] = @cc if @cc
      mail[:from] = @from if @from
Severity: Minor
Found in lib/developer_portal/lib/liquid/tags/email.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 debug_message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def debug_message(target, result)
      return if chain_config[:terminator].blank?
      conditions = []

      conditions.push "if: #{Array.wrap(@if).join(' && ')}" if @if.present?
Severity: Minor
Found in config/initializers/debug_callbacks.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 assign_to_message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def assign_to_message(message)
      message.subject = @subject if @subject

      message.headers['bcc'] = @bcc if @bcc
      message.headers['cc'] = @cc if @cc
Severity: Minor
Found in lib/developer_portal/lib/liquid/tags/email.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 help has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def help(assigns)
        assigns = Hash[
          assigns.map do |name, value|
            klass = value.class
            klass_name = if klass.respond_to?(:name)
Severity: Minor
Found in lib/developer_portal/lib/liquid/tags/debug.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 debug_callback has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def debug_callback(callback)
      ->(target, *args, &block) do
        begin
          result = callback.call(target, *args, &block)
        rescue => e
Severity: Minor
Found in config/initializers/debug_callbacks.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