bmedici/pushyd

View on GitHub

Showing 6 of 6 total issues

Method handle_relay has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def handle_relay context, message, headers
      # Check we have a valid @rule
      raise ConsumerRuleMissing unless @rule.is_a? Hash

      # Check if we need to relay anything
Severity: Minor
Found in lib/pushyd/consumer.rb - About 1 hr to fix

    Method create_consumer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def create_consumer rule
          # Check information
          rule_name   = rule[:name].to_s
          rule_topic  = rule[:topic].to_s
          rule_queue  = sprintf('%s-%s', BmcDaemonLib::Conf.app_name, rule_name.gsub('_', '-'))
    Severity: Minor
    Found in lib/pushyd/proxy.rb - About 1 hr to fix

      Method handle_relay has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          def handle_relay context, message, headers
            # Check we have a valid @rule
            raise ConsumerRuleMissing unless @rule.is_a? Hash
      
            # Check if we need to relay anything
      Severity: Minor
      Found in lib/pushyd/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 headers_sign has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def headers_sign headers, config
            # Extract and check
            return unless config.is_a? Hash
            hmac_method   = config[:method]
            hmac_user     = config[:user]
      Severity: Minor
      Found in lib/shared/hmac_signature.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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def initialize(channel, config_shout)
            # Init MqConsumer
            log_pipe :shouter
            super
      
      
      Severity: Minor
      Found in lib/pushyd/shouter.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 create_consumer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def create_consumer rule
            # Check information
            rule_name   = rule[:name].to_s
            rule_topic  = rule[:topic].to_s
            rule_queue  = sprintf('%s-%s', BmcDaemonLib::Conf.app_name, rule_name.gsub('_', '-'))
      Severity: Minor
      Found in lib/pushyd/proxy.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

      Severity
      Category
      Status
      Source
      Language