Showing 4,497 of 4,497 total issues
Block has too many lines. [108/25] Open
describe AuthController do
let(:admin) { build(:admin) }
let(:instructor) { build(:instructor, id: 6) }
let(:instructor_role) { build(:role_of_instructor, id: 2, name: 'Instructor_role_test', description: '', parent_id: nil, default_page_id: nil) }
describe '#action_allowed?' do
- 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.
Block has too many lines. [108/25] Open
context 'method is called' do
before(:each) do
allow(Course).to receive(:find).with('1').and_return(course)
request.env['HTTP_REFERER'] = REDIRECT_PATH
end
- 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.
Method has too many lines. [57/10] Open
def display_volume_metric_chart(reviewer)
labels, reviewer_data, all_reviewers_data = initialize_chart_elements(reviewer)
data = {
labels: labels,
datasets: [
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [57/10] Open
def peer_review_strategy(assignment_id, review_strategy, participants_hash)
teams = review_strategy.teams
participants = review_strategy.participants
num_participants = participants.size
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for delete_signup is too high. [62.42/15] Open
def delete_signup
participant = AssignmentParticipant.find(params[:id])
assignment = participant.assignment
drop_topic_deadline = assignment.due_dates.find_by(deadline_type_id: 6)
# A student who has already submitted work should not be allowed to drop his/her topic!
- 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. [105/25] Open
describe AssignmentQuestionnaireController do
let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
let(:student1) { build(:student, id: 21, role_id: 1) }
let(:assignment) { build(:assignment, id: 1) }
- 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.
Block has too many lines. [105/25] Open
describe 'Questionnaire tests for instructor interface' do
before(:each) do
assignment_setup
end
describe 'Instructor login' do
- 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.
Block has too many lines. [105/25] Open
describe 'Assignment creation topics tab', js: true do
include AssignmentCreationHelper
before(:each) do
create_deadline_types
(1..3).each do |i|
- 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 assignment_questionnaire is too high. [60.32/15] Open
def assignment_questionnaire(questionnaire_type, round_number, topic_id, duty_id = nil)
round_number = nil if round_number.blank?
topic_id = nil if topic_id.blank?
# Default value of duty_id is nil, and when duty_id is not nil, then it means that the function call
- 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
Method has too many lines. [55/10] Open
def hash_rows_with_headers(header, body)
new_body = []
if (params[:model] == 'User') || (params[:model] == 'AssignmentParticipant') || (params[:model] == 'CourseParticipant') || (params[:model] == 'SignUpTopic')
header.map! { |str| str.strip.downcase.gsub(/\s+/, "").to_sym }
body.each do |row|
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Block has too many lines. [103/25] Open
describe MultipleChoiceCheckbox do
let(:multiple_choice_checkbox) { build(:multiple_choice_checkbox, id: 1) }
let(:questionnaire1) { build(:questionnaire, id: 1, type: 'ReviewQuestionnaire') }
let(:questionnaire2) { build(:questionnaire, id: 2, type: 'MetareviewQuestionnaire') }
let(:team) { build(:assignment_team, id: 1, name: 'no team') }
- 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.
Block has too many lines. [103/25] Open
describe '#update' do
context 'when params does not have key :assignment_form' do
context 'when assignment is saved successfully' do
it 'shows a note flash message and redirects to tree_display#index page' do
allow(assignment).to receive(:save).and_return(true)
- 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 view_completed_question is too high. [59.74/15] Open
def view_completed_question(count, answer, questionnaire_max, tag_prompt_deployments = nil, current_user = nil)
html = '<b>' + count.to_s + '. ' + txt + ' [Max points: ' + questionnaire_max.to_s + ']</b>'
score = answer && !answer.answer.nil? ? answer.answer.to_s : '-'
score_percent = score != '-' ? answer.answer * 1.0 / questionnaire_max : 0
score_color = if score_percent > 0.8
- 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
Method has too many lines. [54/10] Open
def create
user = User.find_by(name: params[:user][:name].strip)
unless user
urlCreate = url_for controller: 'users', action: 'new'
flash[:error] = "\"#{params[:user][:name].strip}\" is not defined. Please <a href=\"#{urlCreate}\">create</a> this user before continuing."
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for paginate_list is too high. [58.86/15] Open
def paginate_list
versions = Version.page(params[:page]).order('id').per_page(25)
versions = versions.where(id: params[:id]) if params[:id].to_i > 0
if current_user_has_super_admin_privileges?
versions = versions.where(whodunnit: params[:post][:user_id]) if params[:post][:user_id].to_i > 0
- 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 impersonate is too high. [58.42/15] Open
def impersonate
begin
@original_user = session[:super_user] || session[:user]
if params[:impersonate].nil?
@message = "You cannot impersonate '#{params[:user][:name]}'."
- 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. [58.56/15] Open
def list
@participant = AssignmentParticipant.find(params[:id].to_i)
@assignment = @participant.assignment
@slots_filled = SignUpTopic.find_slots_filled(@assignment.id)
@slots_waitlisted = SignUpTopic.find_slots_waitlisted(@assignment.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 48 methods (exceeds 20 allowed). Consider refactoring. Open
class AssignmentsController < ApplicationController
include AssignmentHelper
include AuthorizationHelper
autocomplete :user, :name
before_action :authorize
Block has too many lines. [101/25] Open
describe '#create' do
before(:each) do
allow(AssignmentForm).to receive(:new).with(any_args).and_return(assignment_form)
@used_params = {
button: true,
- 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.
Block has too many lines. [100/25] Open
describe '#automatic_review_mapping' do
before(:each) do
allow(AssignmentParticipant).to receive(:where).with(parent_id: 1).and_return([participant, participant1, participant2])
end
- 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.