website/src/reducers/timetables.ts
Function timetables
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function timetables(
state: TimetablesState = defaultTimetableState,
action: Actions,
): TimetablesState {
// All normal timetable actions should specify their semester
Avoid too many return
statements within this function. Open
Open
return produce(state, (draft) => {
draft.hidden[semester] = hiddenModules;
});
Avoid too many return
statements within this function. Open
Open
return {
...state,
lessons: { [semester]: timetable },
colors: { [semester]: colors },
hidden: { [semester]: hidden },