redis-store/redis-store

View on GitHub

Showing 4 of 6 total issues

Class Store has 29 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Store < self
    module Namespace
      FLUSHDB_BATCH_SIZE = 1000

      def set(key, val, options = nil)
Severity: Minor
Found in lib/redis/store/namespace.rb - About 3 hrs to fix

    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
    Severity: Minor
    Found in lib/redis/store/factory.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 initialize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def initialize(options = {})
          super
    
          unless options[:marshalling].nil?
            puts %(
    Severity: Minor
    Found in lib/redis/store.rb - About 55 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 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
    Severity: Minor
    Found in lib/redis/store/namespace.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