Showing 8 of 8 total issues

Method insert has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

      def insert(content = nil, attrs = nil, &blk)
        raise Error, "This tag is already closed" if @done

        if content.is_a?(Hash)
          attrs = content
Severity: Minor
Found in lib/keynote/rumble.rb - About 2 hrs 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 insert has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def insert(content = nil, attrs = nil, &blk)
        raise Error, "This tag is already closed" if @done

        if content.is_a?(Hash)
          attrs = content
Severity: Minor
Found in lib/keynote/rumble.rb - About 1 hr to fix

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

          def attrs_to_s
            attributes.inject("") do |res, (name, value)|
              next res unless value
    
              value =
    Severity: Minor
    Found in lib/keynote/rumble.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 rumble_tag has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def rumble_tag(name, sc, content = nil, attrs = nil, &blk)
    Severity: Minor
    Found in lib/keynote/rumble.rb - About 35 mins to fix

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

            def compile!(view)
              return if @compiled
      
              @compile_mutex.synchronize do
                return if @compiled
      Severity: Minor
      Found in lib/keynote/inline.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 present has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def present(view, *objects)
            if objects[0].is_a?(Symbol) || objects[0].is_a?(String)
              name = objects.shift
            else
              name = presenter_name_from_object(objects[0])
      Severity: Minor
      Found in lib/keynote.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 flatten_attr_hash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def flatten_attr_hash(attrs, name)
              if attrs && attrs[name].is_a?(Hash)
                attrs = attrs.dup
                attrs.delete(name).each do |key, value|
                  next if value.nil?
      Severity: Minor
      Found in lib/keynote/rumble.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 compile! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def compile!(view)
              return if @compiled
      
              @compile_mutex.synchronize do
                return if @compiled
      Severity: Minor
      Found in lib/keynote/inline.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