murb/workbook

View on GitHub

Showing 1,335 of 1,335 total issues

Method to_xls has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def to_xls options = {}
        book = init_spreadsheet_template
        each_with_index do |s, si|
          xls_sheet = xls_sheet(si)
          xls_sheet.name = s.name
Severity: Minor
Found in lib/workbook/writers/xls_writer.rb - About 1 hr to fix

    Method to_html has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def to_html options = {}
            options = {style_with_inline_css: false}.merge(options)
            builder = Nokogiri::XML::Builder.new { |doc|
              doc.table do
                doc.thead do
    Severity: Minor
    Found in lib/workbook/writers/html_writer.rb - About 1 hr to fix

      Line is too long. [133/120]
      Open

          # @param [Workbook::Format, Hash] options (e.g. :background, :color, :background_color, :font_weight (integer or css-type labels)
      Severity: Minor
      Found in lib/workbook/format.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",
      }

      Line is too long. [133/120]
      Open

          # Initializes Workbook::Format with a hash. The keys in the Hash are intended to closely mimick the CSS-style options (see above)
      Severity: Minor
      Found in lib/workbook/format.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",
      }

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

          def column_type
            return @column_type if defined?(@column_type)
            ind = index
            table[1..500].each do |row|
              if row[ind]&.cell_type
      Severity: Minor
      Found in lib/workbook/column.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 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

      Line is too long. [131/120]
      Open

              td_options = td_options.merge({style: cell.format.to_css}) if options[:style_with_inline_css] && (cell.format.to_css != "")
      Severity: Minor
      Found in lib/workbook/writers/html_writer.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",
      }

      Method parse_xlsx_cell has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def parse_xlsx_cell cell
              type = cell.attr("t")
              format_index = cell.attr("s").to_i
              position = cell.attr("r")
              formula = cell.css("f").text
      Severity: Minor
      Found in lib/workbook/readers/xlsx_reader.rb - About 1 hr to fix

        Line is too long. [130/120]
        Open

              raise ArgumentError, "table should be a Workbook::Table (you passed a #{t.class})" unless t.is_a?(Workbook::Table) || t.nil?
        Severity: Minor
        Found in lib/workbook/row.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",
        }

        Line is too long. [130/120]
        Open

              (desired_length - count).times { |a| @cells << Workbook::Cell.new(nil) } if desired_length && ((desired_length - count) > 0)
        Severity: Minor
        Found in lib/workbook/row.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",
        }

        Line is too long. [130/120]
        Open

            delegate [:first, :last, :pop, :delete_at, :each, :count, :include?, :index, :delete_if, :to_csv, :length, :empty?] => :@cells
        Severity: Minor
        Found in lib/workbook/row.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",
        }

        Line is too long. [130/120]
        Open

            delegate [:first, :last, :pop, :delete_at, :each, :collect, :each_with_index, :count, :index, :delete_if, :include?] => :@rows
        Severity: Minor
        Found in lib/workbook/table.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",
        }

        Line is too long. [130/120]
        Open

                  xlsfmt.pattern_fg_color = html_color_to_xls_color(f[:background_color]) if html_color_to_xls_color(f[:background_color])
        Severity: Minor
        Found in lib/workbook/writers/xls_writer.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",
        }

        Method load_xlsx has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

              def load_xlsx file_obj, options = {}
                file_obj = file_obj.path if file_obj.is_a? File
                sheets = {}
                shared_string_file = ""
                styles = ""
        Severity: Minor
        Found in lib/workbook/readers/xlsx_reader.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

        Line is too long. [129/120]
        Open

            # Combines the formatting options of one with another, removes as a consequence the reference to the raw object's equivalent.
        Severity: Minor
        Found in lib/workbook/format.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",
        }

        Line is too long. [129/120]
        Open

                  if [:visible, :hidden, nil].include? xls_sheet.visibility # don't read :strong_hidden sheets, symmetrical to the writer
        Severity: Minor
        Found in lib/workbook/readers/xls_reader.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",
        }

        Method string_american_date_converter has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

              def string_american_date_converter
                proc do |v|
                  if v
                    rv = v
                    # try strptime with format 'mm/dd/yyyy'
        Severity: Minor
        Found in lib/workbook/modules/type_parser.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

        Line is too long. [129/120]
        Open

            # Applies the formatting options of self with another, removes as a consequence the reference to the raw object's equivalent.
        Severity: Minor
        Found in lib/workbook/format.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",
        }

        Line is too long. [129/120]
        Open

              # Returns column type, either :primary_key, :string, :text, :integer, :float, :decimal, :datetime, :date, :binary, :boolean
        Severity: Minor
        Found in lib/workbook/modules/cell.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",
        }

        Method value_to_sym has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

              def value_to_sym value
                v = nil
                cell_type ||= ::Workbook::Modules::Cell::CLASS_CELLTYPE_MAPPING[value.class.to_s]
                value_to_s = value.to_s.strip.downcase
                unless value.nil? || value_to_s == ""
        Severity: Minor
        Found in lib/workbook/cell.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

        Severity
        Category
        Status
        Source
        Language