department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function uiSchema has 187 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function uiSchema(
  label = 'Address',
  useStreet3 = false,
  isRequired = null,
  ignoreRequired = false,
Severity: Major
Found in src/applications/pre-need-integration/definitions/address.js - About 7 hrs to fix

    Function EvidenceVaRecords has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
    Open

    const EvidenceVaRecords = ({
      data,
      goBack,
      goForward,
      goToPath,
    Severity: Minor
    Found in src/applications/appeals/995/components/EvidenceVaRecords.jsx - About 7 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

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

    // This Component is a close duplicate of the FileField provided by Platform.
    /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
    import PropTypes from 'prop-types';
    import React from 'react';
    import { connect } from 'react-redux';
    Severity: Minor
    Found in src/applications/lgy/coe/form/config/chapters/documents/FileField.jsx - About 7 hrs to fix

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

      // This Component is a close duplicate of the FileField provided by Platform.
      /* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
      import PropTypes from 'prop-types';
      import React from 'react';
      import { connect } from 'react-redux';

        Function PrescriptionDetailsDocumentation has 185 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const PrescriptionDetailsDocumentation = () => {
          const { prescriptionId } = useParams();
          const contentRef = useRef();
          const {
            prescription,

          File self_entered_info.js has 474 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: Minor
          Found in src/platform/pdf/templates/self_entered_info.js - About 7 hrs to fix

            Function buildVAPrescriptionPDFList has 184 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const buildVAPrescriptionPDFList = prescription => {
              const refillHistory = [...(prescription?.rxRfRecords || [])];
              const originalFill = createOriginalFillRecord(prescription);
              refillHistory.push(originalFill);
            
            
            Severity: Major
            Found in src/applications/mhv-medications/util/pdfConfigs.js - About 7 hrs to fix

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

              import moment from 'moment-timezone';
              import { expect } from 'chai';
              import {
                addUniqueEventsToList,
                deriveDefaultSelectedOption,
              Severity: Minor
              Found in src/applications/static-pages/events/helpers/index.unit.spec.js - About 7 hrs to fix

                File address-schema.js has 473 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)

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

                    render() {
                      return (
                        <div
                          className="schemaform-intro"
                          itemScope
                  Severity: Major
                  Found in src/applications/edu-benefits/10203/containers/IntroductionPage.jsx - About 7 hrs to fix

                    Function uiSchema has 183 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function uiSchema() {
                      const topicChangeSelector = createSelector(
                        ({ formData }) => get(['topic'].concat('levelOne'), formData),
                        ({ formData }) => get(['topic'].concat('levelTwo'), formData),
                        ({ topicSchema }) => topicSchema,
                    Severity: Major
                    Found in src/applications/ask-a-question/form/inquiry/topic/topic.js - About 7 hrs to fix

                      File EducationWizard.jsx has 470 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // disabled for unit testing to work
                      /* eslint-disable no-restricted-syntax */
                      /* eslint-disable guard-for-in */
                      
                      import React from 'react';
                      Severity: Minor
                      Found in src/applications/edu-benefits/components/EducationWizard.jsx - About 7 hrs to fix

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

                        import React from 'react';
                        import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                        import { externalServices } from 'platform/monitoring/DowntimeNotification';
                        import get from 'platform/utilities/data/get';
                        import manifest from '../manifest.json';
                        Severity: Minor
                        Found in src/applications/ivc-champva/10-7959C/config/form.js - About 7 hrs to fix

                          File address-schema.js has 470 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)

                            Function ConfirmationPage has 182 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const ConfirmationPage = props => {
                              useLayoutEffect(() => {
                                focusElement('h2', null, 'va-alert');
                                scrollToTop('topScrollElement');
                              }, []);
                            Severity: Major
                            Found in src/applications/simple-forms/21-0966/containers/ConfirmationPage.jsx - About 7 hrs to fix

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

                                render() {
                                  const { route, userIdVerified, userLoggedIn } = this.props;
                                  const { formConfig, pageList } = route;
                              
                                  return (
                              Severity: Major
                              Found in src/applications/simple-forms/21-0966/containers/IntroductionPage.jsx - About 7 hrs to fix

                                File healthInsuranceInformation.js has 467 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import React from 'react';
                                import {
                                  titleUI,
                                  titleSchema,
                                  textUI,

                                  Function renderYourMilitaryDetails has 180 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    const renderYourMilitaryDetails = () => {
                                      const chapter33Check = giBillChapter === '33a' || giBillChapter === '33b';
                                      /*
                                        ***toggleCumulativeDropDown***
                                        Hide Cumulative Post 9/11 active-duty service drop down if applicant selects 'Fry Scholarship'
                                  Severity: Major
                                  Found in src/applications/gi/components/profile/BenefitsForm.jsx - About 7 hrs to fix

                                    File Dashboard.jsx has 466 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import React, { useEffect, useState } from 'react';
                                    import PropTypes from 'prop-types';
                                    import { connect, useDispatch, useSelector } from 'react-redux';
                                    import isEmpty from 'lodash/isEmpty';
                                    
                                    
                                    Severity: Minor
                                    Found in src/applications/personalization/dashboard/components/Dashboard.jsx - About 7 hrs to fix

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

                                      export const ConfirmationPageV2 = () => {
                                        resetStoredSubTask();
                                      
                                        const alertRef = useRef(null);
                                      
                                      
                                      Severity: Major
                                      Found in src/applications/appeals/996/components/ConfirmationPageV2.jsx - About 7 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language