bhollis/maruku

View on GitHub
lib/maruku/input/charsource.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method method_missing has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def method_missing(methodname, *args)
      a_bef = @a.describe
      b_bef = @b.describe

      a = @a.send(methodname, *args)
Severity: Minor
Found in lib/maruku/input/charsource.rb - About 1 hr to fix

    Method describe has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def describe
          len = 75
          num_before = [len/2, @scanner.pos].min
          num_after = [len/2, @scanner.rest_size].min
          num_before_max = @scanner.pos
    Severity: Minor
    Found in lib/maruku/input/charsource.rb - About 1 hr to fix

      Method describe_pos has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def describe_pos(buffer, buffer_index)
            len = 75
            num_before = [len/2, buffer_index].min
            num_after = [len/2, buffer.size - buffer_index].min
            num_before_max = buffer_index
      Severity: Minor
      Found in lib/maruku/input/charsource.rb - About 1 hr to fix

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

            def consume_whitespace
              while c = cur_char
                break unless (c == ' ' || c == "\t")
                ignore_char
              end
        Severity: Minor
        Found in lib/maruku/input/charsource.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

        There are no issues that match your filters.

        Category
        Status