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

Summary

Maintainability
A
3 hrs
Test Coverage

Function reducer has 47 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, '']));
Severity: Minor
Found in vj4/ui/components/messagepad/reducers/inputs.js - About 1 hr to fix

    Avoid too many return statements within this function.
    Open

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

      Avoid too many return statements within this function.
      Open

          return {
            ..._.omit(state, placeholderId),
            [action.payload.mdoc._id]: '',
          };
      Severity: Major
      Found in vj4/ui/components/messagepad/reducers/inputs.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/inputs.js - About 30 mins to fix

          There are no issues that match your filters.

          Category
          Status