client/app/bundles/course/assessment/submission/reducers/history/questions.js
Function default
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (state = {}, action) {
switch (action.type) {
case actions.FETCH_SUBMISSION_SUCCESS: {
if (action.payload.history) {
return {
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[questionId]: {
...state[questionId],
answerIds,
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return produce(state, (draft) => {
const question = draft[questionId];
const answerIds = question.answerIds;
// Ensure that the id is not being repeatedly added
if (answerIds.indexOf(latestAnswer.id) === -1) {
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return state;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
Open
return {
...state,
[questionId]: {
...state[questionId],
isLoading: false,
- Create a ticketCreate a ticket