Showing 5 of 5 total issues
Method failure_details
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def failure_details(workflow_execution)
terminal_event = workflow_execution.history_events.reverse_order.detect {|e|
TERMINAL_EVENT_TYPES_ON_FAILURE.include?(e.event_type)
}
if terminal_event
Method parse_attribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_attribute(event, key)
value = nil
begin
json_value = event.attributes[key]
rescue ArgumentError
- 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 failure_details
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def failure_details(workflow_execution)
terminal_event = workflow_execution.history_events.reverse_order.detect {|e|
TERMINAL_EVENT_TYPES_ON_FAILURE.include?(e.event_type)
}
if terminal_event
- 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_returned_hash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def process_returned_hash(activity_task, returned_hash)
return unless returned_hash.kind_of? Hash
kind, value = returned_hash.detect { |k, v| KNOWN_RETURN_KEYS.include? k }
case kind
when :error
- 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 isolation_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def isolation_id
file = @config.isolation_file || @config.task_list_suffix_file
return "" unless file
File.write(file, SecureRandom.hex(9)) unless File.exist?(file)
@isolation_id ||= File.read(file)
- 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"