department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function SearchQueryReducer has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const SearchQueryReducer = (state = INITIAL_STATE, action) => {
  switch (action.type) {
    case SEARCH_STARTED:
      return {
        ...state,
Severity: Major
Found in src/applications/representative-search/reducers/searchQuery.js - About 2 hrs to fix

    Function WarningHeadline has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const WarningHeadline = () => {
      const { statusCode } = useSelector(selectEnrollmentStatus);
    
      // Declare enrollment status content dictionary
      const contentDictionary = [

      Function submit has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const submit = form => {
        const currentAddress = form.data['view:currentAddress'];
        const itemQuantities = form.data?.order?.length;
        const { order, permanentAddress, temporaryAddress, vetEmail } = form.data;
        const useVeteranAddress = currentAddress === 'permanentAddress';
      Severity: Major
      Found in src/applications/disability-benefits/2346/config/form.js - About 2 hrs to fix

        Function InterstitialPage has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const InterstitialPage = props => {
          const { acknowledge, type } = props;
        
          useEffect(() => {
            focusElement(document.querySelector('h1'));
        Severity: Major
        Found in src/applications/mhv-secure-messaging/containers/InterstitialPage.jsx - About 2 hrs to fix

          Function selectConfirmedAppointmentData has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function selectConfirmedAppointmentData(state, appointment) {
            const isCommunityCare = appointment?.vaos?.isCommunityCare;
            const appointmentTypePrefix = isCommunityCare ? 'cc' : 'va';
          
            const isVideo = appointment?.vaos?.isVideo;
          Severity: Major
          Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

            Function TypeOfVisitPage has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function TypeOfVisitPage() {
              const pageTitle = useSelector(state => getPageTitle(state, pageKey));
            
              const { schema, data, pageChangeInProgress } = useSelector(
                state => getFormPageInfo(state, pageKey),
            Severity: Major
            Found in src/applications/vaos/new-appointment/components/TypeOfVisitPage.jsx - About 2 hrs to fix

              Function claimsV2Reducer has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function claimsV2Reducer(state = initialState, action) {
                switch (action.type) {
                  case FETCH_CLAIMS_PENDING:
                    return set('claimsLoading', true, state);
                  case FETCH_CLAIMS_SUCCESS:
              Severity: Major
              Found in src/applications/claims-status/reducers/claimsV2.js - About 2 hrs to fix

                Function LabAndTestDetails has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const LabAndTestDetails = () => {
                  const dispatch = useDispatch();
                  const labAndTestDetails = useSelector(
                    state => state.mr.labsAndTests.labsAndTestsDetails,
                  );
                Severity: Major
                Found in src/applications/mhv-medical-records/containers/LabAndTestDetails.jsx - About 2 hrs to fix

                  Function items has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              .map((entry, i) => {
                                const { shape, color, backImprint, frontImprint } = entry;
                                const index = refillHistory.length - i - 1;
                                const phone =
                                  entry.cmopDivisionPhone || entry.dialCmopDivisionPhone;
                  Severity: Major
                  Found in src/applications/mhv-medications/util/pdfConfigs.js - About 2 hrs to fix

                    File personalInformationHelper.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import VaTextInputField from 'platform/forms-system/src/js/web-component-fields/VaTextInputField';
                    import {
                      dateOfBirthSchema,
                      dateOfBirthUI,
                      selectSchema,

                      File DownloadRecordType.jsx has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React, { useState, useMemo, useEffect, useRef } from 'react';
                      import { useHistory } from 'react-router-dom';
                      import { useDispatch, useSelector } from 'react-redux';
                      import {
                        VaCheckbox,

                        Consider simplifying this complex logical expression.
                        Open

                              if (isDataFetched) {
                                return {
                                  labsAndTests:
                                    labsAndTests && recordFilter?.includes('labTests')
                                      ? labsAndTests.filter(rec => filterByDate(rec.sortDate))

                          File index.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { apiRequest } from 'platform/utilities/api';
                          import environment from 'platform/utilities/environment';
                          
                          import { toSnakeCase } from '../helpers';
                          
                          
                          Severity: Minor
                          Found in src/applications/my-education-benefits/actions/index.js - About 2 hrs to fix

                            File employersPages.js has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { arrayBuilderPages } from '~/platform/forms-system/src/js/patterns/array-builder';
                            import {
                              addressSchema,
                              addressUI,
                              arrayBuilderItemFirstPageTitleUI,

                              File SearchControls.jsx has 277 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import React from 'react';
                              import PropTypes from 'prop-types';
                              import classNames from 'classnames';
                              import {
                                VaModal,

                                Function render has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  render() {
                                    const { formConfig, buttonOnly, devOnly } = this.props;
                                    const devOnlyForceShowFormControls =
                                      environment.isLocalhost() &&
                                      !window.Cypress &&
                                Severity: Major
                                Found in src/platform/forms/save-in-progress/SaveInProgressIntro.jsx - About 2 hrs to fix

                                  Function isValidForm has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function isValidForm(form, pageList, isTesting = false) {
                                    const pageListMap = new Map();
                                    pageList.forEach(page => pageListMap.set(page.pageKey, page));
                                    const validPages = Object.keys(form.pages).filter(pageKey =>
                                      isActivePage(find(pageList, { pageKey }), form.data),
                                  Severity: Major
                                  Found in src/platform/forms-system/src/js/validation.js - About 2 hrs to fix

                                    Function ITFBanner has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const ITFBanner = props => {
                                      const [messageDismissed, setMessageDismissed] = useState(false);
                                      const [reviewInitialFocus, setReviewInitialFocus] = useState(false);
                                    
                                      const goHome = () => {
                                    Severity: Major
                                    Found in src/applications/appeals/995/components/ITFBanner.jsx - About 2 hrs to fix

                                      Function ITFBanner has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const ITFBanner = props => {
                                        const [messageDismissed, setMessageDismissed] = useState(false);
                                        const [reviewInitialFocus, setReviewInitialFocus] = useState(false);
                                      
                                        const goHome = () => {
                                      Severity: Major
                                      Found in src/applications/appeals/testing/sc/components/ITFBanner.jsx - About 2 hrs to fix

                                        Function createDirectDepositPage has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export default function createDirectDepositPage() {
                                          const bankAccountProperties = {
                                            type: 'object',
                                            properties: {
                                              accountType: {
                                        Severity: Major
                                        Found in src/applications/edu-benefits/5490/content/directDeposit.jsx - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language