Showing 147 of 151 total issues
Avoid too many return
statements within this method. Open
return value.join(", ") if value.is_a? Array
Avoid too many return
statements within this method. Open
return display_datetime(value, relative: false) if value.is_a? Time
Similar blocks of code found in 3 locations. Consider refactoring. Open
def data records.map do |record| { id: record.id, first_name: record.user.first_name,
- Read upRead up
Similar blocks of code found in 3 locations. Consider refactoring. Open
def data records.map do |record| { id: record.id, first_name: record.user.first_name,
- Read upRead up
Similar blocks of code found in 3 locations. Consider refactoring. Open
def data records.map do |record| { id: record.id, first_name: record.user.first_name,
- Read upRead up
Method active_link_to
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def active_link_to(name = nil, options = nil, html_options = nil, &block) # this is from Rails source - ignore rubocop # rubocop:disable Style/ParallelAssignment html_options, options, name = options, name, block if block_given? options ||= {}
- Read upRead up
Method display_audit_value
has a Cognitive Complexity of 8 (exceeds 7 allowed). Consider refactoring. Open
def display_audit_value(value, field) return "(none)" if value.blank? return Questionnaire::POSSIBLE_ACC_STATUS[value] if field == "acc_status" return BusList.find(value)&.name || value if field == "bus_list_id" return User.find_by_id(value)&.full_name || "(deleted user)" if field == "checked_in_by_id"
- Read upRead up
Block has too many lines. [26/25] Open
format.html do redirect_to_checkins = params[:redirect_to_checkins] || false show_redirect_path = redirect_to_checkins ? manage_checkin_path(@questionnaire) : manage_questionnaire_path(@questionnaire) index_redirect_path = redirect_to_checkins ? manage_checkins_path : manage_questionnaires_path if params[:check_in] == "true"
- Read upRead up
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
def vcs_url=(value) value = value.downcase unless value.blank? value = "https://" + value if !value.blank? && !value.include?("http://") && !value.include?("https://") super value end
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
def portfolio_url=(value) value = value.downcase unless value.blank? value = "http://" + value if !value.blank? && !value.include?("http://") && !value.include?("https://") super value end
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
POSSIBLE_SIMPLE_RECIPIENTS = { "all" => "Everyone", "incomplete" => "Incomplete Applications", "complete" => "Complete Applications", "accepted" => "Accepted Applications",
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
POSSIBLE_TRIGGERS = { "questionnaire.pending" => "Questionnaire Status: Pending Review (new application)", "questionnaire.accepted" => "Questionnaire Status: Accepted", "questionnaire.waitlist" => "Questionnaire Status: Waitlisted", "questionnaire.denied" => "Questionnaire Status: Denied",
- Read upRead up
Use tr
instead of gsub
. Open
time = created_at.strftime("%r").gsub(":", "-")
- Read upRead up
- Exclude checks
Use School.where("questionnaire_count >= 5").count.positive?
instead of School.where("questionnaire_count >= 5").count > 0
. Open
if School.where("questionnaire_count >= 5").count > 0
- Read upRead up
- Exclude checks
Rule doesn't have all its properties in alphabetical order. Open
.sidebar .nav-link {
- Exclude checks
Align the elements of a hash literal if they span more than one line. Open
"waitlist" => "Waitlisted",
- Read upRead up
- Exclude checks
Add empty line after guard clause. Open
return unless saved_change_to_checked_in_at && checked_in?
- Read upRead up
- Exclude checks