Showing 2 of 2 total issues

Method adapter_helpers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

      def adapter_helpers(adapter)
        adapter.class.ancestors.each_with_object([]) do |klass, ret|
          next unless klass.is_a?(Class)
          next unless klass.const_defined?(HELPERS_MODULE_NAME)
          ret.unshift klass.const_get(HELPERS_MODULE_NAME)
Severity: Minor
Found in lib/eql/adapter_factory.rb - About 45 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 factory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def factory(conn)
        return Eql.config.default_adapter unless conn
        adapter = adapters.values.find do |a|
          a.match?(conn) if a.is_a?(Class) && a.respond_to?(:match?)
        end
Severity: Minor
Found in lib/eql/adapter_factory.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

Severity
Category
Status
Source
Language