rbuck/keymap

View on GitHub

Showing 5 of 5 total issues

Method checkout has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

      def checkout
        synchronize do
          waited_time = 0

          loop do
Severity: Minor
Found in lib/keymap/connection_adapters/abstract/connection_pool.rb - About 2 hrs 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 transaction has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

      def transaction(options = {})
        transaction_open = false
        @_current_transaction_records ||= []
        begin
          if block_given?
Severity: Minor
Found in lib/keymap/connection_adapters/abstract/transaction_management.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 each has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def each
          if block_given?
            hash_keys.each { |key| yield [key, self[key]] unless key == sentinel }
          else
            ::Enumerable::Enumerator.new(self, :each)
Severity: Minor
Found in lib/keymap/connection_adapters/redis_adapter.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 each_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def each_value
          if block_given?
            hash_keys.each { |key| yield self[key] unless key == sentinel }
          else
            ::Enumerable::Enumerator.new(self, :each_value)
Severity: Minor
Found in lib/keymap/connection_adapters/redis_adapter.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 each_pair has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def each_pair
          if block_given?
            hash_keys.each { |key| yield key, self[key] unless key == sentinel }
          else
            ::Enumerable::Enumerator.new(self, :each_pair)
Severity: Minor
Found in lib/keymap/connection_adapters/redis_adapter.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