Method x_link_for
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def x_link_for(component, verb, as_name = nil, params = {})
link_text = params.delete(:link_text) || "#{verb} "
url = run_url_for(component, params, params.delete(:format))
run_type = case component
- 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 student_run_buttons
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def student_run_buttons(offering,opts={})
default_solo_label = display_workgroups_run_link?(offering) ? "Run by Myself" : "Run"
solo_label = opts[:solo_text] || default_solo_label
group_label = opts[:group_label]|| "Run with Other Students"
options = popup_options_for(offering)
- 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 x_button_for
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def x_button_for(component, verb, image = verb, params = {}, run_as = nil)
Method popup_options_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def popup_options_for(component,_options={})
options = _options.dup
if component.is_a?(ExternalActivity)
options[:target] = '_blank' if component.popup
elsif component.is_a?(Portal::Offering) && component.external_activity?
- 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 run_url_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def run_url_for(component, params = {}, format = nil)
if component.instance_of? Interactive
return component.url
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 x_button_for
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def x_button_for(component, verb, image = verb, params = {}, run_as = nil)
unless run_as
run_as = case component
when ExternalActivity then ExternalActivity.display_name
- 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"