department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function Landing has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const Landing = props => {
  const { location, router } = props;
  const { jumpToPage } = useFormRouting(router);
  const { t } = useTranslation();

Severity: Major
Found in src/applications/check-in/day-of/pages/Landing.jsx - About 3 hrs to fix

    Function TravelClaimDetails has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function TravelClaimDetails() {
      const { id } = useParams();
      const location = useLocation();
      const { claimDetailsProps = null } = location.state ?? {};
      const [claimDetails, setClaimDetails] = useState(claimDetailsProps);
    Severity: Major
    Found in src/applications/travel-pay/components/TravelClaimDetails.jsx - About 3 hrs to fix

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

        render() {
          const {
            loadingDecisionRequest,
            decisionRequestError,
            params,
      Severity: Major
      Found in src/applications/claims-status/containers/AskVAPage.jsx - About 3 hrs to fix

        Function buildPrescriptionsPDFList has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const buildPrescriptionsPDFList = prescriptions => {
          return prescriptions?.map(rx => {
            if (rx?.prescriptionSource === 'NV') {
              return {
                ...buildNonVAPrescriptionPDFList(rx)[0],
        Severity: Major
        Found in src/applications/mhv-medications/util/pdfConfigs.js - About 3 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              if (prescription) {
                const dispStatus = prescription.dispStatus?.toString();
                return (
                  <>
                    <div className="medication-details-div vads-u-border-top--1px vads-u-border-color--gray-lighter vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--3">

            File claimInformation.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React from 'react';
            import {
              titleUI,
              titleSchema,
              radioUI,
            Severity: Minor
            Found in src/applications/ivc-champva/10-7959a/chapters/claimInformation.js - About 3 hrs to fix

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

              import React from 'react';
              import PropTypes from 'prop-types';
              import manifest from '../manifest.json';
              import Alert from '../components/Alert';
              
              
              Severity: Minor
              Found in src/applications/verify-your-enrollment/constants/index.js - About 3 hrs to fix

                File event-generator.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import moment from 'moment-timezone';
                import { fleshOutRecurringEvents, removeDuplicateEvents } from '.';
                
                moment.tz.setDefault('America/New_York');
                const now = moment().clone();
                Severity: Minor
                Found in src/applications/static-pages/events/helpers/event-generator.js - About 3 hrs to fix

                  File BenefitsForm.jsx has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React, { useState } from 'react';
                  import PropTypes from 'prop-types';
                  import EbenefitsLink from 'platform/site-wide/ebenefits/containers/EbenefitsLink';
                  import {
                    ariaLabels,
                  Severity: Minor
                  Found in src/applications/gi/components/profile/BenefitsForm.jsx - About 3 hrs to fix

                    Function createLocationEvents has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const createLocationEvents = () => {
                      const facilityEventData = {
                        fieldEventCost: 'Free',
                        fieldFacilityLocation: {
                          entity: {
                    Severity: Major
                    Found in src/applications/static-pages/events/helpers/event-generator.js - About 3 hrs to fix

                      Function YourVAHealthFacilityPage has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const YourVAHealthFacilityPage = props => {
                        const { data, setFormData, goBack, goForward, searchQuery } = props;
                        const [apiData, setApiData] = useState(facilities);
                        const [isSearching, setIsSearching] = useState(false);
                        const [pageURL, setPageURL] = useState('');
                      Severity: Major
                      Found in src/applications/ask-va/containers/YourVAHealthFacility.jsx - About 3 hrs to fix

                        Function editEmailAddressSuccess has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const editEmailAddressSuccess = () => {
                          // store the email address that's passed in via the POST or PUT call so we can
                          // return it with the GET user/ response
                          let newEmailAddress;
                          return [
                        Severity: Major
                        Found in src/applications/personalization/profile/msw-mocks.js - About 3 hrs to fix

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

                            render() {
                              const { form } = this.props;
                              const { name } = form.data.application.claimant;
                              const submittedAt = moment(form.submission.submittedAt);
                          
                          
                          Severity: Major
                          Found in src/applications/pre-need-integration/containers/ConfirmationPage.jsx - About 3 hrs to fix

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

                            import React from 'react';
                            import { expect } from 'chai';
                            import moment from 'moment-timezone';
                            import MockDate from 'mockdate';
                            import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';

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

                              import * as Sentry from '@sentry/browser';
                              import recordEvent from 'platform/monitoring/record-event';
                              import localStorage from 'platform/utilities/storage/localStorage';
                              import { displayFileSize } from 'platform/utilities/ui/index';
                              import { FILE_UPLOAD_NETWORK_ERROR_MESSAGE } from 'platform/forms-system/src/js/constants';
                              Severity: Minor
                              Found in src/platform/forms-system/src/js/actions.js - About 3 hrs to fix

                                Function FormApp has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const FormApp = props => {
                                  const { currentLocation, formConfig, children, formData } = props;
                                  const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
                                  const lastPathComponent = currentLocation.pathname.split('/').pop();
                                  const { additionalRoutes, CustomTopContent } = formConfig;
                                Severity: Major
                                Found in src/platform/forms-system/src/js/containers/FormApp.jsx - About 3 hrs to fix

                                  Function getProfileInfoFieldAttributes has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const getProfileInfoFieldAttributes = fieldName => {
                                    let apiRoute;
                                    let convertCleanDataToPayload;
                                    let title;
                                    let uiSchema;

                                    Function getProfileInfoFieldAttributes has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const getProfileInfoFieldAttributes = fieldName => {
                                      let apiRoute;
                                      let convertCleanDataToPayload;
                                      let title;
                                      let uiSchema;

                                      Function IntroductionPage has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const IntroductionPage = props => {
                                        const { ombInfo, route } = props;
                                        const { formConfig, pageList } = route;
                                      
                                        useEffect(() => {

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

                                          render() {
                                            const { disabilities } = this.state;
                                            const { calculatedRating } = this.state;
                                            const ratings = getRatings(disabilities);
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language