Showing 9 of 21 total issues
Method subscribe_background_job_impl
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def subscribe_background_job_impl(options)
queue_name, headers = queue_for_subscribe(options)
subscribe(queue_name, headers) do |msg|
begin
- Read upRead up
- Create a ticketCreate a ticket
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 subscribe_background_job_impl
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def subscribe_background_job_impl(options)
queue_name, headers = queue_for_subscribe(options)
subscribe(queue_name, headers) do |msg|
begin
- Create a ticketCreate a ticket
Method subscribe_messages_impl
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def subscribe_messages_impl(options)
queue_name, headers = queue_for_subscribe(options)
# for STOMP we can get message one at a time
subscribe(queue_name, headers) do |msg|
- Read upRead up
- Create a ticketCreate a ticket
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 rdkafka_connection_opts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def rdkafka_connection_opts(options)
hosts = Array(options[:hosts] || options[:host])
hosts.collect! { |host| "#{host}:#{options[:port]}" }
result = {:"bootstrap.servers" => hosts.join(',')}
- Read upRead up
- Create a ticketCreate a ticket
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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(sender, message, payload, headers, ack_ref, client)
- Create a ticketCreate a ticket
Method publish_message_impl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def publish_message_impl(options, &block)
address, headers = queue_for_publish(options)
headers[:sender] = options[:sender] if options[:sender]
headers[:message_type] = options[:message] if options[:message]
headers[:class_name] = options[:class_name] if options[:class_name]
- Read upRead up
- Create a ticketCreate a ticket
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 decode_body
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def decode_body(headers, raw_body)
return raw_body unless headers.kind_of?(Hash)
case headers["encoding"] || headers[:encoding]
when "json"
JSON.parse(raw_body)
- Read upRead up
- Create a ticketCreate a ticket
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 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options)
host = options.slice(:host, :port, :ssl)
host[:passcode] = options[:password] if options[:password]
host[:login] = options[:username] if options[:username]
- Read upRead up
- Create a ticketCreate a ticket
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 queue_for_publish
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def queue_for_publish(options)
affinity = options[:affinity] || 'none'
address = "queue/#{options[:service]}.#{affinity}"
headers = {:"destination-type" => 'ANYCAST', :persistent => true}
- Read upRead up
- Create a ticketCreate a ticket
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"