department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function RegisterFailed has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const RegisterFailed = () => {
  const content = {
    heading: 'We couldn’t create a MyHealtheVet account for you',
    alertText: (
      <>

    Function getTravelMessage has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const getTravelMessage = () => {
        if (
          form.data['travel-question'] === 'no' ||
          !isTravelReimbursementEnabled
        ) {
    Severity: Major
    Found in src/applications/check-in/day-of/pages/Error.jsx - About 2 hrs to fix

      Function DraftSavedInfo has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const DraftSavedInfo = props => {
        const { messageId, drafts } = props;
      
        const threadDetails = useSelector(state => state.sm.threadDetails);
      
      

        Function fetchResultsThunk has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const fetchResultsThunk = (options = {}) => async dispatch => {
          // Derive options properties.
          const city = options?.city || null;
          const contributionAmount = options?.contributionAmount || null;
          const hideFetchingState = options?.hideFetchingState;
        Severity: Major
        Found in src/applications/yellow-ribbon/actions/index.js - About 2 hrs to fix

          Function claimsReducer has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function claimsReducer(state = initialState, action) {
            switch (action.type) {
              case FETCH_CLAIMS_PENDING:
                return set(state, true, 'claimsLoading');
              case FETCH_CLAIMS_SUCCESS:
          Severity: Major
          Found in src/applications/personalization/dashboard/reducers/claims.js - About 2 hrs to fix

            Function arrayBuilderYesNoUI has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            export const arrayBuilderYesNoUI = (
              arrayBuilderOptions,
              yesNoOptions,
              yesNoOptionsMore,
            ) => {

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

            export default function addressUiSchema(
              path = 'address',
              checkBoxTitle = 'I live on a United States military base outside of the U.S.',
              uiRequiredCallback = () => false,
              newSchemaKeys = {},
            Severity: Minor
            Found in src/platform/forms-system/src/js/definitions/profileAddress.js - About 2 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 getNonArraySchema has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            export function getNonArraySchema(schema, uiSchema = {}) {
              if (
                schema.type === 'array' &&
                !get('ui:options.keepInPageOnReview', uiSchema)
              ) {
            Severity: Minor
            Found in src/platform/forms-system/src/js/helpers.js - About 2 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 createStringifyFormReplacer has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            export function createStringifyFormReplacer(options) {
              const replacerFn = (key, value) => {
                if (!options?.allowPartialAddress && isPartialAddress(value)) {
                  return undefined;
                }
            Severity: Minor
            Found in src/platform/forms-system/src/js/helpers.js - About 2 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 Balances has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            const Balances = () => {
              // get balances from redux
              const { debtLetters, mcp } = useSelector(
                ({ combinedPortal }) => combinedPortal,
              );

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

            const validateLogin = async (
              lastName,
              dob,
              dobError,
              setLastNameError,
            Severity: Minor
            Found in src/applications/check-in/utils/validateVeteran/index.js - About 2 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 MoveMessageToFolderBtn has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            const MoveMessageToFolderBtn = props => {
              const {
                threadId,
                allFolders,
                isVisible,

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

            const FilterBox = forwardRef((props, ref) => {
              const {
                category,
                setCategory,
                dateRange,
            Severity: Minor
            Found in src/applications/mhv-secure-messaging/components/Search/FilterBox.jsx - About 2 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 uiSchema has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            export function uiSchema(
              label = 'Address',
              useStreet3 = false,
              isRequired = null,
              ignoreRequired = false,
            Severity: Minor
            Found in src/applications/pre-need-integration/definitions/address.js - About 2 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 SuggestedAddress has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            const SuggestedAddress = ({
              formData,
              address,
              handleAddNewClick,
              setAddressToUI,

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

            export default function NextStepsPage() {
              const { data: formData } = useSelector(state => state.form);
              const repType =
                formData['view:selectedRepresentative'].attributes?.individualType;
              const address = {
            Severity: Minor
            Found in src/applications/representative-appoint/containers/NextStepsPage.jsx - About 2 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 VaPrescription has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

            const VaPrescription = prescription => {
              const showRefillContent = useSelector(selectRefillContentFlag);
              const isDisplayingDocumentation = useSelector(
                state =>
                  state.featureToggles[

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

            const FORCE_OPTION = { force: true };
            const DELAY_OPTION = { force: true, delay: 100 };
            
            Cypress.Commands.add('selectVaButtonPairPrimary', field => {
              const selector = `va-button-pair${field ? `[name="${field}"]` : ''}`;
            Severity: Minor
            Found in src/platform/testing/e2e/cypress/support/commands/webComponents.js - About 2 hrs to fix

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

              const all = {
                resourceType: 'Bundle',
                id: '27b154d8-18c6-41b3-a988-8474bacd19a8',
                meta: {
                  lastUpdated: '2023-09-29T11:04:31.316-04:00',
              Severity: Minor
              Found in src/platform/mhv/api/mocks/medical-records/health-conditions/index.js - About 2 hrs to fix

                File EvidenceVaRecords.jsx has 281 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useState, useEffect } from 'react';
                import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
                
                import { EVIDENCE_VA_PATH } from '../constants';
                import { content } from '../content/evidenceVaRecords';
                Severity: Minor
                Found in src/applications/appeals/testing/sc/components/EvidenceVaRecords.jsx - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language