Showing 419 of 572 total issues
Avoid too many return
statements within this method. Open
return unless (invalid_cud || nicknameless_student) && !in_edit_or_unsudo
Avoid too many return
statements within this method. Open
redirect_to([:users, @course]) && return
Avoid too many return
statements within this method. Open
status: :bad_request) && return
Avoid too many return
statements within this method. Open
return unless @scoreboard.colspec.present?
Avoid too many return
statements within this method. Open
render(plain: "WARNING: could not clear previous handin directory, please") && return
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
render(plain: flash[:error], status: :bad_request) && return unless validateHandinForGroups_forHTML
Function updateButtonVisibility
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function updateButtonVisibility(item){
// Deleting instances only avilable in archive tab
showTopButtons(true, true, true, false, true);
switch ($(item).attr("data-tab")) {
case "pending_tab":
- 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 load_config_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_config_file
# read from source
config_source = File.open(unique_source_config_file_path, "r", &:read)
# validate syntax of config
- 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 check_box
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_box(name, *args)
options = args.extract_options!
display_name = options[:display_name].nil? ? name : options[: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"
Further reading
Method get_callback_url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_callback_url(course, assessment, submission, dave)
# Use https, unless explicitly specified not to
prefix = "https://"
if ENV["DOCKER_SSL"] == "false"
prefix = "http://"
- 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 tango_status
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def tango_status
# Obtain overall Tango info and pool status
@tango_info = TangoClient.info
@vm_pool_list = TangoClient.pool
# Obtain Image -> Course mapping
- 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 validateHandin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validateHandin(size, content_type, filename)
# Make sure that handins are allowed
if @assessment.disable_handins?
return :handin_disabled
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 send_test_email
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def send_test_email
required_params = %w[protocol host address port authentication communication_protocol to_email
from_email default_from]
# Create temp file to save the new configuration
- 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 set_course
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def set_course
course_name = params[:course_name] ||
(params[:controller] == "courses" ? params[:name] : nil)
@course = Course.find_by(name: course_name) if course_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"
Further reading
Method recoverHierarchy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.recoverHierarchy(files, root)
depth = root[:pathname].chomp("/").count "/"
if(root[:pathname] == "")
depth = -1
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 index
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def index
unless @cud.instructor
aud = @assessment.aud_for @cud.id
if aud.group
redirect_to(course_assessment_group_path(@course, @assessment, aud.group)) && 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 require_privilege
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def require_privilege(scope)
# check if client has the required scope
doorkeeper_authorize! scope
return if performed?
- 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 maintenance_mode?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def maintenance_mode?
# enable/disable maintenance mode with this switch:
return unless ENV["AUTOLAB_MAINTENANCE"]
render(:maintenance) && return unless user_signed_in? && current_user.administrator?
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"