Showing 10 of 10 total issues
Class Event
has 40 methods (exceeds 20 allowed). Consider refactoring. Open
class Event < ActiveRecord::Base UNREASONABLY_LONG_DATE_SPAN = 300 TRUNCATE_DESCRIPTION_TEXT_LENGTH = 250 serialize :custom_application_fields, Array
Method compare_participants_by_agreement
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def compare_participants_by_agreement(participant1, participant2) unless participant1.requires_agreement_letter_for_event?(self) unless participant2.requires_agreement_letter_for_event?(self) return participant1.email <=> participant2.email end
- Read upRead up
Avoid too many return
statements within this method. Open
return 1
Avoid too many return
statements within this method. Open
return -1 if participant2.agreement_letter_for_event?(self)
Method phase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def phase return :draft unless published return :application if published && !after_deadline? return :selection if published && after_deadline? && !(acceptances_have_been_sent && rejections_have_been_sent) return :execution if published && after_deadline? && acceptances_have_been_sent && rejections_have_been_sent
- Read upRead up
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if participant_group.nil?
- Read upRead up
- Exclude checks
Avoid comparing a variable with multiple items in a conditional, use Array#include?
instead. Open
order_by = 'asc' unless order_by == 'asc' || order_by == 'desc'
- Read upRead up
- Exclude checks
Favor modifier unless
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
unless participant2.requires_agreement_letter_for_event?(self)
- Read upRead up
- Exclude checks
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if custom_image.filename.present? && errors[:custom_image].empty?
- Read upRead up
- Exclude checks
Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
. Open
if participant2.agreement_letter_for_event?(self)
- Read upRead up
- Exclude checks