Showing 11 of 202 total issues
Method build_journey_plan
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def build_journey_plan
# The Order of sequences should have been preserved as insertion order
#puts "DEBUG: START PLAN - Processing SEQUENCES\n#{sequence_list.inspect}"
- 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 build_split_sequence_events
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_split_sequence_events(sequence, prev_seq, next_seq)
puts "\n\nDEBUG: PROCESS SPLIT SEQ #{sequence.inspect}"
puts "DEBUG: SPLIT prev_seq #{prev_seq.inspect}"
puts "DEBUG: SPLIT next_seq #{next_seq.inspect}"
- 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 build_and_display
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def build_and_display
state = params['state']
factory = params['factory']
plan = if factory
- 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 index
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
state_paths = []
DatashiftJourney.journey_plan_class.new.state_paths.each_with_index do |s, i|
Method build_triggered_back
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def build_triggered_back(sequence, prev_seq)
puts "DEBUG: * BUILD triggered Back for #{sequence.inspect}"
# Create back from FIRST item of THIS sequence to LAST entry of EACH previous BRANCH
branch_sequence_map.branches_for(prev_seq).each do |branch|
- 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 build_triggered_next
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_triggered_next(branch, from, to)
puts "DEBUG: * BUILD triggered Next for #{branch.inspect} Between : #{from.inspect} -> #{to.inspect}"
# N.B sequences can self terminate i.e no further sequences and end of the journey
return unless from && from != to
- 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 show
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show
journey_plan_class = params[:journey_plan_class] ? params[:journey_plan_class].constantize : DatashiftJourney.journey_plan_class
token = params[:id] || params[:journey_plan_id]
- 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 create_next
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_next(from, to, &block)
raise "Bad transitions supplied for Next - FROM #{from} - TO #{to}" if from.nil? || to.nil?
if block_given?
#puts "DEBUG: Creating NEXT transition from #{from} to #{to} with Block from:\n#{caller.first}"
transition(from => to, on: :skip_fwd, if: block.call)
- 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_state
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_state
current_index = journey_plan.current_state_index
view_state = params[:rendered_state]
- 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 save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def save(params)
form_params = params.fetch(params_key, {})
data_nodes = form_params["data_nodes"] # =>{"form_field"=>{"0"=>"name", "1"=>"namespace"}, "field_value"=>{"0"=>"dfsdf", "1"=>"ghfghf"}}}
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(journey_plan)
super(journey_plan)
@journey_plan = journey_plan
- 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"