codeRIT/hackathon_manager

View on GitHub

Showing 147 of 151 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

const Admissions = () => (
<Block>
{[
{
content:
Severity: Major
Found in website/pages/en/index.js and 2 other locations - About 1 hr to fix
website/pages/en/index.js on lines 173..185
website/pages/en/index.js on lines 201..213

Similar blocks of code found in 3 locations. Consider refactoring.
Open

const MyMLHSupport = () => (
<Block>
{[
{
content:
Severity: Major
Found in website/pages/en/index.js and 2 other locations - About 1 hr to fix
website/pages/en/index.js on lines 145..157
website/pages/en/index.js on lines 201..213

Method display_datetime has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring.
Open

def display_datetime(datetime, opts = {})
if datetime.blank?
return ""
end
opts[:relative] = true if opts[:relative].nil?
Severity: Minor
Found in app/helpers/hackathon_manager_helper.rb - About 1 hr to fix

Method data has a Cognitive Complexity of 12 (exceeds 7 allowed). Consider refactoring.
Open

def data
records.map do |record|
{
id: record.id,
link: link_to('<i class="fa fa-search"></i>'.html_safe, manage_user_path(record)),
Severity: Minor
Found in app/datatables/user_datatable.rb - About 1 hr to fix

Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

render() {
const {config: siteConfig} = this.props;
if ((siteConfig.users || []).length === 0) {
return null;
}
Severity: Minor
Found in website/pages/en/users.js - About 1 hr to fix

    Method schools_applied_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def schools_applied_data
    counted_schools = {
    "pending" => {},
    "denied" => {},
    "rsvp_denied" => {},
    Severity: Minor
    Found in app/controllers/manage/dashboard_controller.rb - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

      return true unless info["phone_number"].blank? || info["level_of_study"].blank? || info["major"].blank? ||
      info["date_of_birth"].blank? || info["gender"].blank? || info["school"].blank? ||
      info["school"]["name"].blank?
      Severity: Major
      Found in app/controllers/questionnaires_controller.rb - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        case 'email':
        if (value) {
        var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
        if (!re.test(value)) {
        notify(this, 'Invalid Email');
        Severity: Minor
        Found in app/assets/javascripts/validate.js and 1 other location - About 50 mins to fix
        app/assets/javascripts/validate.js on lines 38..46

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        case 'phone':
        if (value) {
        var phoneReg = /^[\+]?[0-9]{0,3}[-\s\.]?[(]?[0-9]{1,3}[)]?[-\s\.]?[0-9]{1,3}[-\s\.]?[0-9]{4,6}$/;
        if (!phoneReg.test(value)) {
        notify(this, 'Please enter a valid phone number');
        Severity: Minor
        Found in app/assets/javascripts/validate.js and 1 other location - About 50 mins to fix
        app/assets/javascripts/validate.js on lines 29..37

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        def bs_vertical_simple_form(path, options = {}, &block)
        bootstrap_options = {
        wrapper: :bootstrap_vertical_form,
        wrapper_mappings: {
        boolean: :bootstrap_vertical_boolean,
        Severity: Minor
        Found in app/helpers/manage/bootstrap_form_helper.rb and 1 other location - About 40 mins to fix
        app/helpers/manage/bootstrap_form_helper.rb on lines 23..39

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        def bs_horizontal_simple_form_for(path, options = {}, &block)
        bootstrap_options = {
        wrapper: :bootstrap_horizontal_form,
        wrapper_mappings: {
        boolean: :bootstrap_horizontal_boolean,
        Severity: Minor
        Found in app/helpers/manage/bootstrap_form_helper.rb and 1 other location - About 40 mins to fix
        app/helpers/manage/bootstrap_form_helper.rb on lines 3..19

        Method new has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring.
        Open

        def new
        if current_user.questionnaire.present?
        return redirect_to questionnaires_path
        end
        @questionnaire = Questionnaire.new
        Severity: Minor
        Found in app/controllers/questionnaires_controller.rb - About 35 mins to fix

        Method bus_captain has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring.
        Open

        def bus_captain(record)
        return "No" unless record.bus_list_id?
        return record.is_bus_captain? ? '<span class="badge badge-success">Yes</span>' : "No" unless current_user.director?
         
        if record.is_bus_captain?
        Severity: Minor
        Found in app/datatables/questionnaire_datatable.rb - About 35 mins to fix

        Method create has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring.
        Open

        def create
        create_params = questionnaire_params
        email = create_params.delete(:email)
        create_params = convert_school_name_to_id(create_params)
        create_params = convert_boarded_bus_param(create_params)
        Severity: Minor
        Found in app/controllers/manage/questionnaires_controller.rb - About 35 mins to fix

        Method data has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring.
        Open

        def data
        records.map do |record|
        {
        id: record.id,
        name: link_to(bold(record.name), manage_message_path(record)),
        Severity: Minor
        Found in app/datatables/bulk_message_datatable.rb - About 35 mins to fix

        Method data has a Cognitive Complexity of 9 (exceeds 7 allowed). Consider refactoring.
        Open

        def data
        records.map do |record|
        {
        id: record.id,
        link: link_to('<i class="fa fa-search"></i>'.html_safe, manage_user_path(record)),
        Severity: Minor
        Found in app/datatables/staff_datatable.rb - About 35 mins to fix

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        def view_columns
        @view_columns ||= {
        id: { source: "Questionnaire.id" },
        first_name: { source: "User.first_name" },
        last_name: { source: "User.last_name" },
        Severity: Major
        Found in app/datatables/attendee_sponsor_info_datatable.rb and 3 other locations - About 35 mins to fix
        app/datatables/alt_travel_datatable.rb on lines 4..14
        app/datatables/applied_datatable.rb on lines 4..14
        app/datatables/checked_in_datatable.rb on lines 4..14

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        def view_columns
        @view_columns ||= {
        id: { source: "Questionnaire.id" },
        first_name: { source: "User.first_name" },
        last_name: { source: "User.last_name" },
        Severity: Major
        Found in app/datatables/checked_in_datatable.rb and 3 other locations - About 35 mins to fix
        app/datatables/alt_travel_datatable.rb on lines 4..14
        app/datatables/applied_datatable.rb on lines 4..14
        app/datatables/attendee_sponsor_info_datatable.rb on lines 4..14

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        def view_columns
        @view_columns ||= {
        id: { source: "Questionnaire.id" },
        first_name: { source: "User.first_name" },
        last_name: { source: "User.last_name" },
        Severity: Major
        Found in app/datatables/applied_datatable.rb and 3 other locations - About 35 mins to fix
        app/datatables/alt_travel_datatable.rb on lines 4..14
        app/datatables/attendee_sponsor_info_datatable.rb on lines 4..14
        app/datatables/checked_in_datatable.rb on lines 4..14

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

        def view_columns
        @view_columns ||= {
        id: { source: "Questionnaire.id" },
        first_name: { source: "User.first_name" },
        last_name: { source: "User.last_name" },
        Severity: Major
        Found in app/datatables/alt_travel_datatable.rb and 3 other locations - About 35 mins to fix
        app/datatables/applied_datatable.rb on lines 4..14
        app/datatables/attendee_sponsor_info_datatable.rb on lines 4..14
        app/datatables/checked_in_datatable.rb on lines 4..14
        Severity
        Category
        Status
        Source
        Language