murb/workbook

View on GitHub
lib/workbook/modules/diff_sort.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Module has too many lines. [111/100]
Open

    module TableDiffSort
      # create an overview of the differences between itself with another 'previous' table, returns a book with a single sheet and table (containing the diffs)
      #
      # @return [Workbook::Table] the return result
      def diff other, options = {}
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

Example: CountAsOne: ['array', 'heredoc']

module M
  ARRAY = [         # +1
    1,
    2
  ]

  HASH = {          # +3
    key: 'value'
  }

  MSG = <<~HEREDOC  # +1
    Heredoc
    content.
  HEREDOC
end                 # 5 points

Method has too many lines. [26/10]
Open

      def diff other, options = {}
        options = {sort: true, ignore_headers: false}.merge(options)

        aligned = align(other, options)
        aself = aligned[:self]
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

NOTE: The ExcludedMethods configuration is deprecated and only kept for backwards compatibility. Please use IgnoredMethods instead.

Example: CountAsOne: ['array', 'heredoc']

def m
  array = [       # +1
    1,
    2
  ]

  hash = {        # +3
    key: 'value'
  }

  <<~HEREDOC      # +1
    Heredoc
    content.
  HEREDOC
end               # 5 points

Method has too many lines. [18/10]
Open

      def create_diff_cell(scell, ocell)
        dcell = scell.nil? ? Workbook::Cell.new(nil) : scell
        if scell == ocell
          dcell.format = scell.format if scell
        elsif scell.nil?
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

NOTE: The ExcludedMethods configuration is deprecated and only kept for backwards compatibility. Please use IgnoredMethods instead.

Example: CountAsOne: ['array', 'heredoc']

def m
  array = [       # +1
    1,
    2
  ]

  hash = {        # +3
    key: 'value'
  }

  <<~HEREDOC      # +1
    Heredoc
    content.
  HEREDOC
end               # 5 points

Method has too many lines. [16/10]
Open

      def align_row sself, sother, row_index
        asd = 0
        if sself.rows[row_index] && sother.rows[row_index]
          asd = sself.rows[row_index].key <=> sother.rows[row_index].key
        elsif sself.rows[row_index]
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

NOTE: The ExcludedMethods configuration is deprecated and only kept for backwards compatibility. Please use IgnoredMethods instead.

Example: CountAsOne: ['array', 'heredoc']

def m
  array = [       # +1
    1,
    2
  ]

  hash = {        # +3
    key: 'value'
  }

  <<~HEREDOC      # +1
    Heredoc
    content.
  HEREDOC
end               # 5 points

Method has too many lines. [14/10]
Open

      def align other, options = {}
        options = {sort: true, ignore_headers: false}.merge(options)

        sother = other.clone.remove_empty_lines!
        sself = clone.remove_empty_lines!
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

NOTE: The ExcludedMethods configuration is deprecated and only kept for backwards compatibility. Please use IgnoredMethods instead.

Example: CountAsOne: ['array', 'heredoc']

def m
  array = [       # +1
    1,
    2
  ]

  hash = {        # +3
    key: 'value'
  }

  <<~HEREDOC      # +1
    Heredoc
    content.
  HEREDOC
end               # 5 points

Perceived complexity for align_row is too high. [11/8]
Open

      def align_row sself, sother, row_index
        asd = 0
        if sself.rows[row_index] && sother.rows[row_index]
          asd = sself.rows[row_index].key <=> sother.rows[row_index].key
        elsif sself.rows[row_index]
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

Example:

def my_method                   # 1
  if cond                       # 1
    case var                    # 2 (0.8 + 4 * 0.2, rounded)
    when 1 then func_one
    when 2 then func_two
    when 3 then func_three
    when 4..10 then func_other
    end
  else                          # 1
    do_something until a && b   # 2
  end                           # ===
end                             # 7 complexity points

Method has too many lines. [13/10]
Open

        def new_diff_template
          diffbook = Workbook::Book.new
          template = diffbook.template
          f = template.create_or_find_format_by "destroyed"
          f[:background_color] = :red
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

