cypriss/mutations

View on GitHub

Showing 45 of 47 total issues

Avoid too many return statements within this method.
Open

        return [data, :boolean]
Severity: Major
Found in lib/mutations/boolean_filter.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return [data, :min] if options[:min] && data < options[:min]
    Severity: Major
    Found in lib/mutations/float_filter.rb - About 30 mins to fix

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

          def filter_element(data)
            if @element_filter
              data, el_errors = @element_filter.filter(data)
              return [data, el_errors] if el_errors
            elsif options[:class]
      Severity: Minor
      Found in lib/mutations/array_filter.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 filter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def filter(data)
      
            # Handle nil case
            if data.nil?
              return [nil, nil] if options[:nils]
      Severity: Minor
      Found in lib/mutations/duck_filter.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 filter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def filter(data)
            if data.nil?
              return [nil, nil] if options[:nils]
              return [nil, :nils]
            end
      Severity: Minor
      Found in lib/mutations/symbol_filter.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