Showing 2,813 of 2,813 total issues
Assignment Branch Condition size for summarize_reviews_by_criterion is too high. [42.34/15] Open
def summarize_reviews_by_criterion(assignment, summary_ws_url)
# @summary[reviewee][round][question]
# @avg_score_round[reviewee][round]
# @avg_scores_by_criterion[reviewee][round][criterion]
nround = assignment.rounds_of_reviews
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for remove_participant is too high. [42.07/15] Open
def remove_participant
# remove the record from teams_users table
team_user = TeamsUser.where(team_id: params[:team_id], user_id: student.user_id)
remove_team_user(team_user)
# if your old team does not have any members, delete the entry for the team
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for save is too high. [42.59/15] Open
def save
@map = ResponseMap.find(params[:id])
@return = params[:return]
@map.save
participant = Participant.find_by(id: @map.reviewee_id)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for update is too high. [42.07/15] Open
def update
@course = Course.find(params[:id])
if params[:course][:directory_path] && @course.directory_path != params[:course][:directory_path]
begin
FileHelper.delete_directory(@course)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
File sign_up_sheet_controller.rb
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
class SignUpSheetController < ApplicationController
require 'rgl/adjacency'
require 'rgl/dot'
require 'rgl/topsort'
Assignment Branch Condition size for edit is too high. [41.11/15] Open
def edit(_count)
html = '<tr>'
html += '<td align="center"><a rel="nofollow" data-method="delete" href="/questions/' + self.id.to_s + '">Remove</a></td>'
html += '<td><input size="6" value="' + self.seq.to_s + '" name="question[' + self.id.to_s + '][seq]" id="question_' + self.id.to_s + '_seq" type="text"></td>'
html += '<td><textarea cols="50" rows="1" name="question[' + self.id.to_s + '][txt]" id="question_' + self.id.to_s + '_txt" placeholder="Edit question content here">' + self.txt + '</textarea></td>'
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for edit is too high. [41.11/15] Open
def edit(_count)
html = '<tr>'
html += '<td align="center"><a rel="nofollow" data-method="delete" href="/questions/' + self.id.to_s + '">Remove</a></td>'
html += '<td><input size="6" value="' + self.seq.to_s + '" name="question[' + self.id.to_s + '][seq]" id="question_' + self.id.to_s + '_seq" type="text"></td>'
html += '<td><textarea cols="50" rows="1" name="question[' + self.id.to_s + '][txt]" id="question_' + self.id.to_s + '_txt" placeholder="Edit question content here">' + self.txt + '</textarea></td>'
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for view_question_text is too high. [41.81/15] Open
def view_question_text
html = '<TR><TD align="left"> ' + self.txt + ' </TD>'
html += '<TD align="left">' + self.type + '</TD>'
html += '<td align="center">' + self.weight.to_s + '</TD>'
questionnaire = self.questionnaire
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for authorised? is too high. [41.82/15] Open
def self.authorised?(session, params)
authorised = false # default
check_controller = false
if params[:controller] == 'content_pages' and
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for switch_original_topic_to_approved_suggested_topic is too high. [41.41/15] Open
def switch_original_topic_to_approved_suggested_topic
assignment = AssignmentParticipant.find(params[:id]).assignment
team_id = TeamsUser.team_id(assignment.id, session[:user].id)
original_topic_id = SignedUpTeam.topic_id(assignment.id.to_i, session[:user].id)
SignUpTopic.find(params[:topic_id]).update_attribute(:private_to, nil) if SignUpTopic.exists?(params[:topic_id])
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Class AssignmentsController
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class AssignmentsController < ApplicationController
include AssignmentHelper
autocomplete :user, :name
before_action :authorize
Block has too many lines. [77/25] Open
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
# config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Assignment Branch Condition size for update_tag_prompt_deployments is too high. [40.99/15] Open
def update_tag_prompt_deployments(attributes)
unless attributes.nil?
attributes.each do |key, value|
TagPromptDeployment.where(id: value['deleted']).delete_all if value.key?('deleted')
# assume if tag_prompt is there, then id, question_type, answer_length_threshold must also be there since the inputs are coupled
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for delete is too high. [40.56/15] 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
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for list is too high. [40.56/15] Open
def list
@participant = AssignmentParticipant.find(params[:id])
return unless current_user_id?(@participant.user_id)
@assignment = @participant.assignment
# Find the current phase that the assignment is in.
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for list is too high. [40.99/15] Open
def list
redirect_to(controller: 'eula', action: 'display') if current_user.is_new_user
session[:user] = User.find_by(id: current_user.id)
@student_tasks = StudentTask.from_user current_user
if session[:impersonate] && !impersonating_as_admin?
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for submit_hyperlink is too high. [40.42/15] Open
def submit_hyperlink
@participant = AssignmentParticipant.find(params[:id])
return unless current_user_id?(@participant.user_id)
team = @participant.team
team_hyperlinks = team.hyperlinks
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for create is too high. [40.22/15] Open
def create
# if the user name already exists, register the user by email address
check = User.find_by(name: params[:user][:name])
params[:user][:name] = params[:user][:email] unless check.nil?
@user = User.new(user_params)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for delete is too high. [40.64/15] Open
def delete
begin
assignment_form = AssignmentForm.create_form_object(params[:id])
user = session[:user]
# Issue 1017 - allow instructor to delete assignment created by TA.
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Block has too many lines. [75/25] Open
describe "SignUpSheetHelper" do
describe "#check_topic_due_date_value" do
before(:each) do
@assignment = create(:assignment)
@topic = create(:topic, assignment: @assignment)
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.