NOTE: The ExcludedMethods configuration is deprecated and only kept for backwards compatibility. Please use IgnoredMethods instead.

Example: CountAsOne: ['array', 'heredoc']

def m
  array = [       # +1
    1,
    2
  ]

  hash = {        # +3
    key: 'value'
  }

  <<~HEREDOC      # +1
    Heredoc
    content.
  HEREDOC
end               # 5 points

Cyclomatic complexity for align_row is too high. [9/7]
Open

      def align_row sself, sother, row_index
        asd = 0
        if sself.rows[row_index] && sother.rows[row_index]
          asd = sself.rows[row_index].key <=> sother.rows[row_index].key
        elsif sself.rows[row_index]
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one. Blocks that are calls to builtin iteration methods (e.g. `ary.map{...}) also add one, others are ignored.

def each_child_node(*types)               # count begins: 1
  unless block_given?                     # unless: +1
    return to_enum(__method__, *types)

  children.each do |child|                # each{}: +1
    next unless child.is_a?(Node)         # unless: +1

    yield child if types.empty? ||        # if: +1, ||: +1
                   types.include?(child.type)
  end

  self
end                                       # total: 6

Method has too many lines. [12/10]
Open

      def diff to_workbook, options = {sort: true, ignore_headers: false}
        diff_template = Workbook::Book.new_diff_template
        each_with_index do |from_sheet, sheet_index|
          to_sheet = to_workbook[sheet_index]
          if to_sheet
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

You can set literals you want to fold with CountAsOne. Available are: 'array', 'hash', and 'heredoc'. Each literal will be counted as one line regardless of its actual size.

NOTE: The ExcludedMethods configuration is deprecated and only kept for backwards compatibility. Please use IgnoredMethods instead.

Example: CountAsOne: ['array', 'heredoc']

def m
  array = [       # +1
    1,
    2
  ]

  hash = {        # +3
    key: 'value'
  }

  <<~HEREDOC      # +1
    Heredoc
    content.
  HEREDOC
end               # 5 points

Cyclomatic complexity for create_diff_cell is too high. [8/7]
Open

      def create_diff_cell(scell, ocell)
        dcell = scell.nil? ? Workbook::Cell.new(nil) : scell
        if scell == ocell
          dcell.format = scell.format if scell
        elsif scell.nil?
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one. Blocks that are calls to builtin iteration methods (e.g. `ary.map{...}) also add one, others are ignored.

def each_child_node(*types)               # count begins: 1
  unless block_given?                     # unless: +1
    return to_enum(__method__, *types)

  children.each do |child|                # each{}: +1
    next unless child.is_a?(Node)         # unless: +1

    yield child if types.empty? ||        # if: +1, ||: +1
                   types.include?(child.type)
  end

  self
end                                       # total: 6

Perceived complexity for create_diff_cell is too high. [9/8]
Open

      def create_diff_cell(scell, ocell)
        dcell = scell.nil? ? Workbook::Cell.new(nil) : scell
        if scell == ocell
          dcell.format = scell.format if scell
        elsif scell.nil?
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb by rubocop

This cop tries to produce a complexity score that's a measure of the complexity the reader experiences when looking at a method. For that reason it considers when nodes as something that doesn't add as much complexity as an if or a &&. Except if it's one of those special case/when constructs where there's no expression after case. Then the cop treats it as an if/elsif/elsif... and lets all the when nodes count. In contrast to the CyclomaticComplexity cop, this cop considers else nodes as adding complexity.

Example:

def my_method                   # 1
  if cond                       # 1
    case var                    # 2 (0.8 + 4 * 0.2, rounded)
    when 1 then func_one
    when 2 then func_two
    when 3 then func_three
    when 4..10 then func_other
    end
  else                          # 1
    do_something until a && b   # 2
  end                           # ===
end                             # 7 complexity points

