VIAplanner/via-timetable

View on GitHub

Showing 102 of 200 total issues

Function switchSection has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    switchSection(context, payload) {
      // Remove old section from locked sections
      context.commit(
        'unlockSection',
        `${payload.old.courseCode}${payload.old.sectionCode}`,
Severity: Minor
Found in src/store/index.js - About 1 hr to fix

    Function getUniqueCourses has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const getUniqueCourses = (fallCourses, winterCourses) => {
      const uniqueCourses = {};
      const locks = [];
      const [LOCK_STRING, LOCK_TERM_INDEX, COURSE_TERM_INDEX, LEC, PRA, TUT] = [
        'Lock',
    Severity: Minor
    Found in src/timetable-planner/index2.js - About 1 hr to fix

      Function lockSectionOfCourse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const lockSectionOfCourse = (courseSections, lockSections) => {
        for (const course of courseSections) {
          for (const section of lockSections) {
            // const lockedSection = section.slice()
            if (course.code === section.slice(0, section.length - 5)) {
      Severity: Minor
      Found in src/timetable-planner/index2.js - About 1 hr to fix

        Function lockSectionOfCourse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const lockSectionOfCourse = (courseSections, lockSections) => {
          for (const course of courseSections) {
            for (const section of lockSections) {
              if (course.code === section.slice(0, section.length - 5)) {
                if (section[section.length - 5] === 'L') {
        Severity: Minor
        Found in src/timetable-planner/index.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

                if (
                  (timetable[day][section].start >= timetable[day][section2].start &&
                    timetable[day][section].start < timetable[day][section2].end) ||
                  (timetable[day][section].end > timetable[day][section2].start &&
                    timetable[day][section].end <= timetable[day][section2].end) ||
          Severity: Critical
          Found in src/timetable-planner/index.js - About 1 hr to fix

            Function lockSection has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                lockSection(state, payload) {
                  let index;
                  if (payload.slice(0, 4) === 'Lock') {
                    if (payload[4] === 'F') {
                      index = state.fallLockedSections.indexOf(payload);
            Severity: Minor
            Found in src/store/index.js - About 1 hr to fix

              Function unlockSection has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  unlockSection(state, payload) {
                    let index;
                    if (payload.slice(0, 4) === 'Lock') {
                      // Block hour
                      if (payload[4] === 'F') {
              Severity: Minor
              Found in src/store/index.js - About 1 hr to fix

                Function selectCourse has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    selectCourse(context, payload) {
                      // save the previous timetable by default
                      if (!payload.noSave) {
                        context.dispatch('saveTimetable');
                      }
                Severity: Minor
                Found in src/store/index.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (fallLectureCombo.founded === 1) {
                                        return true;
                                      }
                  Severity: Major
                  Found in src/timetable-planner/index.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if (overlapExists(fallTimetable)) {
                                          fallTimetable = createShallowCopyOfTimetable(
                                            prevTimetable,
                                          );
                                          let j = -1;
                    Severity: Major
                    Found in src/timetable-planner/index.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (winterPracticalCombo.founded === 1) {
                                            return true;
                                          }
                      Severity: Major
                      Found in src/timetable-planner/index.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if (overlapExists(fallTimetable)) {
                                              fallTimetable = createShallowCopyOfTimetable(
                                                prevTimetabletut,
                                              );
                                              let j = -1;
                        Severity: Major
                        Found in src/timetable-planner/index.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          if (tut2 !== -1) {
                                            return courseSection[whichArray2].tutorial.some(
                                              arrayElement2 => {
                                                // Recursive case...
                                                if (fallLectureCombo.founded === 1) {
                          Severity: Major
                          Found in src/timetable-planner/index.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                    if (index === -1) {
                                      state.fallLockedSections.push(payload);
                                      state.winterLockedSections.push(payload);
                                    }
                            Severity: Major
                            Found in src/store/index.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (fallLectureCombo.founded === 1) {
                                                    return true;
                                                  }
                              Severity: Major
                              Found in src/timetable-planner/index.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if (overlapExists(winterTimetable)) {
                                                      winterTimetable = createShallowCopyOfTimetable(
                                                        prevTimetable,
                                                      );
                                                      let j = -1;
                                Severity: Major
                                Found in src/timetable-planner/index.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                if (dayEvents[i].code === payload.code) {
                                                  dayEvents.splice(i, 1);
                                                  break;
                                                }
                                  Severity: Major
                                  Found in src/store/index.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                              for (const lecture of course.lecture) {
                                                if (lecture.sectionCode === section.slice(section.length - 5)) {
                                                  course.lecture = [lecture];
                                                }
                                              }
                                    Severity: Major
                                    Found in src/timetable-planner/index.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if (winterLectureCombo.founded === 1) {
                                                            return true;
                                                          }
                                      Severity: Major
                                      Found in src/timetable-planner/index.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                        if (tut2 !== -1) {
                                                          return courseSection[whichArray2].tutorial.some(
                                                            arrayElement2 => {
                                                              // Recursive case...
                                                              if (fallLectureCombo.founded === 1) {
                                        Severity: Major
                                        Found in src/timetable-planner/index.js - About 45 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language