VIAplanner/via-timetable

View on GitHub

Showing 102 of 200 total issues

Avoid deeply nested control flow statements.
Open

              if (fallPracticalCombo.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

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

      Avoid deeply nested control flow statements.
      Open

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

        Function removeCourse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            removeCourse(state, payload) {
              if (payload.code.slice(0, 4) === 'Lock') {
                if (payload.code[4] === 'F') {
                  Vue.delete(state.fallSelectedCourses, payload.code);
                } else {
        Severity: Minor
        Found in src/store/index.js - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function addSectionToTimetable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

        const addSectionToTimetable = (sections, timetable) => {
          for (const section of sections) {
            for (const time of section.times) {
              if (section.sectionCode.length === 3) {
                const timetableSection = {
        Severity: Minor
        Found in src/timetable-planner/index.js - About 35 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Avoid too many return statements within this function.
        Open

                      return true;
        Severity: Major
        Found in src/timetable-planner/index.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                        return true;
          Severity: Major
          Found in src/timetable-planner/index.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                      return true;
            Severity: Major
            Found in src/timetable-planner/index.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return true;
              Severity: Major
              Found in src/timetable-planner/index.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return true;
                Severity: Major
                Found in src/timetable-planner/index.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                    return true;
                  Severity: Major
                  Found in src/timetable-planner/index.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                              return true;
                    Severity: Major
                    Found in src/timetable-planner/index.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                return true;
                      Severity: Major
                      Found in src/timetable-planner/index.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                      return true;
                        Severity: Major
                        Found in src/timetable-planner/index.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                        return true;
                          Severity: Major
                          Found in src/timetable-planner/index.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                                    return true;
                            Severity: Major
                            Found in src/timetable-planner/index.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                            return true;
                              Severity: Major
                              Found in src/timetable-planner/index.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                          return true;
                                Severity: Major
                                Found in src/timetable-planner/index.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                            return true;
                                  Severity: Major
                                  Found in src/timetable-planner/index.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                  return true;
                                    Severity: Major
                                    Found in src/timetable-planner/index.js - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language