vj4/ui/components/messagepad/reducers/isPosting.js

Summary

Maintainability
B
5 hrs
Test Coverage

Function reducer has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function reducer(state = {}, action) {
  switch (action.type) {
  case 'DIALOGUES_LOAD_DIALOGUES_FULFILLED': {
    const dialogues = action.payload.messages;
    return _.fromPairs(_.map(dialogues, d => [d._id, false]));
Severity: Major
Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 2 hrs to fix

    Avoid too many return statements within this function.
    Open

        return {
          ...state,
          [id]: false,
        };
    Severity: Major
    Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return state;
      Severity: Major
      Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return {
              ...state,
              [placeholderId]: false,
            };
        Severity: Major
        Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return {
                ...state,
                [placeholderId]: true,
              };
          Severity: Major
          Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return {
                    ...state,
                    [id]: false,
                  };
            Severity: Major
            Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return {
                    ..._.omit(state, placeholderId),
                    [action.payload.mdoc._id]: false,
                  };
              Severity: Major
              Found in vj4/ui/components/messagepad/reducers/isPosting.js - About 30 mins to fix

                There are no issues that match your filters.

                Category
                Status