VIAplanner/via-timetable

View on GitHub

Showing 200 of 200 total issues

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

    fallTimetable: !localStorage.fallTimetable
      ? {
          MONDAY: [],
          TUESDAY: [],
          WEDNESDAY: [],
Severity: Major
Found in src/store/index.js and 1 other location - About 1 hr to fix
src/store/index.js on lines 123..131

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 60.

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

    winterTimetable: !localStorage.winterTimetable
      ? {
          MONDAY: [],
          TUESDAY: [],
          WEDNESDAY: [],
Severity: Major
Found in src/store/index.js and 1 other location - About 1 hr to fix
src/store/index.js on lines 81..89

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 60.

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 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

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

            winterLockedDayStatus: !localStorage.winterLockedDayStatus
              ? {
                  Monday: false,
                  Tuesday: false,
                  Wednesday: false,
        Severity: Major
        Found in src/store/index.js and 1 other location - About 1 hr to fix
        src/store/index.js on lines 66..74

        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 55.

        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

            fallLockedDayStatus: !localStorage.fallLockedDayStatus
              ? {
                  Monday: false,
                  Tuesday: false,
                  Wednesday: false,
        Severity: Major
        Found in src/store/index.js and 1 other location - About 1 hr to fix
        src/store/index.js on lines 108..116

        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 55.

        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

              } else if (payload[8] === 'F') {
                // Fall
                index = state.fallLockedSections.indexOf(payload);
                if (index !== -1) {
                  state.fallLockedSections.splice(index, 1);
        Severity: Minor
        Found in src/store/index.js and 1 other location - About 55 mins to fix
        src/store/index.js on lines 373..387

        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 54.

        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

              } else if (payload[8] === 'S') {
                // Winter
                index = state.winterLockedSections.indexOf(payload);
                if (index !== -1) {
                  state.winterLockedSections.splice(index, 1);
        Severity: Minor
        Found in src/store/index.js and 1 other location - About 55 mins to fix
        src/store/index.js on lines 367..387

        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 54.

        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 3 locations. Consider refactoring.
        Open

              } else if (payload[8] === 'F') {
                index = state.fallLockedSections.indexOf(payload);
                if (index === -1) {
                  state.fallLockedSections.push(payload);
                }
        Severity: Major
        Found in src/store/index.js and 2 other locations - About 50 mins to fix
        src/store/index.js on lines 322..332
        src/store/index.js on lines 338..349

        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 51.

        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 3 locations. Consider refactoring.
        Open

              } else if (payload[8] === 'S') {
                index = state.winterLockedSections.indexOf(payload);
                if (index === -1) {
                  state.winterLockedSections.push(payload);
                }
        Severity: Major
        Found in src/store/index.js and 2 other locations - About 50 mins to fix
        src/store/index.js on lines 322..332
        src/store/index.js on lines 333..349

        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 51.

        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 (payload[4] === 'F') {
                  index = state.fallLockedSections.indexOf(payload);
                  if (index !== -1) {
                    state.fallLockedSections.splice(index, 1);
                  }
        Severity: Minor
        Found in src/store/index.js and 1 other location - About 50 mins to fix
        src/store/index.js on lines 361..366

        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 51.

        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

                } else {
                  index = state.winterLockedSections.indexOf(payload);
                  if (index !== -1) {
                    state.winterLockedSections.splice(index, 1);
                  }
        Severity: Minor
        Found in src/store/index.js and 1 other location - About 50 mins to fix
        src/store/index.js on lines 356..361

        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 51.

        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 3 locations. Consider refactoring.
        Open

                if (payload[4] === 'F') {
                  index = state.fallLockedSections.indexOf(payload);
                  if (index === -1) {
                    state.fallLockedSections.push(payload);
                  }
        Severity: Major
        Found in src/store/index.js and 2 other locations - About 50 mins to fix
        src/store/index.js on lines 333..349
        src/store/index.js on lines 338..349

        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 51.

        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

        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
                    Severity
                    Category
                    Status
                    Source
                    Language