VIAplanner/via-timetable

View on GitHub

Showing 102 of 200 total issues

Function createTimetable has 1230 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const createTimetable = (fallCourseSection, winterCourseSection, state) => {
  let fallTimetable = {
    MONDAY: [],
    TUESDAY: [],
    WEDNESDAY: [],
Severity: Major
Found in src/timetable-planner/index.js - About 6 days to fix

    File index.js has 1445 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const sortCourseSection = require('./combinations/combinations');
    
    /**
     * Search for the first index of course that has type section
     * @param {*} courseSection
    Severity: Major
    Found in src/timetable-planner/index.js - About 3 days to fix

      File combinations.spec.js has 959 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import test from 'ava';
      import {
        courseMeetingSectionCombinations,
        courseCombinations,
      } from './combinations';
      Severity: Major
      Found in src/timetable-planner/combinations/combinations.spec.js - About 2 days to fix

        Function fallLectureCombo has 426 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const fallLectureCombo = (courseSection, whichArray, output = []) => {
            fallLectureCombo.founded = 0;
            const lec2 = searchForSectionIndexAfterprevIndex(
              courseSection,
              'lecture',
        Severity: Major
        Found in src/timetable-planner/index.js - About 2 days to fix

          File index.js has 813 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import Vue from 'vue';
          import Vuex from 'vuex';
          import genColor from 'color-generator';
          import { generateTimetables } from '../timetable-planner/index2';
          // import colorDiff from "color-difference"
          Severity: Major
          Found in src/store/index.js - About 1 day to fix

            Function winterLectureCombo has 277 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const winterLectureCombo = (courseSection, whichArray, output = []) => {
                winterLectureCombo.founded = 0;
                const lec2 = searchForSectionIndexAfterprevIndex(
                  courseSection,
                  'lecture',
            Severity: Major
            Found in src/timetable-planner/index.js - About 1 day to fix

              Function lockSectionOfCourse has a Cognitive Complexity of 67 (exceeds 5 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 day 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 lockSectionOfCourse has a Cognitive Complexity of 67 (exceeds 5 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 day 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 deleteCourse has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
              Open

                  deleteCourse(context, payload) {
                    // resets search bar value if the deleted course is the last searched course
                    if (
                      context.state.searchBarValue !== null &&
                      context.state.searchBarValue.includes(payload.code)
              Severity: Minor
              Found in src/store/index.js - About 1 day 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 practicalCombo has 206 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          const practicalCombo = (
                            // eslint-disable-next-line no-shadow
                            courseSection,
                            whichArray2 = pra,
                            output2 = [],
              Severity: Major
              Found in src/timetable-planner/index.js - About 1 day to fix

                Function fallPracticalCombo has 202 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const fallPracticalCombo = (courseSection, whichArray2, output2 = []) => {
                    fallPracticalCombo.founded = 0;
                    const pra2 = searchForSectionIndexAfterprevIndex(
                      courseSection,
                      'practical',
                Severity: Major
                Found in src/timetable-planner/index.js - About 1 day to fix

                  File timetable.spec.js has 398 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import test from 'ava';
                  import { generateTimetables, createTimetable } from './index';
                  
                  const ONE_COURSE_L1_P2 = [
                    {
                  Severity: Minor
                  Found in src/timetable-planner/timetable.spec.js - About 5 hrs to fix

                    Function winterPracticalCombo has 130 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const winterPracticalCombo = (courseSection, whichArray2, output2 = []) => {
                        winterPracticalCombo.founded = 0;
                        const pra2 = searchForSectionIndexAfterprevIndex(
                          courseSection,
                          'practical',
                    Severity: Major
                    Found in src/timetable-planner/index.js - About 5 hrs to fix

                      Function practicalCombo has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  const practicalCombo = (
                                    // eslint-disable-next-line no-shadow
                                    courseSection,
                                    whichArray2 = pra,
                                    output2 = [],
                      Severity: Major
                      Found in src/timetable-planner/index.js - About 5 hrs to fix

                        Function createTimetable has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const createTimetable = (fallCourseSection, winterCourseSection, state) => {
                          let fallTimetable = {
                            MONDAY: [],
                            TUESDAY: [],
                            WEDNESDAY: [],
                        Severity: Minor
                        Found in src/timetable-planner/index.js - About 5 hrs 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

                        `` has 31 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                          getters: {
                            getSerializedState: state => state.history[state.history.length - 1 + state.historyIndex],
                            getExportOverlay: state => state.exportOverlay,
                            getNoTimetablePopup: state => state.noTimetablePopup,
                            getShareLinkPopup: state => state.shareLinkPopup,
                        Severity: Minor
                        Found in src/store/index.js - About 3 hrs to fix

                          Function tutorialCombo has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                                  const tutorialCombo = (
                                                    // eslint-disable-next-line no-shadow
                                                    courseSection,
                                                    // eslint-disable-next-line no-shadow
                                                    whichArray2 = tut,
                          Severity: Major
                          Found in src/timetable-planner/index.js - About 3 hrs to fix

                            Function tutorialCombo has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                          const tutorialCombo = (
                                            // eslint-disable-next-line no-shadow
                                            courseSection,
                                            whichArray2 = tut,
                                            output2 = [],
                            Severity: Major
                            Found in src/timetable-planner/index.js - About 3 hrs to fix

                              Function tutorialCombo has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                          const tutorialCombo = (
                                            // eslint-disable-next-line no-shadow
                                            courseSection,
                                            // eslint-disable-next-line no-shadow
                                            whichArray2 = tut,
                              Severity: Major
                              Found in src/timetable-planner/index.js - About 3 hrs to fix

                                Function generateTimetables has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const generateTimetables = (
                                  fallCourses,
                                  fallLockSections,
                                  winterCourses,
                                  winterLockSections,
                                Severity: Major
                                Found in src/timetable-planner/index2.js - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language