Showing 2,813 of 2,813 total issues
Block has too many lines. [130/25] Open
describe Answer do
let(:questionnaire) { create(:questionnaire, id: 1) }
let(:question1) { create(:question, questionnaire: questionnaire, weight: 1, id: 1) }
let(:question2) { create(:question, questionnaire: questionnaire, weight: 2, id: 2) }
let(:response_map) { create(:review_response_map, id: 1, reviewed_object_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.
Function render
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var _rows = []
var _this = this
var colWidthArray = ["30%", "0%", "0%", "0%", "25%", "25%", "20%"]
var colDisplayStyle = {
Module has too many lines. [110/100] Open
module ReviewAssignment
def contributors
# ACS Contributors are just teams, so removed check to see if it is a team assignment
@contributors ||= teams # ACS
end
- Read upRead up
- Exclude checks
This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for complete is too high. [77.19/15] Open
def complete(count, answer = nil, questionnaire_min, questionnaire_max)
html = '<div><label for="responses_' + count.to_s + '">' + self.txt + '</label></div>'
html += '<input id="responses_' + count.to_s + '_score" name="responses[' + count.to_s + '][score]" type="hidden"'
html += 'value="' + answer.answer.to_s + '"' unless answer.nil?
html += '>'
- 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 all_students_all_reviews is too high. [77.85/15] Open
def all_students_all_reviews
course = Course.find(params[:course_id])
@assignments = course.assignments.reject(&:is_calibrated).reject {|a| a.participants.empty? }
@course_participants = course.get_participants
if @course_participants.empty?
- 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. [76.49/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
Block has too many lines. [125/25] Open
describe Participant do
let(:team) { build(:assignment_team, id: 1, name: 'myTeam') }
let(:user) { build(:student, id: 4, name: 'no name', fullname: 'no two') }
let(:team_user) { build(:team_user, id: 1, user: user, team: team) }
let(:topic) { build(:topic) }
- 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.
Module has too many lines. [105/100] Open
module GradesHelper
# Render the title
def get_accordion_title(last_topic, new_topic)
if last_topic.eql? nil
# this is the first accordion
- Read upRead up
- Exclude checks
This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
File review_mapping_controller_spec.rb
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rails_helper'
describe ReviewMappingController do
let(:assignment) { double('Assignment', id: 1) }
let(:review_response_map) do
double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,
Module has too many lines. [104/100] Open
module PenaltyHelper
def calculate_penalty(participant_id)
@submission_deadline_type_id = 1
@review_deadline_type_id = 2
@meta_review_deadline_type_id = 5
- Read upRead up
- Exclude checks
This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Module has too many lines. [104/100] Open
module SubmittedContentHelper
def display_directory_tree(participant, files, display_to_reviewer_flag)
index = 0
participant = @participant if @participant # TODO: Verify why this is needed
assignment = participant.assignment # participant is @map.contributor
- Read upRead up
- Exclude checks
This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for edit is too high. [74.76/15] Open
def edit
quiz_question_choices = QuizQuestionChoice.where(question_id: self.id)
html = '<tr><td>'
html += '<textarea cols="100" name="question[' + self.id.to_s + '][txt]" '
- 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 automatic_review_mapping is too high. [74.65/15] Open
def automatic_review_mapping
assignment_id = params[:id].to_i
participants = AssignmentParticipant.where(parent_id: params[:id].to_i).to_a.select(&:can_review).shuffle!
teams = AssignmentTeam.where(parent_id: params[:id].to_i).to_a.shuffle!
max_team_size = Integer(params[:max_team_size]) # Assignment.find(assignment_id).max_team_size
- 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
Module has too many lines. [103/100] Open
module CourseAnalytic
#====== general statistics ======#
def num_participants
self.participants.count
end
- Read upRead up
- Exclude checks
This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for calculate_score is too high. [73.11/15] Open
def calculate_score(map, response)
questionnaire = Questionnaire.find(map.reviewed_object_id)
scores = []
valid = true
questions = Question.where(questionnaire_id: questionnaire.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
Out-of-bounds Write in zlib affects Nokogiri Open
nokogiri (1.8.5)
- Read upRead up
- Exclude checks
Advisory: CVE-2018-25032
Criticality: High
URL: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-v6gp-9mmm-c6p5
Solution: upgrade to >= 1.13.4
Improper Handling of Unexpected Data Type in Nokogiri Open
nokogiri (1.8.5)
- Read upRead up
- Exclude checks
Advisory: CVE-2022-29181
Criticality: High
URL: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-xh29-r2w5-wx8m
Solution: upgrade to >= 1.13.6
Cross-site Scripting in Sidekiq Open
sidekiq (5.1.3)
- Read upRead up
- Exclude checks
Advisory: CVE-2021-30151
Criticality: Medium
URL: https://github.com/advisories/GHSA-grh7-935j-hg6w
Solution: upgrade to ~> 5.2.0, >= 6.2.1
Regular Expression Denial of Service in Addressable templates Open
addressable (2.5.2)
- Read upRead up
- Exclude checks
Advisory: CVE-2021-32740
Criticality: High
URL: https://github.com/advisories/GHSA-jxhc-q857-3j6g
Solution: upgrade to >= 2.8.0
Update packaged dependency libxml2 from 2.9.10 to 2.9.12 Open
nokogiri (1.8.5)
- Read upRead up
- Exclude checks
Advisory:
Criticality: High
URL: https://github.com/sparklemotion/nokogiri/security/advisories/GHSA-7rrm-v45f-jp64
Solution: upgrade to >= 1.11.4