department-of-veterans-affairs/vets-website

View on GitHub
src/applications/personalization/profile/ducks/communicationPreferences.js

Summary

Maintainability
C
1 day
Test Coverage

File communicationPreferences.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import recordEvent from '~/platform/monitoring/record-event';
import { apiRequest } from '~/platform/utilities/api';

import { LOADING_STATES } from '../../common/constants';
import { RX_TRACKING_SUPPORTING_FACILITIES } from '../constants';

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

    export default function reducer(state = initialState, action = {}) {
      switch (action.type) {
        case FETCH_STARTED: {
          return { ...state, loadingStatus: LOADING_STATES.pending };
        }

      Avoid too many return statements within this function.
      Open

            return newState;

        Avoid too many return statements within this function.
        Open

              return state;

          Avoid too many return statements within this function.
          Open

                return newState;

            There are no issues that match your filters.

            Category
            Status