Showing 2,813 of 2,813 total issues
Assignment Branch Condition size for create_questionnaire is too high. [30.51/15] Open
def create_questionnaire
@questionnaire = Object.const_get(params[:questionnaire][:type]).new(questionnaire_params)
# TODO: check for Quiz Questionnaire?
if @questionnaire.type == "QuizQuestionnaire" # checking if it is a quiz 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 move_selected_file is too high. [30.38/15] Open
def move_selected_file
old_filename = params[:directories][params[:chk_files]] + "/" + params[:filenames][params[:chk_files]]
newloc = @participant.dir_path
newloc += "/"
newloc += params[:faction][:move]
- 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 action_allowed? is too high. [30.66/15] Open
def action_allowed?
# currently we only have a index method which shows all the submission records given a team_id
assignment_team = AssignmentTeam.find(params[:team_id])
assignment = Assignment.find(assignment_team.parent_id)
return true if ['Super-Administrator', 'Administrator'].include? current_role_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 index is too high. [30.61/15] Open
def index
@tagprompts = TagPrompt.all.order("prompt asc")
@tagprompts.where!("prompt LIKE ?", "%#{params[:prompt]}%") if params.key?(:prompt) and !params[:prompt] == ""
@tagprompts.where!("desc LIKE ?", "%#{params[:desc]}%") if params.key?(:desc) and !params[:desc] == ""
@tagprompts.where!("control_type LIKE ?", "%#{params[:control_type]}%") if params.key?(:control_type) and !params[:control_type] == ""
- 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_allowed? is too high. [30.87/15] Open
def edit_allowed?(map, user_id)
assignment = map.reviewer.assignment
# if it is a review response map, all the members of reviewee team should be able to view the reponse (can be done from heat map)
if map.is_a? ReviewResponseMap
reviewee_team = AssignmentTeam.find(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 remove is too high. [30.28/15] Open
def remove
begin
team = AssignmentTeam.find_by(id: params[:team_id])
team.update_attributes(advertise_for_partner: false, comments_for_advertisement: nil)
participant = AssignmentParticipant.find_by(parent_id: team.assignment.id, user_id: session[:user].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
Block has too many lines. [62/25] Open
describe '#create' do
context 'when topic cannot be found' do
context 'when new topic can be saved successfully' do
it 'sets up a new topic and redirects to assignment#edit page' do
allow(SignUpTopic).to receive(:where).with(topic_name: 'Hello world!', assignment_id: '1').and_return([nil])
- 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. [62/25] Open
it "student2065 hold suggest topic and suggest a new one, but wish to stay in the old topic", js: true do
# login_as "student2065"
user = User.find_by(name: 'student2065')
stub_current_user(user, user.role.name, user.role)
visit '/student_task/list'
- 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 build_tone_analysis_heatmap
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_tone_analysis_heatmap
@heatmap_urls = []
keys = @review_final_versions.keys
File response_controller.rb
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
class ResponseController < ApplicationController
helper :submitted_content
helper :file
def action_allowed?
Class SignUpSheetController
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class SignUpSheetController < ApplicationController
require 'rgl/adjacency'
require 'rgl/dot'
require 'rgl/topsort'
Function render
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
var creation_date;
var updated_date;
var colWidthArray = ["30%", "0%", "0%", "0%", "25%", "25%", "20%"]
var colDisplayStyle = {
Assignment Branch Condition size for get_responses_for_team_round is too high. [29.5/15] 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
- 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 teamed_students is too high. [29.85/15] Open
def self.teamed_students(user, ip_address = nil)
students_teamed = {}
user.teams.each do |team|
next unless team.is_a?(AssignmentTeam)
# Teammates in calibration assignment should not be counted in teaming requirement.
- 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 reassign_topic is too high. [29.48/15] Open
def self.reassign_topic(session_user_id, assignment_id, topic_id)
# find whether assignment is team assignment
assignment = Assignment.find(assignment_id)
# making sure that the drop date deadline hasn't passed
- 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 compute_avg_and_ranges_hash is too high. [29.22/15] Open
def compute_avg_and_ranges_hash
scores = {}
contributors = self.contributors # assignment_teams
if self.varying_rubrics_by_round?
rounds = self.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 valid_start_end_time? is too high. [29.83/15] Open
def valid_start_end_time?
if end_date.nil? || start_date.nil?
errors[:base] << "The start and end time should be specified."
return false
end
- 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 store_results is too high. [29.09/15] Open
def self.store_results(assignment_submission_simicheck_id, threshold)
response = SimiCheckWebService.get_similarity_nxn(assignment_submission_simicheck_id)
json_response = JSON.parse(response.body)
json_response["similarities"].each do |similarity|
next unless similarity["similarity"] >= threshold
- 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 add_metareviewer is too high. [29.9/15] Open
def add_metareviewer
mapping = ResponseMap.find(params[:id])
msg = ''
begin
user = User.from_params(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 check_reset_url is too high. [29.02/15] Open
def check_reset_url
if params[:token].nil?
flash[:error] = "Password reset page can only be accessed with a generated link, sent to your email"
render template: "password_retrieval/forgotten"
else
- 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