Showing 5 of 6 total issues
Class Store
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class Store < self
module Namespace
FLUSHDB_BATCH_SIZE = 1000
def set(key, *args)
Method extract_host_options_from_uri
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def self.extract_host_options_from_uri(uri)
uri = URI.parse(uri)
if uri.scheme == "unix"
options = { :path => uri.path }
else
- Read upRead up
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 initialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options = {})
super
unless options[:marshalling].nil?
puts %(
- Read upRead up
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 mget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def mget(*keys, &blk)
options = (keys.pop if keys.last.is_a? Hash) || {}
if keys.any?
# Serialization gets extended before Namespace does, so we need to pass options further
if singleton_class.ancestors.include? Serialization
- Read upRead up
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 set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set(key, value, options = nil)
if options && REDIS_SET_OPTIONS.any? { |k| options.key?(k) }
kwargs = REDIS_SET_OPTIONS.each_with_object({}) { |key, h| h[key] = options[key] if options.key?(key) }
super(key, value, **kwargs)
else
- Read upRead up
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"