Showing 419 of 572 total issues
Method show
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def show
@aud = @assessment.aud_for @cud.id
unless @cud.instructor
redirect_to(action: :new) && return if @aud.group_id.nil?
- 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 join
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def join
if !@assessment.allow_student_assign_group && @cud.student?
flash[:error] = "You are not allowed to join another group for this assessment. "\
"Contact your instructor for group assignment."
redirect_to(action: :new) && return
- 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def update
# if ajax called update, don't set a flash or perform a redirect_to
if params.include?(:ajax)
if @problem.update(problem_params)
render json: { success: true }
- 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 feedback
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def feedback
# param check
if !params.has_key?(:problem)
raise ApiError.new("Required parameter 'problem' not found", :bad_request)
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
Avoid too many return
statements within this function. Open
return 'matrix(' + pf(m[0]) + ' ' + pf(m[1]) + ' ' + pf(m[2]) + ' ' +
pf(m[3]) + ' ' + pf(m[4]) + ' ' + pf(m[5]) + ')';
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return i;
Avoid too many return
statements within this function. Open
return columns[cell].focusable;
Avoid too many return
statements within this function. Open
return result;
Avoid too many return
statements within this method. Open
return :valid
Avoid too many return
statements within this method. Open
redirect_to(controller: :jobs, item: nil) && return
Avoid too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return :fail_type_check
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this function. Open
return false;