department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

File FAQSections.jsx has 379 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';

export const FirstFAQSection = () => {
  return (
    <>
Severity: Minor
Found in src/applications/dhp-connected-devices/components/FAQSections.jsx - About 5 hrs to fix

    Function arrayBuilderPages has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

    export function arrayBuilderPages(options, pageBuilderCallback) {
      let introPath;
      let summaryPath;
      let hasItemsKey;
      const itemPages = [];

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

    const AppointmentMessage = props => {
      const { appointment, page } = props;
      const { t } = useTranslation();
    
      const defaultMessage = t(

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

    const EmploymentRecord = props => {
      const { data, goToPath, setFormData } = props;
    
      const editIndex = getJobIndex();
    
    

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

    const CreditCardBill = props => {
      const { data, goToPath, setFormData } = props;
    
      const { expenses } = data;
      const { creditCardBills = [] } = expenses;

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

    const EmploymentRecord = props => {
      const { data, goToPath, setFormData } = props;
    
      const editIndex = getJobIndex();
    
    

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

    export default function covid19VaccineReducer(state = initialState, action) {
      switch (action.type) {
        case FORM_PAGE_OPENED: {
          const { newBooking } = state;
          const { data, schema } = setupFormData(
    Severity: Minor
    Found in src/applications/vaos/covid-19-vaccine/redux/reducer.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 render has 127 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const { showWizard } = this.props;
    
        if (showWizard === undefined) return null;
    
    
    Severity: Major
    Found in src/applications/edu-benefits/1995/containers/IntroductionPage.jsx - About 5 hrs to fix

      Function getSignlePreviousEnrollments has 127 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getSignlePreviousEnrollments = awards => {
        const myUUID = uuidv4();
        return (
          <div className="vye-top-border" key={myUUID}>
            {awards.transactDate &&
      Severity: Major
      Found in src/applications/verify-your-enrollment/helpers.jsx - About 5 hrs to fix

        Function DependentInformation has 127 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DependentInformation = props => {
          const { data, goToPath, setFormData } = props;
        
          const { dependents = [] } = data;
          const search = new URLSearchParams(window.location.search);
        Severity: Major
        Found in src/applications/hca/components/FormPages/DependentInformation.jsx - About 5 hrs to fix

          Function SearchControls has 127 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const SearchControls = props => {
            const {
              onSubmit,
              locateUser,
              geolocationInProgress,
          Severity: Major
          Found in src/applications/ask-va/components/search/SearchControls.jsx - About 5 hrs to fix

            Function AlertBackgroundBox has 127 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const AlertBackgroundBox = props => {
              const dispatch = useDispatch();
              const alertList = useSelector(state => state.sm.alerts?.alertList);
              const folder = useSelector(state => state.sm.folders?.folder);
              const [alertContent, setAlertContent] = useState('');

              Function resolveLandingPageLinks has 127 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

                File ComboBox.jsx has 378 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                // Description: ComboBox component for the disability benefits form.
                import React from 'react';
                import PropTypes from 'prop-types';
                import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
                import { fullStringSimilaritySearch } from 'platform/forms-system/src/js/utilities/addDisabilitiesStringSearch';

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

                  import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                  import footerContent from '~/platform/forms/components/FormFooter';
                  import manifest from '../manifest.json';
                  import transform from './submit-transformer';
                  import getHelp from '../../shared/components/GetFormHelp';
                  Severity: Minor
                  Found in src/applications/simple-forms/21-4138/config/form.js - About 5 hrs to fix

                    File ReviewCollapsibleChapter.jsx has 377 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import get from '@department-of-veterans-affairs/platform-forms-system/get';
                    import set from '@department-of-veterans-affairs/platform-forms-system/set';
                    import { getScrollOptions } from '@department-of-veterans-affairs/platform-utilities/ui';
                    import classNames from 'classnames';
                    import uniqueId from 'lodash/uniqueId';
                    Severity: Minor
                    Found in src/applications/ask-va/components/ReviewCollapsibleChapter.jsx - About 5 hrs to fix

                      Function AppointmentMessage has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const AppointmentMessage = props => {
                        const { appointment, page } = props;
                        const { t } = useTranslation();
                      
                        const defaultMessage = t(

                        Function createFormConfig781a has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function createFormConfig781a(iterations) {
                          let configObj = {};
                          const formType = '781a';
                          for (let index = 0; index < iterations; index++) {
                            configObj = {
                        Severity: Major
                        Found in src/applications/disability-benefits/all-claims/config/781/index.js - About 5 hrs to fix

                          Function renderExtensionBeneficiaryZIP has 126 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const renderExtensionBeneficiaryZIP = () => {
                              if (!displayedInputs.beneficiaryLocationQuestion) {
                                return null;
                              }
                              const extensions = getExtensions();
                          Severity: Major
                          Found in src/applications/gi/components/profile/CalculateYourBenefitsForm.jsx - About 5 hrs to fix

                            File VitalDetails.jsx has 376 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React, { useEffect, useState, useRef, useMemo } from 'react';
                            import PropTypes from 'prop-types';
                            import { useDispatch, useSelector } from 'react-redux';
                            import { useParams } from 'react-router-dom';
                            import { chunk } from 'lodash';
                            Severity: Minor
                            Found in src/applications/mhv-medical-records/containers/VitalDetails.jsx - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language