Showing 2,813 of 2,813 total issues
Method get
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.get(_sortvar = nil, _sortorder = nil, _user_id = nil, _show = nil, _parent_id = nil, _search = nil); end
Method signed_up_topic
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def signed_up_topic(team)
# The purpose is to return the topic that the contributor has signed up to do for this assignment.
# Returns a record from the sign_up_topic table that gives the topic_id for which the contributor has signed up
# Look for the topic_id where the team_id equals the contributor id (contributor is a team or a participant)
- 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_parents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_parents
parents = []
seen = {}
current = self.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 response_map_to_metareview
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def response_map_to_metareview(metareviewer)
response_map_set = Array.new(review_mappings)
# Reject response maps without responses
response_map_set.reject! {|response_map| response_map.response.empty? }
raise 'There are no reviews to metareview at this time for this assignment.' if response_map_set.empty?
- 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 save_new_questions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def save_new_questions(questionnaire_id)
if params[:new_question]
# The new_question array contains all the new questions
# that should be saved to the database
params[:new_question].keys.each do |question_key|
- 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_children
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_children(sortvar = nil, sortorder = nil, user_id = nil, show = nil, _parent_id = nil, search = nil)
Method add_table_rows
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_table_rows questionnaire_max, questions, answers, code, tag_prompt_deployments = nil, current_user = nil
Method export_details_fields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.export_details_fields(detail_options)
fields = []
fields << 'Team ID / Author ID' if detail_options['team_id'] == 'true'
fields << 'Reviewee (Team / Student Name)' if detail_options['team_name'] == 'true'
fields << 'Reviewer' if detail_options['reviewer'] == '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 get_available_roles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_available_roles
ids = []
current = self.parent_id
while current
- 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_children
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_children(sortvar = nil, sortorder = nil, user_id = nil, show = nil, _parent_id = nil, search = nil)
Method view_heatgrid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def view_heatgrid(participant_id, type)
# get participant, team, questionnaires for assignment.
@participant = AssignmentParticipant.find(participant_id)
@assignment = @participant.assignment
@team = @participant.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
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.get(sortvar = 'name', _sortorder = 'desc', user_id = nil, show = nil, _parent_id = nil, _search = nil)
Method update_calculated_penalty_objects
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.update_calculated_penalty_objects(penalty_policy)
@penalty_objs = CalculatedPenalty.all
@penalty_objs.each do |pen|
@participant = AssignmentParticipant.find(pen.participant_id)
@assignment = @participant.assignment
- 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 new_quiz
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def new_quiz
valid_request = true
@assignment_id = params[:aid] # creating an instance variable to hold the assignment id
@participant_id = params[:pid] # creating an instance variable to hold the participant id
assignment = Assignment.find(@assignment_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_pie_chart_url
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.get_pie_chart_url(labels, values)
return "" if labels.length != values.length
address = "http://chart.apis.google.com/chart?cht=p3&chs=300x125"
max = 100.0
- 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 sort_reviewer_by_review_volume_desc
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def sort_reviewer_by_review_volume_desc
@reviewers.each do |r|
r.overall_avg_vol,
r.avg_vol_in_round_1,
r.avg_vol_in_round_2,
- 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 delete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delete(force = nil)
begin
maps = ReviewResponseMap.where(reviewed_object_id: self.id)
maps.each {|map| map.delete(force) }
rescue StandardError
- 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 export
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.export(csv, parent_id, options)
@assignment = Assignment.find(parent_id)
@questions = {}
questionnaires = @assignment.questionnaires
questionnaires.each do |questionnaire|
- 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 deeply nested control flow statements. Open
color.push link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'
Method generate_keys
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def generate_keys
# check if we are replacing a digital certificate already generated
replacing_key = true unless self.digital_certificate.nil?
# generate the new key pair
- 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"