Showing 6 of 6 total issues
Method create_columns
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_columns
{
rails_workflow_contexts: [
%i[integer parent_id],
%i[string parent_type],
Method process
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process
process = ProcessTemplate
.where(uuid: template_json['uuid']).first_or_create!
template_json['child_processes'] && template_json['child_processes'].each do |child_process|
Method prepare_body
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def prepare_body(body)
if body.is_a? Array
body.map do |element|
prepare_body element
end
- 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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process
process = ProcessTemplate
.where(uuid: template_json['uuid']).first_or_create!
template_json['child_processes'] && template_json['child_processes'].each do |child_process|
- 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_in_transaction
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def execute_in_transaction
with_transaction do
child_process_runner.start if child_process.present?
operation.execute if operation.respond_to?(:execute)
complete
- 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 prepare_data
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def prepare_data(data)
if data.is_a? ActiveRecord::Base
{ id: data.id, class: data.class.to_s }
elsif data.is_a? Array
data.map do |element|
- 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"