nkeyes/philotic

View on GitHub

Showing 5 of 5 total issues

Class Message has 25 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Message
    NotInstantiableError = Class.new(RuntimeError)

    attr_accessor :connection, :publish_error, :delivery_info
    attr_writer :published
Severity: Minor
Found in lib/philotic/message.rb - About 2 hrs to fix

    Method add has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

          def add(severity, message = nil, progname = nil)
            severity ||= UNKNOWN
            if @logdev.nil? or severity < @level
              return true
            end
    Severity: Minor
    Found in lib/philotic/logging/logger.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 _consume has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def _consume(message)
          if self.class.auto_acknowledge?
            begin
              consume(message)
              acknowledge(message)
    Severity: Minor
    Found in lib/philotic/consumer.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 get_subscription_settings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_subscription_settings(subscription, subscribe_options)
    
          if [Symbol, String].include? subscription.class
            queue_name    = subscription
            subscription  = subscribe_options
    Severity: Minor
    Found in lib/philotic/subscriber.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 initialize_named_queue! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def initialize_named_queue!(queue_name, config)
          raise RuntimeError.new 'Philotic.config.initialize_named_queues must be true to run Philotic.initialize_named_queue!' unless self.config.initialize_named_queues
    
          connect!
          queue_exists = connection.queue_exists? queue_name
    Severity: Minor
    Found in lib/philotic/connection.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