ahbeng/NUSMods

View on GitHub
website/src/reducers/timetables.ts

Summary

Maintainability
A
3 hrs
Test Coverage

Function timetables has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function timetables(
  state: TimetablesState = defaultTimetableState,
  action: Actions,
): TimetablesState {
  // All normal timetable actions should specify their semester
Severity: Major
Found in website/src/reducers/timetables.ts - About 2 hrs to fix

    Avoid too many return statements within this function.
    Open

          return produce(state, (draft) => {
            draft.hidden[semester] = hiddenModules;
          });
    Severity: Major
    Found in website/src/reducers/timetables.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return {
              ...state,
              lessons: { [semester]: timetable },
              colors: { [semester]: colors },
              hidden: { [semester]: hidden },
      Severity: Major
      Found in website/src/reducers/timetables.ts - About 30 mins to fix

        There are no issues that match your filters.

        Category
        Status