buren/honey_format

View on GitHub

Showing 5 of 7 total issues

Method parse_options has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def parse_options(argv:)
      input_path = nil
      columns = nil
      output_path = nil
      delimiter = ','
Severity: Major
Found in lib/honey_format/cli/cli.rb - About 2 hrs to fix

    Method parse_options has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def parse_options(argv:)
          input_path = nil
          benchmark_time = 30
          benchmark_warmup = 5
          lines_multipliers = [1]
    Severity: Minor
    Found in lib/honey_format/cli/benchmark_cli.rb - About 1 hr to fix

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

          def self.key_count_to_deduplicated_array(data)
            array = []
            count_occurences(data).each do |key, value|
              next array << key if value == 1
      
      
      Severity: Minor
      Found in lib/honey_format/helpers/helpers.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 parse_options has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def parse_options(argv:)
            input_path = nil
            benchmark_time = 30
            benchmark_warmup = 5
            lines_multipliers = [1]
      Severity: Minor
      Found in lib/honey_format/cli/benchmark_cli.rb - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          def hash_converter(hash)
            lambda { |value, index|
              # support strings and symbol keys interchangeably
              column = hash.fetch(value) do
                key = value.respond_to?(:to_sym) ? value.to_sym : value
      Severity: Minor
      Found in lib/honey_format/matrix/header.rb - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Severity
      Category
      Status
      Source
      Language