department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

File FileField.jsx has 567 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import PropTypes from 'prop-types';
import React, { useEffect, useState, useRef } from 'react';
import classNames from 'classnames';
import { VaModal } from '@department-of-veterans-affairs/component-library/dist/react-bindings';

Severity: Major
Found in src/applications/appeals/shared/components/FileField.jsx - About 1 day to fix

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

      render() {
        const {
          activeIndex,
          isOpen,
          inputValue,

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

        render() {
          const {
            activeIndex,
            isOpen,
            inputValue,
      Severity: Major
      Found in src/platform/site-wide/user-nav/components/SearchDropdownComponent.js - About 1 day to fix

        Function ConfirmationPageV2 has 239 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const ConfirmationPageV2 = () => {
          resetStoredSubTask();
        
          const form = useSelector(state => state.form || {});
          const profile = useSelector(state => selectProfile(state));
        Severity: Major
        Found in src/applications/appeals/995/components/ConfirmationPageV2.jsx - About 1 day to fix

          Function CalculationInstructions has 238 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const CalculationInstructions = () => {
            return (
              <div className="vads-l-grid-container vads-u-margin-top--4">
                <h1 className="vads-u-margin-top--2">
                  Calculation instructions for VA Form 22-10215: Statement of Assurance of

            Function EditContactList has 237 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const EditContactList = () => {
              const dispatch = useDispatch();
              const location = useLocation();
              const history = useHistory();
              const [allTriageTeams, setAllTriageTeams] = useState(null);
            Severity: Major
            Found in src/applications/mhv-secure-messaging/containers/EditContactList.jsx - About 1 day to fix

              File RenderErrorContainer.jsx has 560 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              import PropTypes from 'prop-types';
              import { AUTH_ERRORS, AUTH_LEVEL } from 'platform/user/authentication/errors';
              import ContactCenterInformation from 'platform/user/authentication/components/ContactCenterInformation';
              
              
              Severity: Major
              Found in src/applications/auth/components/RenderErrorContainer.jsx - About 1 day to fix

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

                const BlockedTriageGroupAlert = props => {
                  const {
                    alertStyle,
                    parentComponent,
                    currentRecipient,

                  Function renderProfileCalculatorModals has 236 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const renderProfileCalculatorModals = () => {
                      const whenUsedGiBill = (
                        <div>
                          <p>
                            Effective January 1, 2018, the Post-9/11 GI Bill monthly housing
                  Severity: Major
                  Found in src/applications/gi/containers/Modals.jsx - About 1 day to fix

                    File form.js has 559 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // we're not using JSON schema for this form
                    import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                    import footerContent from 'platform/forms/components/FormFooter';
                    import { externalServices } from 'platform/monitoring/DowntimeNotification';
                    import getHelp from '../../shared/components/GetFormHelp';
                    Severity: Major
                    Found in src/applications/simple-forms/20-10207/config/form.js - About 1 day to fix

                      File CompareLayout.jsx has 558 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import PropTypes from 'prop-types';
                      import { connect } from 'react-redux';
                      import classNames from 'classnames';
                      import _ from 'lodash';
                      Severity: Major
                      Found in src/applications/gi/containers/CompareLayout.jsx - About 1 day to fix

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

                        import {
                          getDefaultFormState,
                          getDefaultRegistry,
                        } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
                        import * as Sentry from '@sentry/browser';

                          Function content has 234 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const content = () => {
                              return (
                                <div className="landing-page no-print">
                                  <h1 data-testid="list-page-title" className="vads-u-margin-bottom--2">
                                    Medications
                          Severity: Major
                          Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 1 day to fix

                            File ReplyDraftItem.jsx has 556 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React, {
                              useEffect,
                              useMemo,
                              useState,
                              useCallback,

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

                              /* eslint-disable camelcase */
                              /**
                               * Functions related to fetching Apppointment data and pulling information from that data
                               * @module services/Appointment
                               */
                              Severity: Major
                              Found in src/applications/vaos/services/appointment/index.js - About 1 day to fix

                                Function RefillPrescriptions has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const RefillPrescriptions = ({ isLoadingList = true }) => {
                                  // Hooks
                                  const location = useLocation();
                                  const dispatch = useDispatch();
                                
                                
                                Severity: Minor
                                Found in src/applications/mhv-medications/containers/RefillPrescriptions.jsx - About 1 day 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

                                File blue_button_report.js has 552 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /**
                                 * Blue Button PDF template.
                                 *
                                 * NB: The order in which items are added to the document is important,
                                 * and thus PDFKit requires performing operations synchronously.
                                Severity: Major
                                Found in src/platform/pdf/templates/blue_button_report.js - About 1 day to fix

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

                                  import {
                                    getDefaultFormState,
                                    getDefaultRegistry,
                                  } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
                                  import * as Sentry from '@sentry/browser';

                                    Function DateAndTimeContent has 231 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const DateAndTimeContent = props => {
                                      const { currentReferral, provider, appointmentsByMonth } = props;
                                      const dispatch = useDispatch();
                                      const history = useHistory();
                                    
                                    

                                      File address-schema.js has 551 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      /**
                                       * The intent for this module is to provide a flexible, reusable address schema and widget that can be used in any form throughout VA.gov.
                                       * The address uiSchema should be flexible enough to handle these cases:
                                       * 1. Top level address property (schema.properties.address)
                                       * 2. Nested address property (schema.properties.someProperty.properties.address)
                                      Severity: Major
                                      Found in src/applications/disability-benefits/2346/schemas/address-schema.js - About 1 day to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language