Showing 5 of 76 total issues
Class Broker
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Broker
include Moleculer::Support
extend Forwardable
attr_reader :config, :logger
- Create a ticketCreate a ticket
Method process_message
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process_message(message)
return :disconnect if message == @disconnect_hash
return nil if message_is_disconnect?(message)
- 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 connect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Confirmed
def connect
@thread = Thread.new do
begin
@logger.debug "starting subscription to '#{@channel}'"
@connection.subscribe(@channel) do |on|
- 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 register_node
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def register_node(node)
return local_node if @local_node && node.id == @local_node.id
if node.local?
raise Errors::LocalNodeAlreadyRegistered, "A LOCAL node has already been registered" if @local_node
- 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 parse_args
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_args(args)
if args.last.is_a?(Hash)
args.each_index do |v|
args[v] = "\n" + args[v].ai + "\n" unless args[v].is_a?(String)
end
- 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"