department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

File helpers.jsx has 405 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable camelcase */
import React from 'react';

import EbenefitsLink from 'platform/site-wide/ebenefits/containers/EbenefitsLink';
import { apiRequest as commonApiClient } from '@department-of-veterans-affairs/platform-utilities/api';
Severity: Minor
Found in src/applications/letters/utils/helpers.jsx - About 5 hrs to fix

    Function DateTimeSelectPage has 143 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function DateTimeSelectPage() {
      const pageTitle = useSelector(state => getPageTitle(state, pageKey));
    
      const {
        appointmentSlotsStatus,

      File ResultCard.jsx has 405 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useState } from 'react';
      import PropTypes from 'prop-types';
      import { connect } from 'react-redux';
      import classNames from 'classnames';
      import appendQuery from 'append-query';
      Severity: Minor
      Found in src/applications/gi/containers/search/ResultCard.jsx - About 5 hrs to fix

        Function DeleteDraft has 142 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DeleteDraft = props => {
          const history = useHistory();
          const location = useLocation();
          const dispatch = useDispatch();
          const deleteDraftButtonRef = useRef();

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

            render() {
              const showUploadModal =
                this.props.uploading && this.state.canShowUploadModal;
          
              return (

            Function Vaccines has 142 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const Vaccines = props => {
              const { runningUnitTest } = props;
              const dispatch = useDispatch();
              const updatedRecordList = useSelector(state => state.mr.vaccines.updatedList);
              const listState = useSelector(state => state.mr.vaccines.listState);
            Severity: Major
            Found in src/applications/mhv-medical-records/containers/Vaccines.jsx - About 5 hrs to fix

              File ReviewCardField.jsx has 403 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              import PropTypes from 'prop-types';
              import * as Sentry from '@sentry/browser';
              
              import {
              Severity: Minor
              Found in src/platform/forms-system/src/js/components/ReviewCardField.jsx - About 5 hrs to fix

                File ProfilePageHeader.jsx has 403 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import PropTypes from 'prop-types';
                import React, { useState } from 'react';
                import { connect } from 'react-redux';
                import _ from 'lodash';
                import classNames from 'classnames';
                Severity: Minor
                Found in src/applications/gi/containers/ProfilePageHeader.jsx - About 5 hrs to fix

                  File helpers.jsx has 402 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { cloneDeep } from 'lodash';
                  
                  import { formFields } from './constants';
                  
                  import { getSchemaCountryCode } from './utils/form-submit-transform';
                  Severity: Minor
                  Found in src/applications/toe/helpers.jsx - About 5 hrs to fix

                    Function TravelReview has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const TravelReview = props => {
                      const { router } = props;
                      const { t } = useTranslation();
                      const selectForm = useMemo(makeSelectForm, []);
                      const { data } = useSelector(selectForm);
                    Severity: Major
                    Found in src/applications/check-in/travel-claim/pages/travel-review/index.jsx - About 5 hrs to fix

                      Function NewBookingSection has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function NewBookingSection() {
                        const match = useRouteMatch();
                        const location = useLocation();
                        const dispatch = useDispatch();
                        const canUseVaccineFlow = useSelector(selectCanUseVaccineFlow);
                      Severity: Major
                      Found in src/applications/vaos/covid-19-vaccine/index.jsx - About 5 hrs to fix

                        Function resolveLandingPageLinks has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const resolveLandingPageLinks = (
                          authdWithSSOe = false,
                          featureToggles,
                          unreadMessageAriaLabel,
                          registered = false,
                        Severity: Major
                        Found in src/applications/mhv-landing-page/utilities/data/index.js - About 5 hrs to fix

                          Function PrintDownload has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const PrintDownload = props => {
                            const {
                              downloadPdf,
                              downloadTxt,
                              list,

                            File transactions.js has 401 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import * as Sentry from '@sentry/browser';
                            
                            import {
                              ADDRESS_POU,
                              FIELD_NAMES,
                            Severity: Minor
                            Found in src/platform/user/profile/vap-svc/actions/transactions.js - About 5 hrs to fix

                              File PrescriptionDetails.jsx has 401 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import React, { useCallback, useEffect, useState } from 'react';
                              import { useDispatch, useSelector } from 'react-redux';
                              import { useParams } from 'react-router-dom';
                              import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
                              import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
                              Severity: Minor
                              Found in src/applications/mhv-medications/containers/PrescriptionDetails.jsx - About 5 hrs to fix

                                Function SelectAccreditedRepresentative has 140 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const SelectAccreditedRepresentative = props => {
                                  const {
                                    loggedIn,
                                    setFormData,
                                    formData,

                                  Function resolveParamsWithUrl has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export const resolveParamsWithUrl = ({
                                    address,
                                    locationType,
                                    serviceType,
                                    page,
                                  Severity: Minor
                                  Found in src/applications/facility-locator/config.js - About 5 hrs to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Function EvidencePrivateRecords has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const EvidencePrivateRecords = ({
                                    data,
                                    goBack,
                                    goForward,
                                    goToPath,
                                  Severity: Minor
                                  Found in src/applications/appeals/995/components/EvidencePrivateRecords.jsx - About 5 hrs to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Function EvidencePrivateRecords has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const EvidencePrivateRecords = ({
                                    data,
                                    goBack,
                                    goForward,
                                    goToPath,

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Function DependentAges has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const DependentAges = ({
                                    contentBeforeButtons,
                                    contentAfterButtons,
                                    goForward,
                                    goToPath,

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language