VIAplanner/via-timetable

View on GitHub

Showing 200 of 200 total issues

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 (overlapExists(winterTimetable)) {
                          winterTimetable = 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 (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 (
                        JSON.stringify(winterTimetable) ===
                          JSON.stringify({
                            MONDAY: [],
                            TUESDAY: [],
        Severity: Major
        Found in src/timetable-planner/index.js - About 45 mins to fix

          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

                                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

                            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

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

                          if (context.state.semesterStatus === 'F') {
                            context.state.fallLockedHourStatus =
                              context.state.savedLockedHourStatus;
                            context.state.fallLockedDayStatus = context.state.savedLockedDayStatus;
                          } else {
                    Severity: Minor
                    Found in src/store/index.js and 1 other location - About 40 mins to fix
                    src/store/index.js on lines 553..558

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

                    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 {
                            context.state.winterLockedHourStatus =
                              context.state.savedLockedHourStatus;
                            context.state.winterLockedDayStatus =
                              context.state.savedLockedDayStatus;
                    Severity: Minor
                    Found in src/store/index.js and 1 other location - About 40 mins to fix
                    src/store/index.js on lines 549..553

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

                    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

                          const timetables = generateTimetables(
                            fallCourses,
                            context.state.fallLockedSections,
                            winterCourses,
                            context.state.winterLockedSections,
                    Severity: Minor
                    Found in src/store/index.js and 1 other location - About 40 mins to fix
                    src/store/index.js on lines 713..720

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

                    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

                          const bothTimetables = generateTimetables(
                            fallCourses,
                            context.state.fallLockedSections,
                            winterCourses,
                            context.state.winterLockedSections,
                    Severity: Minor
                    Found in src/store/index.js and 1 other location - About 40 mins to fix
                    src/store/index.js on lines 612..619

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

                    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

                          const fallCourses = Object.keys(context.state.fallSelectedCourses).map(
                            code => context.state.fallSelectedCourses[code],
                          );
                    Severity: Major
                    Found in src/store/index.js and 3 other locations - About 35 mins to fix
                    src/store/index.js on lines 605..607
                    src/store/index.js on lines 608..610
                    src/store/index.js on lines 709..711

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

                    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

                      Object.keys(unassigned).forEach((key) => { partial[key] = unassigned[key].slice();})
                    Severity: Minor
                    Found in src/timetable-planner/csp/index.js and 1 other location - About 35 mins to fix
                    src/timetable-planner/csp/index.js on lines 11..11

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

                    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

                          const winterCourses = Object.keys(
                            context.state.winterSelectedCourses,
                          ).map(code => context.state.winterSelectedCourses[code]);
                    Severity: Major
                    Found in src/store/index.js and 3 other locations - About 35 mins to fix
                    src/store/index.js on lines 605..607
                    src/store/index.js on lines 608..610
                    src/store/index.js on lines 706..708

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

                    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

                          const winterCourses = Object.keys(
                            context.state.winterSelectedCourses,
                          ).map(code => context.state.winterSelectedCourses[code]);
                    Severity: Major
                    Found in src/store/index.js and 3 other locations - About 35 mins to fix
                    src/store/index.js on lines 605..607
                    src/store/index.js on lines 706..708
                    src/store/index.js on lines 709..711

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

                    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

                      Object.keys(assigned).forEach((key) => { partial[key] = assigned[key].slice(); })
                    Severity: Minor
                    Found in src/timetable-planner/csp/index.js and 1 other location - About 35 mins to fix
                    src/timetable-planner/csp/index.js on lines 10..10

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

                    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

                          const fallCourses = Object.keys(context.state.fallSelectedCourses).map(
                            code => context.state.fallSelectedCourses[code],
                          );
                    Severity: Major
                    Found in src/store/index.js and 3 other locations - About 35 mins to fix
                    src/store/index.js on lines 608..610
                    src/store/index.js on lines 706..708
                    src/store/index.js on lines 709..711

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

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

                    Severity
                    Category
                    Status
                    Source
                    Language