Showing 7 of 28 total issues
Class Result
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Result # rubocop:disable Metrics/ClassLength
# By default, a command is ok?
def initialize
@result_code = RESULT_CODE_OK
@last_error = nil
Method match_message?
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def match_message?(msg)
return @msg == msg unless msg.is_a? Hash
msg.each do |k, v|
k = k.to_s if k.is_a? Symbol
return false unless @msg.key?(k)
- Read upRead up
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 validate_input
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def validate_input(dest, args)
return true unless should_validate(dest)
@input.each do |p|
val = args[p[:symbol]]
- Read upRead up
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 process_output
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def process_output(dest, result)
return unless result.ok? && should_validate(dest)
@output.each do |param|
sym = param[:symbol]
- Read upRead up
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 execute_child
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.execute_child(parent, cls, result, result_key, params = {})
Method next
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def next(msg)
# be tolerant of the fact that there might be other
# stuff in the log file.
next_line do |input, line|
if input.key?('sequence')
- Read upRead up
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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute(result)
if ActiveRecord::Base.connection.open_transactions >= 1
super(result)
else
result.info('start_transaction')
- Read upRead up
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"