codeRIT/hackathon_manager

View on GitHub

Showing 147 of 151 total issues

Avoid too many return statements within this method.
Open

return value.join(", ") if value.is_a? Array
Severity: Major
Found in app/helpers/audit_helper.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

    return display_datetime(value, relative: false) if value.is_a? Time
    Severity: Major
    Found in app/helpers/audit_helper.rb - About 30 mins to fix

      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,
      Severity: Minor
      Found in app/datatables/attendee_sponsor_info_datatable.rb and 2 other locations - About 25 mins to fix
      app/datatables/applied_datatable.rb on lines 18..28
      app/datatables/checked_in_datatable.rb on lines 18..28

      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,
      Severity: Minor
      Found in app/datatables/checked_in_datatable.rb and 2 other locations - About 25 mins to fix
      app/datatables/applied_datatable.rb on lines 18..28
      app/datatables/attendee_sponsor_info_datatable.rb on lines 18..28

      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,
      Severity: Minor
      Found in app/datatables/applied_datatable.rb and 2 other locations - About 25 mins to fix
      app/datatables/attendee_sponsor_info_datatable.rb on lines 18..28
      app/datatables/checked_in_datatable.rb on lines 18..28

      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 ||= {}
      Severity: Minor
      Found in app/helpers/hackathon_manager_helper.rb - About 25 mins to fix

      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"
      Severity: Minor
      Found in app/helpers/audit_helper.rb - About 25 mins to fix

      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"

      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
      Severity: Minor
      Found in app/models/questionnaire.rb and 1 other location - About 20 mins to fix
      app/models/questionnaire.rb on lines 330..334

      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
      Severity: Minor
      Found in app/models/questionnaire.rb and 1 other location - About 20 mins to fix
      app/models/questionnaire.rb on lines 336..340

      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",
      Severity: Minor
      Found in app/models/message.rb and 1 other location - About 20 mins to fix
      app/models/message.rb on lines 32..44

      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",
      Severity: Minor
      Found in app/models/message.rb and 1 other location - About 20 mins to fix
      app/models/message.rb on lines 17..29

      Use tr instead of gsub.
      Open

      time = created_at.strftime("%r").gsub(":", "-")
      Severity: Minor
      Found in app/models/data_export.rb by rubocop

      Add empty line after guard clause.
      Open

      return if reminder_sent_at
      Severity: Minor
      Found in app/models/user.rb by rubocop

      Add empty line after guard clause.
      Open

      end

      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

      Rule doesn't have all its properties in alphabetical order.
      Open

      .sidebar .nav-link {

      Align the elements of a hash literal if they span more than one line.
      Open

      "waitlist" => "Waitlisted",
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Add empty line after guard clause.
      Open

      return if school.blank?
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop

      Add empty line after guard clause.
      Open

      return unless saved_change_to_checked_in_at && checked_in?
      Severity: Minor
      Found in app/models/questionnaire.rb by rubocop
      Severity
      Category
      Status
      Source
      Language