Showing 430 of 4,506 total issues
Avoid too many return
statements within this function. Open
return a_val.localeCompare(b_val)
Avoid too many return
statements within this function. Open
return (this.toUTCString());
Avoid too many return
statements within this function. Open
return -1
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this function. Open
return 1
Avoid too many return
statements within this method. Open
return name
Avoid too many return
statements within this function. Open
return 0
Avoid too many return
statements within this function. Open
return (this.GetMonthName(false)+DateSeparator+pDate+DateSeparator+this.Year);
Avoid too many return
statements within this method. Open
return aq if aq.questionnaire_id && Questionnaire.find(aq.questionnaire_id).type == questionnaire_type
Avoid too many return
statements within this method. Open
return unless team_member_added
Method system_pages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def system_pages(pageid)
pages = []
pages << 'Site default page' if site_default_page_id == pageid
pages << 'Not found page' if not_found_page_id == pageid
- 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_user_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_user_list(user)
courses = Ta.get_mapped_courses(user.id)
participants = []
user_list = []
courses.each do |course_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 get_number_of_taggable_answers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_number_of_taggable_answers(user_id)
team = Team.joins(:teams_users).where(team_users: { parent_id: assignment_id }, user_id: user_id)
responses = Response.joins(:response_maps).where(response_maps: { reviewed_object_id: assignment.id, reviewee_id: team.id })
questions = Question.where(questionnaire_id: questionnaire.id, type: question_type)
- 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 remove_from_waitlists
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.remove_from_waitlists(team_id)
signups = SignedUpTeam.where(team_id: team_id)
signups.each do |signup|
signup_topic_id = signup.topic_id
signup.destroy
- 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 force_delete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def force_delete(maps)
maps && maps.each(&:destroy)
if team && (team.teams_users.length == 1)
team.delete
elsif team
- 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_responses_for_team_round
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_responses_for_team_round(team, round)
responses = []
if team.id
maps = ResponseMap.where(reviewee_id: team.id, type: 'ReviewResponseMap')
maps.each do |map|
- 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 team_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.team_id(assignment_id, user_id)
# team_id variable represents the team_id for this user in this assignment
team_id = nil
teams_users = TeamsUser.where(user_id: user_id)
teams_users.each do |teams_user|
- 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
Function toggleElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function toggleElement(elementId, linkText) {
var obj = document.getElementById(elementId);
if (obj == null) { return; }
var bExpand = obj.style.display.length == 0;
obj.style.display = (bExpand ? 'none' : '');
- 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
Function onMetricToggle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function onMetricToggle(clicked_metric) {
if (clicked_metric.checked == true) {
var hide = false
} else {
var hide = 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 update_assigned_badges
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_assigned_badges(badge, assignment)
if assignment && badge
AssignmentBadge.where(assignment_id: assignment[:id]).map(&:id).each do |assigned_badge_id|
AssignmentBadge.delete(assigned_badge_id) unless badge[:id].include?(assigned_badge_id)
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"