department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

export default function() {
  if (
    // need this environment check for unit tests to work
    environment.isProduction() &&
    // this will filter production users using the feature flag
Severity: Major
Found in src/applications/disability-benefits/all-claims/config/8940/index.js - About 5 hrs to fix

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

    const BlockedTriageGroupAlert = props => {
      const { blockedTriageGroupList, alertStyle, parentComponent } = props;
    
      const { alertTitle, alertMessage } = BlockedTriageAlertText;
      const MESSAGE_TO_CARE_TEAM = "You can't send messages to";

      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 PrescriptionDetails.jsx has 404 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 FilterBox has 142 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const FilterBox = forwardRef((props, ref) => {
            const {
              category,
              setCategory,
              dateRange,
          Severity: Major
          Found in src/applications/mhv-secure-messaging/components/Search/FilterBox.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 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 render has 141 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const { showWizard } = this.props;
                
                    if (showWizard === undefined) return null;
                
                

                  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

                      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

                        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 EvidenceVaRecords has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const EvidenceVaRecords = ({
                          data,
                          goBack,
                          goForward,
                          goToPath,
                        Severity: Minor
                        Found in src/applications/appeals/995/components/EvidenceVaRecords.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 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 ApplicantAddressCopyPage has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function ApplicantAddressCopyPage({
                          contentBeforeButtons,
                          contentAfterButtons,
                          data,
                          setFormData,

                        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

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

                        const ChangeOfAddressWrapper = ({ mailingAddress, applicantName }) => {
                          const { loading: isLoading, error, data: response } = useSelector(
                            state => state.updateAddress,
                          );
                          const {

                        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

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

                        // Node modules.
                        import React from 'react';
                        import PropTypes from 'prop-types';
                        import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
                        // Relative imports.

                          File helpers.jsx has 399 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
                            Severity
                            Category
                            Status
                            Source
                            Language