Method create_diff_cell has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

      def create_diff_cell(scell, ocell)
        dcell = scell.nil? ? Workbook::Cell.new(nil) : scell
        if scell == ocell
          dcell.format = scell.format if scell
        elsif scell.nil?
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb - About 1 hr 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 diff has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def diff other, options = {}
        options = {sort: true, ignore_headers: false}.merge(options)

        aligned = align(other, options)
        aself = aligned[:self]
Severity: Minor
Found in lib/workbook/modules/diff_sort.rb - About 1 hr to fix

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

          def align other, options = {}
            options = {sort: true, ignore_headers: false}.merge(options)
    
            sother = other.clone.remove_empty_lines!
            sself = clone.remove_empty_lines!
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.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 align_row has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

          def align_row sself, sother, row_index
            asd = 0
            if sself.rows[row_index] && sother.rows[row_index]
              asd = sself.rows[row_index].key <=> sother.rows[row_index].key
            elsif sself.rows[row_index]
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.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

    Assignment Branch Condition size for align is too high. [<9, 19, 7> 22.16/17]
    Open

          def align other, options = {}
            options = {sort: true, ignore_headers: false}.merge(options)
    
            sother = other.clone.remove_empty_lines!
            sself = clone.remove_empty_lines!
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric and https://en.wikipedia.org/wiki/ABC_Software_Metric.

    Interpreting ABC size:

    • <= 17 satisfactory
    • 18..30 unsatisfactory
    • > 30 dangerous

    You can have repeated "attributes" calls count as a single "branch". For this purpose, attributes are any method with no argument; no attempt is meant to distinguish actual attr_reader from other methods.

    Example: CountRepeatedAttributes: false (default is true)

    # `model` and `current_user`, refenced 3 times each,
     # are each counted as only 1 branch each if
     # `CountRepeatedAttributes` is set to 'false'
    
     def search
       @posts = model.active.visible_by(current_user)
                 .search(params[:q])
       @posts = model.some_process(@posts, current_user)
       @posts = model.another_process(@posts, current_user)
    
       render 'pages/search/page'
     end

    This cop also takes into account IgnoredMethods (defaults to [])

    Assignment Branch Condition size for diff is too high. [<19, 40, 5> 44.56/17]
    Open

          def diff other, options = {}
            options = {sort: true, ignore_headers: false}.merge(options)
    
            aligned = align(other, options)
            aself = aligned[:self]
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric and https://en.wikipedia.org/wiki/ABC_Software_Metric.

    Interpreting ABC size:

    • <= 17 satisfactory
    • 18..30 unsatisfactory
    • > 30 dangerous

    You can have repeated "attributes" calls count as a single "branch". For this purpose, attributes are any method with no argument; no attempt is meant to distinguish actual attr_reader from other methods.

    Example: CountRepeatedAttributes: false (default is true)

    # `model` and `current_user`, refenced 3 times each,
     # are each counted as only 1 branch each if
     # `CountRepeatedAttributes` is set to 'false'
    
     def search
       @posts = model.active.visible_by(current_user)
                 .search(params[:q])
       @posts = model.some_process(@posts, current_user)
       @posts = model.another_process(@posts, current_user)
    
       render 'pages/search/page'
     end

    This cop also takes into account IgnoredMethods (defaults to [])

    Assignment Branch Condition size for create_diff_cell is too high. [<12, 27, 9> 30.89/17]
    Open

          def create_diff_cell(scell, ocell)
            dcell = scell.nil? ? Workbook::Cell.new(nil) : scell
            if scell == ocell
              dcell.format = scell.format if scell
            elsif scell.nil?
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric and https://en.wikipedia.org/wiki/ABC_Software_Metric.

    Interpreting ABC size:

    • <= 17 satisfactory
    • 18..30 unsatisfactory
    • > 30 dangerous

    You can have repeated "attributes" calls count as a single "branch". For this purpose, attributes are any method with no argument; no attempt is meant to distinguish actual attr_reader from other methods.

    Example: CountRepeatedAttributes: false (default is true)

    # `model` and `current_user`, refenced 3 times each,
     # are each counted as only 1 branch each if
     # `CountRepeatedAttributes` is set to 'false'
    
     def search
       @posts = model.active.visible_by(current_user)
                 .search(params[:q])
       @posts = model.some_process(@posts, current_user)
       @posts = model.another_process(@posts, current_user)
    
       render 'pages/search/page'
     end

    This cop also takes into account IgnoredMethods (defaults to [])

    Assignment Branch Condition size for align_row is too high. [<6, 24, 10> 26.68/17]
    Open

          def align_row sself, sother, row_index
            asd = 0
            if sself.rows[row_index] && sother.rows[row_index]
              asd = sself.rows[row_index].key <=> sother.rows[row_index].key
            elsif sself.rows[row_index]
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric and https://en.wikipedia.org/wiki/ABC_Software_Metric.

    Interpreting ABC size:

    • <= 17 satisfactory
    • 18..30 unsatisfactory
    • > 30 dangerous

    You can have repeated "attributes" calls count as a single "branch". For this purpose, attributes are any method with no argument; no attempt is meant to distinguish actual attr_reader from other methods.

    Example: CountRepeatedAttributes: false (default is true)

    # `model` and `current_user`, refenced 3 times each,
     # are each counted as only 1 branch each if
     # `CountRepeatedAttributes` is set to 'false'
    
     def search
       @posts = model.active.visible_by(current_user)
                 .search(params[:q])
       @posts = model.some_process(@posts, current_user)
       @posts = model.another_process(@posts, current_user)
    
       render 'pages/search/page'
     end

    This cop also takes into account IgnoredMethods (defaults to [])

    Line is too long. [159/120]
    Open

          # create an overview of the differences between itself with another 'previous' table, returns a book with a single sheet and table (containing the diffs)
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/IndentationStyle cop. It also ignores a shebang line by default.

    This cop has some autocorrection capabilities. It can programmatically shorten certain long lines by inserting line breaks into expressions that can be safely split across lines. These include arrays, hashes, and method calls with argument lists.

    If autocorrection is enabled, the following Layout cops are recommended to further format the broken lines. (Many of these are enabled by default.)

    • ArgumentAlignment
    • BlockAlignment
    • BlockDelimiters
    • BlockEndNewline
    • ClosingParenthesisIndentation
    • FirstArgumentIndentation
    • FirstArrayElementIndentation
    • FirstHashElementIndentation
    • FirstParameterIndentation
    • HashAlignment
    • IndentationWidth
    • MultilineArrayLineBreaks
    • MultilineBlockLayout
    • MultilineHashBraceLayout
    • MultilineHashKeyLineBreaks
    • MultilineMethodArgumentLineBreaks
    • ParameterAlignment

    Together, these cops will pretty print hashes, arrays, method calls, etc. For example, let's say the max columns is 25:

    Example:

    # bad
    {foo: "0000000000", bar: "0000000000", baz: "0000000000"}
    
    # good
    {foo: "0000000000",
    bar: "0000000000", baz: "0000000000"}
    
    # good (with recommended cops enabled)
    {
      foo: "0000000000",
      bar: "0000000000",
      baz: "0000000000",
    }

    end at 70, 8 is not aligned with if at 66, 25.
    Open

            end
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks whether the end keywords are aligned properly.

    Three modes are supported through the EnforcedStyleAlignWith configuration parameter:

    If it's set to keyword (which is the default), the end shall be aligned with the start of the keyword (if, class, etc.).

    If it's set to variable the end shall be aligned with the left-hand-side of the variable assignment, if there is one.

    If it's set to start_of_line, the end shall be aligned with the start of the line where the matching keyword appears.

    This Layout/EndAlignment cop aligns with keywords (e.g. if, while, case) by default. On the other hand, Layout/BeginEndAlignment cop aligns with EnforcedStyleAlignWith: start_of_line by default due to ||= begin tends to align with the start of the line. These style can be configured by each cop.

    Example: EnforcedStyleAlignWith: keyword (default)

    # bad
    
    variable = if true
        end
    
    # good
    
    variable = if true
               end
    
    variable =
      if true
      end

    Example: EnforcedStyleAlignWith: variable

    # bad
    
    variable = if true
        end
    
    # good
    
    variable = if true
    end
    
    variable =
      if true
      end

    Example: EnforcedStyleAlignWith: startofline

    # bad
    
    variable = if true
        end
    
    puts(if true
         end)
    
    # good
    
    variable = if true
    end
    
    puts(if true
    end)
    
    variable =
      if true
      end

    Space inside { missing.
    Open

            options = {sort: true, ignore_headers: false}.merge(options)
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    foo = { { a: 1 } => { b: { c: 2 } } }
    
    # good
    h = { a: { b: 2 }}
    foo = {{ a: 1 } => { b: { c: 2 }}}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces do not contain spaces.
    
    # bad
    foo = { }
    bar = {    }
    
    # good
    foo = {}
    bar = {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces contain space.
    
    # bad
    foo = {}
    
    # good
    foo = { }
    foo = {  }
    foo = {     }

    Space inside { missing.
    Open

          def diff to_workbook, options = {sort: true, ignore_headers: false}
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    foo = { { a: 1 } => { b: { c: 2 } } }
    
    # good
    h = { a: { b: 2 }}
    foo = {{ a: 1 } => { b: { c: 2 }}}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces do not contain spaces.
    
    # bad
    foo = { }
    bar = {    }
    
    # good
    foo = {}
    bar = {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces contain space.
    
    # bad
    foo = {}
    
    # good
    foo = { }
    foo = {  }
    foo = {     }

    Space inside { missing.
    Open

            options = {sort: true, ignore_headers: false}.merge(options)
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    foo = { { a: 1 } => { b: { c: 2 } } }
    
    # good
    h = { a: { b: 2 }}
    foo = {{ a: 1 } => { b: { c: 2 }}}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces do not contain spaces.
    
    # bad
    foo = { }
    bar = {    }
    
    # good
    foo = {}
    bar = {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces contain space.
    
    # bad
    foo = {}
    
    # good
    foo = { }
    foo = {  }
    foo = {     }

    Space inside } missing.
    Open

            {self: sself, other: sother}
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    foo = { { a: 1 } => { b: { c: 2 } } }
    
    # good
    h = { a: { b: 2 }}
    foo = {{ a: 1 } => { b: { c: 2 }}}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces do not contain spaces.
    
    # bad
    foo = { }
    bar = {    }
    
    # good
    foo = {}
    bar = {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces contain space.
    
    # bad
    foo = {}
    
    # good
    foo = { }
    foo = {  }
    foo = {     }

    Use def with parentheses when there are parameters.
    Open

          def align_row sself, sother, row_index
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    This cop does not consider endless methods, since parentheses are always required for them.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parentheses when method definition arguments fit on single line,
    # but prefers parentheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

              f = template.create_or_find_format_by "header"
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Use def with parentheses when there are parameters.
    Open

          def diff to_workbook, options = {sort: true, ignore_headers: false}
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    This cop does not consider endless methods, since parentheses are always required for them.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parentheses when method definition arguments fit on single line,
    # but prefers parentheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Use def with parentheses when there are parameters.
    Open

          def insert_placeholder? sother, sself, row_index
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    This cop does not consider endless methods, since parentheses are always required for them.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parentheses when method definition arguments fit on single line,
    # but prefers parentheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

              f = template.create_or_find_format_by "destroyed"
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Use def with parentheses when there are parameters.
    Open

          def align other, options = {}
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    This cop does not consider endless methods, since parentheses are always required for them.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parentheses when method definition arguments fit on single line,
    # but prefers parentheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

              diff_table[0].format = diff_template.template.create_or_find_format_by "header"
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Use def with parentheses when there are parameters.
    Open

          def diff_template= table
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    This cop does not consider endless methods, since parentheses are always required for them.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parentheses when method definition arguments fit on single line,
    # but prefers parentheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Space inside } missing.
    Open

            options = {sort: true, ignore_headers: false}.merge(options)
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    foo = { { a: 1 } => { b: { c: 2 } } }
    
    # good
    h = { a: { b: 2 }}
    foo = {{ a: 1 } => { b: { c: 2 }}}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces do not contain spaces.
    
    # bad
    foo = { }
    bar = {    }
    
    # good
    foo = {}
    bar = {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces contain space.
    
    # bad
    foo = {}
    
    # good
    foo = { }
    foo = {  }
    foo = {     }

    Use next to skip iteration.
    Open

              if to_sheet
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Use next to skip iteration instead of a condition at the end.

    Example: EnforcedStyle: skipmodifierifs (default)

    # bad
    [1, 2].each do |a|
      if a == 1
        puts a
      end
    end
    
    # good
    [1, 2].each do |a|
      next unless a == 1
      puts a
    end
    
    # good
    [1, 2].each do |a|
      puts a if a == 1
    end

    Example: EnforcedStyle: always

    # With `always` all conditions at the end of an iteration needs to be
    # replaced by next - with `skip_modifier_ifs` the modifier if like
    # this one are ignored: `[1, 2].each { |a| puts a if a == 1 }`
    
    # bad
    [1, 2].each do |a|
      puts a if a == 1
    end
    
    # bad
    [1, 2].each do |a|
      if a == 1
        puts a
      end
    end
    
    # good
    [1, 2].each do |a|
      next unless a == 1
      puts a
    end

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

              f = template.create_or_find_format_by "updated"
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

              f = template.create_or_find_format_by "created"
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Favor modifier unless usage when having a single-line body. Another good alternative is the usage of control flow &&/||.
    Open

            unless options[:ignore_headers]
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks for if and unless statements that would fit on one line if written as modifier if/unless. The cop also checks for modifier if/unless lines that exceed the maximum line length.

    The maximum line length is configured in the Layout/LineLength cop. The tab size is configured in the IndentationWidth of the Layout/IndentationStyle cop.

    Example:

    # bad
    if condition
      do_stuff(bar)
    end
    
    unless qux.empty?
      Foo.do_something
    end
    
    do_something_with_a_long_name(arg) if long_condition_that_prevents_code_fit_on_single_line
    
    # good
    do_stuff(bar) if condition
    Foo.do_something unless qux.empty?
    
    if long_condition_that_prevents_code_fit_on_single_line
      do_something_with_a_long_name(arg)
    end
    
    if short_condition # a long comment that makes it too long if it were just a single line
      do_something
    end

    Use def with parentheses when there are parameters.
    Open

          def diff other, options = {}
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks for parentheses around the arguments in method definitions. Both instance and class/singleton methods are checked.

    This cop does not consider endless methods, since parentheses are always required for them.

    Example: EnforcedStyle: require_parentheses (default)

    # The `require_parentheses` style requires method definitions
    # to always use parentheses
    
    # bad
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Example: EnforcedStyle: requirenoparentheses

    # The `require_no_parentheses` style requires method definitions
    # to never use parentheses
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end

    Example: EnforcedStyle: requirenoparenthesesexceptmultiline

    # The `require_no_parentheses_except_multiline` style prefers no
    # parentheses when method definition arguments fit on single line,
    # but prefers parentheses when arguments span multiple lines.
    
    # bad
    def bar(num1, num2)
      num1 + num2
    end
    
    def foo descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name
      do_something
    end
    
    # good
    def bar num1, num2
      num1 + num2
    end
    
    def foo(descriptive_var_name,
            another_descriptive_var_name,
            last_descriptive_var_name)
      do_something
    end

    Missing top-level documentation comment for module Workbook::Modules::BookDiffSort::ClassMethods.
    Open

          module ClassMethods
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, constant definitions or constant visibility declarations.

    The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

    Example:

    # bad
    class Person
      # ...
    end
    
    module Math
    end
    
    # good
    # Description/Explanation of Person class
    class Person
      # ...
    end
    
    # allowed
      # Class without body
      class Person
      end
    
      # Namespace - A namespace can be a class or a module
      # Containing a class
      module Namespace
        # Description/Explanation of Person class
        class Person
          # ...
        end
      end
    
      # Containing constant visibility declaration
      module Namespace
        class Private
        end
    
        private_constant :Private
      end
    
      # Containing constant definition
      module Namespace
        Public = Class.new
      end
    
      # Macro calls
      module Namespace
        extend Foo
      end

    Example: AllowedConstants: ['ClassMethods']

    # good
     module A
       module ClassMethods
         # ...
       end
      end

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

              f = diff_template.template.create_or_find_format_by "created", fmt
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Align else with if.
    Open

            else
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks the alignment of else keywords. Normally they should be aligned with an if/unless/while/until/begin/def/rescue keyword, but there are special cases when they should follow the same rules as the alignment of end.

    Example:

    # bad
    if something
      code
     else
      code
    end
    
    # bad
    if something
      code
     elsif something
      code
    end
    
    # good
    if something
      code
    else
      code
    end

    Space inside } missing.
    Open

          def diff to_workbook, options = {sort: true, ignore_headers: false}
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    foo = { { a: 1 } => { b: { c: 2 } } }
    
    # good
    h = { a: { b: 2 }}
    foo = {{ a: 1 } => { b: { c: 2 }}}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces do not contain spaces.
    
    # bad
    foo = { }
    bar = {    }
    
    # good
    foo = {}
    bar = {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces contain space.
    
    # bad
    foo = {}
    
    # good
    foo = { }
    foo = {  }
    foo = {     }

    Space inside } missing.
    Open

            options = {sort: true, ignore_headers: false}.merge(options)
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    foo = { { a: 1 } => { b: { c: 2 } } }
    
    # good
    h = { a: { b: 2 }}
    foo = {{ a: 1 } => { b: { c: 2 }}}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces do not contain spaces.
    
    # bad
    foo = { }
    bar = {    }
    
    # good
    foo = {}
    bar = {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces contain space.
    
    # bad
    foo = {}
    
    # good
    foo = { }
    foo = {  }
    foo = {     }

    Use 2 (not -15) spaces for indentation.
    Open

              [aother.first.count, aself.first.count].max.times.collect
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop checks for indentation that doesn't use the specified number of spaces.

    See also the IndentationConsistency cop which is the companion to this one.

    Example:

    # bad
    class A
     def test
      puts 'hello'
     end
    end
    
    # good
    class A
      def test
        puts 'hello'
      end
    end

    Example: IgnoredPatterns: ['^\s*module']

    # bad
    module A
    class B
      def test
      puts 'hello'
      end
    end
    end
    
    # good
    module A
    class B
      def test
        puts 'hello'
      end
    end
    end

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

              f = diff_template.template.create_or_find_format_by "updated"
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Add empty line after guard clause.
    Open

            return @diff_template if defined?(@diff_template)
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    This cop enforces empty line after guard clause

    Example:

    # bad
    def foo
      return if need_return?
      bar
    end
    
    # good
    def foo
      return if need_return?
    
      bar
    end
    
    # good
    def foo
      return if something?
      return if something_different?
    
      bar
    end
    
    # also good
    def foo
      if something?
        do_something
        return if need_return?
      end
    end

    Space inside { missing.
    Open

            {self: sself, other: sother}
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space (default)

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    foo = { { a: 1 } => { b: { c: 2 } } }
    
    # good
    h = { a: { b: 2 }}
    foo = {{ a: 1 } => { b: { c: 2 }}}

    Example: EnforcedStyleForEmptyBraces: no_space (default)

    # The `no_space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces do not contain spaces.
    
    # bad
    foo = { }
    bar = {    }
    
    # good
    foo = {}
    bar = {}

    Example: EnforcedStyleForEmptyBraces: space

    # The `space` EnforcedStyleForEmptyBraces style enforces that
    # empty hash braces contain space.
    
    # bad
    foo = {}
    
    # good
    foo = { }
    foo = {  }
    foo = {     }

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

              dcell.format = diff_template.template.create_or_find_format_by "destroyed"
    Severity: Minor
    Found in lib/workbook/modules/diff_sort.rb by rubocop

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    There are no issues that match your filters.

    Category
    Status