department-of-veterans-affairs/vets-website

View on GitHub
src/applications/mhv-medical-records/reducers/downloads.js

Summary

Maintainability
B
4 hrs
Test Coverage

Function downloadsReducer has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const downloadsReducer = (state = initialState, action) => {
  switch (action.type) {
    case Actions.Downloads.GENERATE_CCD: {
      return {
        ...state,
Severity: Major
Found in src/applications/mhv-medical-records/reducers/downloads.js - About 2 hrs to fix

    Avoid too many return statements within this function.
    Open

          return {
            ...state,
            dateFilter: action.response,
          };
    Severity: Major
    Found in src/applications/mhv-medical-records/reducers/downloads.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return { ...state };
      Severity: Major
      Found in src/applications/mhv-medical-records/reducers/downloads.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return {
                ...state,
                recordFilter: action.response,
              };
        Severity: Major
        Found in src/applications/mhv-medical-records/reducers/downloads.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return {
                  ...state,
                  downloadSuccess: true,
                };
          Severity: Major
          Found in src/applications/mhv-medical-records/reducers/downloads.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return {
                    ...state,
                    downloadSuccess: false,
                  };
            Severity: Major
            Found in src/applications/mhv-medical-records/reducers/downloads.js - About 30 mins to fix

              There are no issues that match your filters.

              Category
              Status