department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function updateRequiredFields has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

export function updateRequiredFields(schema, uiSchema, formData, index = null) {
  if (!uiSchema) {
    return schema;
  }

Severity: Minor
Found in src/platform/forms-system/src/js/state/helpers.js - About 4 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 a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const { location } = this.props;

    if (!location) {
      return null;
Severity: Minor
Found in src/applications/facility-locator/components/AppointmentInfo.jsx - About 4 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 Dropdown has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

const Dropdown = ({
  shortName,
  router,
  formResponses,
  formValue,

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

function nextQuestion(currentQuestion, answer, state) {
  let next;
  const noGeneralCourtMartial = ['2', '3'].includes(state['7_courtMartial']);
  const dischargeYear = state['2_dischargeYear'];
  const dischargeMonth = state['3_dischargeMonth'] || 1;
Severity: Minor
Found in src/applications/discharge-wizard/reducers/discharge-wizard.js - About 4 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 RadioGroup has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

const RadioGroup = ({
  formError,
  formResponses,
  formValue,
  hint,

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

const ProfilePageHeader = ({
  compare,
  dispatchAddCompareInstitution,
  dispatchRemoveCompareInstitution,
  institution,
Severity: Minor
Found in src/applications/gi/containers/ProfilePageHeader.jsx - About 4 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 getDerivedAttributes has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

export function getDerivedAttributes(constant, eligibility, institution) {
  const your = eligibility;
  const its = institution;
  const chapter = Number(your.giBillChapter);
  let monthlyRate;
Severity: Minor
Found in src/applications/gi/selectors/estimator.js - About 4 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 NewRecordsIndicator has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

const NewRecordsIndicator = ({
  refreshState,
  extractType,
  newRecordsFound,
  reloadFunction,

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 helpers.js has 357 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import moment from 'moment-timezone';
import DOMPurify from 'dompurify';
import {
  DefaultFolders as Folders,
  Paths,
Severity: Minor
Found in src/applications/mhv-secure-messaging/util/helpers.js - About 4 hrs to fix

    Function SearchQueryReducer has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const SearchQueryReducer = (state = INITIAL_STATE, action) => {
      switch (action.type) {
        case SEARCH_STARTED:
          return {
            ...state,
    Severity: Major
    Found in src/applications/facility-locator/reducers/searchQuery.js - About 4 hrs to fix

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

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

        File SearchControls.jsx has 356 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useEffect, useRef, useState } from 'react';
        import recordEvent from 'platform/monitoring/record-event';
        import { focusElement } from 'platform/utilities/ui';
        import classNames from 'classnames';
        import {
        Severity: Minor
        Found in src/applications/facility-locator/components/SearchControls.jsx - About 4 hrs to fix

          File medicareInformation.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import {
            titleUI,
            titleSchema,
            textUI,
          Severity: Minor
          Found in src/applications/ivc-champva/10-7959C/chapters/medicareInformation.js - About 4 hrs to fix

            File MissingFileOverview.jsx has 356 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
            OVERVIEW:
            The MissingFileOverview component is responsible for tracking file uploads
            within the form and displaying a message to the user indicating which files
            they have yet to upload before the application is considered complete. 

              File confirmation-page.jsx has 356 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              
              import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
              
              import DownloadPDF from '../components/DownloadPDF';

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

                import { VA_FORM_IDS } from 'platform/forms/constants';
                
                import preSubmitInfo from 'platform/forms/preSubmitInfo';
                import FormFooter from 'platform/forms/components/FormFooter';
                import { externalServices as services } from 'platform/monitoring/DowntimeNotification';
                Severity: Minor
                Found in src/applications/appeals/testing/sc/config/form.js - About 4 hrs to fix

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

                  import environment from 'platform/utilities/environment';
                  import commonDefinitions from 'vets-json-schema/dist/definitions.json';
                  import { arrayBuilderPages } from 'platform/forms-system/src/js/patterns/array-builder';
                  import manifest from '../manifest.json';
                  import IntroductionPage from '../containers/IntroductionPage';

                    File selectors.js has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { selectVAPResidentialAddress } from 'platform/user/selectors';
                    
                    import {
                      getTimezoneByFacilityId,
                      getTimezoneDescByFacilityId,
                    Severity: Minor
                    Found in src/applications/vaos/new-appointment/redux/selectors.js - About 4 hrs to fix

                      File ConfirmationPage.jsx has 354 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import PropTypes from 'prop-types';
                      import { connect, useSelector } from 'react-redux';
                      
                      import { ConfirmationView } from 'platform/forms-system/src/js/components/ConfirmationView';
                      Severity: Minor
                      Found in src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx - About 4 hrs to fix

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

                        import footerContent from 'platform/forms/components/FormFooter';
                        import { externalServices } from 'platform/monitoring/DowntimeNotification';
                        import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                        import manifest from '../manifest.json';
                        
                        
                        Severity: Minor
                        Found in src/applications/simple-forms/21-0966/config/form.js - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language