Method rsop
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def rsop
assert_privileges('policy_simulation')
if params[:button] == "submit"
if params[:task_id] # First time thru, kick off the report generate task
miq_task = MiqTask.find(params[:task_id]) # Not first time, read the task record
- 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 rsop
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rsop
assert_privileges('policy_simulation')
if params[:button] == "submit"
if params[:task_id] # First time thru, kick off the report generate task
miq_task = MiqTask.find(params[:task_id]) # Not first time, read the task record
- Create a ticketCreate a ticket
Method rsop_option_changed
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rsop_option_changed
assert_privileges('policy_simulation')
if params[:event_typ]
@sb[:rsop][:event] = params[:event_typ].presence
@sb[:rsop][:event_value] = nil
- Create a ticketCreate a ticket
Method rsop_option_changed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def rsop_option_changed
assert_privileges('policy_simulation')
if params[:event_typ]
@sb[:rsop][:event] = params[:event_typ].presence
@sb[:rsop][:event_value] = nil
- 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 rsop_show_options
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def rsop_show_options
assert_privileges('policy_simulation')
@explorer = true
if params.key?(:passed)
if params[:passed] == "null" || params[:passed] == ""
- 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 rsop_button_pressed
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def rsop_button_pressed
render :update do |page|
page << javascript_prologue
if params[:action] == "rsop_toggle"
if @sb[:rsop][:open] == true
- 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"