VIAplanner/via-timetable

View on GitHub

Showing 200 of 200 total issues

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

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

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

        fallLockedHourStatus: !localStorage.fallLockedHourStatus
          ? {
              '8 AM': false,
              '9 AM': false,
              '10 AM': false,
    Severity: Major
    Found in src/store/index.js and 1 other location - About 3 hrs to fix
    src/store/index.js on lines 90..107

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 100.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        winterLockedHourStatus: !localStorage.winterLockedHourStatus
          ? {
              '8 AM': false,
              '9 AM': false,
              '10 AM': false,
    Severity: Major
    Found in src/store/index.js and 1 other location - About 3 hrs to fix
    src/store/index.js on lines 48..65

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 100.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      if (fallCourseSection.length > 0 && state === 'F') {
        const lec = searchForSectionIndex(fallCourseSection, 'lecture');
        const pra = searchForSectionIndex(fallCourseSection, 'practical');
        const tut = searchForSectionIndex(fallCourseSection, 'tutorial');
        if (lec >= 0) {
    Severity: Major
    Found in src/timetable-planner/index.js and 1 other location - About 3 hrs to fix
    src/timetable-planner/index.js on lines 1558..1569

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 99.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      if (winterCourseSection.length > 0 && state === 'W') {
        const lec = searchForSectionIndex(winterCourseSection, 'lecture');
        const pra = searchForSectionIndex(winterCourseSection, 'practical');
        const tut = searchForSectionIndex(winterCourseSection, 'tutorial');
        if (lec >= 0) {
    Severity: Major
    Found in src/timetable-planner/index.js and 1 other location - About 3 hrs to fix
    src/timetable-planner/index.js on lines 1540..1557

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 99.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      mutations: {
        setDarkMode(state, payload) {
          state.darkMode = payload;
          regenerateColors(state);
          saveState(state);
    Severity: Minor
    Found in src/store/index.js - About 3 hrs to fix

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

        {
          courseCode: 'ANT102H5Y',
          meeting_sections: [
            {
              sectionCode: 'L0101',
      Severity: Major
      Found in src/timetable-planner/testYear.js and 1 other location - About 3 hrs to fix
      src/timetable-planner/testYear.js on lines 24..52

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

        {
          courseCode: 'ANT102H5Y',
          meeting_sections: [
            {
              sectionCode: 'L0101',
      Severity: Major
      Found in src/timetable-planner/testYear.js and 1 other location - About 3 hrs to fix
      src/timetable-planner/testYear.js on lines 55..83

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 97.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

            if (section.sectionCode.length === 3) {
              const timetableSection = {
                code: section.comboCode.substring(0, section.comboCode.length - 3),
                sectionCode: section.sectionCode,
                instructors: section.instructors,
      Severity: Major
      Found in src/timetable-planner/index.js and 1 other location - About 2 hrs to fix
      src/timetable-planner/index.js on lines 56..65

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 90.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function sortCourseSections has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      const sortCourseSections = (course, online) => {
        if (online === 'InPerson') {
          course.lecture.sort((a, b) => (a.sectionCode > b.sectionCode ? 1 : -1));
          course.practical.sort((a, b) => (a.sectionCode > b.sectionCode ? 1 : -1));
          course.tutorial.sort((a, b) => (a.sectionCode > b.sectionCode ? 1 : -1));
      Severity: Minor
      Found in src/timetable-planner/index.js - About 2 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

      Function sortCourseSections has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      const sortCourseSections = (course, online) => {
        if (online === 'InPerson') {
          course.lecture.sort((a, b) => (a.sectionCode > b.sectionCode ? 1 : -1));
          course.practical.sort((a, b) => (a.sectionCode > b.sectionCode ? 1 : -1));
          course.tutorial.sort((a, b) => (a.sectionCode > b.sectionCode ? 1 : -1));
      Severity: Minor
      Found in src/timetable-planner/index2.js - About 2 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

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

            } else {
              const timetableSection = {
                code: section.comboCode.substring(0, section.comboCode.length - 5),
                sectionCode: section.sectionCode,
                instructors: section.instructors,
      Severity: Major
      Found in src/timetable-planner/index.js and 1 other location - About 2 hrs to fix
      src/timetable-planner/index.js on lines 47..56

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 90.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function deleteCourse has 65 lines of code (exceeds 25 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: Major
      Found in src/store/index.js - About 2 hrs to fix

        Function clearStorage has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            clearStorage(context) {
              context.state.fallLockedHourStatus = {
                '8 AM': false,
                '9 AM': false,
                '10 AM': false,
        Severity: Major
        Found in src/store/index.js - About 2 hrs to fix

          Function lockSection has a Cognitive Complexity of 19 (exceeds 5 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 2 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

          Function unlockSection has a Cognitive Complexity of 19 (exceeds 5 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 2 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

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

                context.state.fallLockedHourStatus = {
                  '8 AM': false,
                  '9 AM': false,
                  '10 AM': false,
                  '11 AM': false,
          Severity: Major
          Found in src/store/index.js and 1 other location - About 2 hrs to fix
          src/store/index.js on lines 460..475

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 86.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                context.state.winterLockedHourStatus = {
                  '8 AM': false,
                  '9 AM': false,
                  '10 AM': false,
                  '11 AM': false,
          Severity: Major
          Found in src/store/index.js and 1 other location - About 2 hrs to fix
          src/store/index.js on lines 428..443

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 86.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                        if (tutResult) {
                          winterLectureCombo.founded = 1;
                          // founds a valid timetable
                          return true;
                        } else {
          Severity: Major
          Found in src/timetable-planner/index.js and 3 other locations - About 2 hrs to fix
          src/timetable-planner/index.js on lines 531..546
          src/timetable-planner/index.js on lines 653..668
          src/timetable-planner/index.js on lines 1226..1241

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 85.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                      if (praResult) {
                        fallLectureCombo.founded = 1;
                        // founds a valid timetable
                        return true;
                      } else {
          Severity: Major
          Found in src/timetable-planner/index.js and 3 other locations - About 2 hrs to fix
          src/timetable-planner/index.js on lines 653..668
          src/timetable-planner/index.js on lines 1226..1241
          src/timetable-planner/index.js on lines 1310..1325

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 85.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language