department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function generateDemographicsContent has 409 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const generateDemographicsContent = record => {
  const results = {
    results: {
      sectionSeparators: false,
      items: [
Severity: Major
Found in src/applications/mhv-medical-records/util/pdfHelpers/demographics.js - About 2 days to fix

    Function AppointmentDetails has 407 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const AppointmentDetails = props => {
      const { router } = props;
      const { t } = useTranslation();
      const dispatch = useDispatch();
      const {

      Function SearchPage has 405 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const SearchPage = props => {
        const searchResultTitleRef = useRef(null);
        const previousLocationInputString = useRef(
          props.currentQuery.locationInputString,
        );
      Severity: Major
      Found in src/applications/representative-search/containers/SearchPage.jsx - About 2 days to fix

        File FilterBeforeResults.jsx has 829 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* eslint-disable no-unused-vars */
        import React, { useState, useEffect } from 'react';
        import { useHistory } from 'react-router-dom';
        import PropTypes from 'prop-types';
        import { connect } from 'react-redux';
        Severity: Major
        Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 1 day to fix

          File Prescriptions.jsx has 826 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, {
            useCallback,
            useEffect,
            useMemo,
            useRef,
          Severity: Major
          Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 1 day to fix

            Function ArrayBuilderSummaryPage has 395 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function ArrayBuilderSummaryPage(arrayBuilderOptions) {
              const {
                arrayPath,
                getFirstItemPagePath,
                getText,

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

              import React from 'react';
              import { Route } from 'react-router-dom';
              import { expect } from 'chai';
              import sinon from 'sinon';
              import moment from 'moment';

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

                /* istanbul ignore file */
                /* eslint-disable camelcase */
                const delay = require('mocker-api/lib/delay');
                const moment = require('moment');
                // var
                Severity: Major
                Found in src/applications/vaos/services/mocks/index.js - About 1 day to fix

                  File reducer.js has 818 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* eslint-disable sonarjs/max-switch-cases */
                  import { getDefaultFormState } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
                  
                  import set from 'platform/utilities/data/set';
                  import unset from 'platform/utilities/data/unset';
                  Severity: Major
                  Found in src/applications/vaos/new-appointment/redux/reducer.js - About 1 day to fix

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

                    /* eslint-disable @department-of-veterans-affairs/axe-check-required */
                    import { expect } from 'chai';
                    import sinon from 'sinon';
                    import {
                      mockFetch,
                    Severity: Major
                    Found in src/applications/vaos/services/appointment/index.unit.spec.js - About 1 day to fix

                      File patient.js has 801 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      const patient = {
                        id: 11383893,
                        oplock: 1,
                        invalidationReferenceId: '202206169-9203',
                        lastFacilitiesUpdateDateTime: 1731681057000,
                      Severity: Major
                      Found in src/platform/mhv/api/mocks/medical-records/blue-button/patient.js - About 1 day to fix

                        Function DownloadFileType has 379 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const DownloadFileType = props => {
                          const { runningUnitTest = false } = props;
                          const history = useHistory();
                          const [fileType, setFileType] = useState('');
                        
                        

                          File msw-mocks.js has 782 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { rest } from 'msw';
                          import mockDisabilityCompensation from '@@profile/mocks/endpoints/disability-compensations';
                          import environment from '~/platform/utilities/environment';
                          
                          import mockDD4CNPSuccess from './tests/fixtures/dd4cnp/dd4cnp-is-set-up.json';
                          Severity: Major
                          Found in src/applications/personalization/profile/msw-mocks.js - About 1 day to fix

                            Function RadiologyDetails has 366 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const RadiologyDetails = props => {
                              const { record, fullState, runningUnitTest } = props;
                              const phase0p5Flag = useSelector(
                                state => state.featureToggles.mhv_integration_medical_records_to_phase_1,
                              );

                              File helpers.js has 771 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import React from 'react';
                              import moment from 'moment';
                              import { DATE_TIMESTAMP, formFields } from './constants';
                              import { getSchemaCountryCode } from './utils/form-submit-transform';
                              
                              
                              Severity: Major
                              Found in src/applications/my-education-benefits/helpers.js - About 1 day to fix

                                File benefits.js has 768 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                const categories = {
                                  BURIALS: 'Burials and memorials',
                                  EDUCATION: 'Education',
                                  EMPLOYMENT: 'Careers and Employment',
                                  MORE_SUPPORT: 'More Support',
                                Severity: Major
                                Found in src/applications/discover-your-benefits/constants/benefits.js - About 1 day to fix

                                  File VideoLayoutVA.unit.spec.js has 763 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import React from 'react';
                                  import { expect } from 'chai';
                                  import {
                                    createTestStore,
                                    renderWithStoreAndRouter,
                                  Severity: Major
                                  Found in src/applications/vaos/components/layout/VideoLayoutVA.unit.spec.js - About 1 day to fix

                                    Function AttachmentsList has 357 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const AttachmentsList = props => {
                                      const {
                                        attachments,
                                        compose,
                                        draftSequence,
                                    Severity: Major
                                    Found in src/applications/mhv-secure-messaging/components/AttachmentsList.jsx - About 1 day to fix

                                      Function PrescriptionDetails has 357 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const PrescriptionDetails = () => {
                                        const prescription = useSelector(
                                          state => state.rx.prescriptions?.prescriptionDetails,
                                        );
                                        const prescriptionsApiError = useSelector(
                                      Severity: Major
                                      Found in src/applications/mhv-medications/containers/PrescriptionDetails.jsx - About 1 day to fix

                                        File LandingPage.jsx has 760 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open

                                        import React, { useEffect, useMemo, useRef } from 'react';
                                        import { useDispatch, useSelector } from 'react-redux';
                                        import { Link } from 'react-router-dom';
                                        import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
                                        import {
                                        Severity: Major
                                        Found in src/applications/mhv-medical-records/containers/LandingPage.jsx - About 1 day to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language