department-of-veterans-affairs/vets-website

View on GitHub
src/applications/vaos/appointment-list/redux/actions.js

Summary

Maintainability
D
2 days
Test Coverage

File actions.js has 544 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable no-prototype-builtins */
import moment from 'moment';
import * as Sentry from '@sentry/browser';
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
import {
Severity: Major
Found in src/applications/vaos/appointment-list/redux/actions.js - About 1 day to fix

    Function fetchConfirmedAppointmentDetails has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function fetchConfirmedAppointmentDetails(id, type) {
      return async (dispatch, getState) => {
        try {
          const state = getState();
          const featureVAOSServiceVAAppointments = selectFeatureVAOSServiceVAAppointments(
    Severity: Major
    Found in src/applications/vaos/appointment-list/redux/actions.js - About 2 hrs to fix

      Function fetchPastAppointments has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function fetchPastAppointments(startDate, endDate, selectedIndex) {
        return async (dispatch, getState) => {
          const featureVAOSServiceVAAppointments = selectFeatureVAOSServiceVAAppointments(
            getState(),
          );
      Severity: Major
      Found in src/applications/vaos/appointment-list/redux/actions.js - About 2 hrs to fix

        Function fetchPendingAppointments has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function fetchPendingAppointments() {
          return async (dispatch, getState) => {
            try {
              dispatch({
                type: FETCH_PENDING_APPOINTMENTS,
        Severity: Major
        Found in src/applications/vaos/appointment-list/redux/actions.js - About 2 hrs to fix

          Function fetchRequestDetails has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function fetchRequestDetails(id) {
            return async (dispatch, getState) => {
              try {
                const state = getState();
                let request = selectAppointmentById(state, id, [
          Severity: Minor
          Found in src/applications/vaos/appointment-list/redux/actions.js - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status