department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

Function makeUserObject has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function makeUserObject(options = {}) {
  const services = options.services || ['vet360'];
  let claims = {
    ch33_bank_accounts: true,
    communication_preferences: true,
Severity: Major
Found in src/applications/personalization/common/helpers.js - About 2 hrs to fix

    Function AllergyListItem has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const AllergyListItem = props => {
      const { record } = props;
    
      return (
        <va-card

      Function generate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      const generate = async data => {
        validate(data);
        const tocPageData = {};
        const doc = createAccessibleDoc(data, config);
      
      
      Severity: Minor
      Found in src/platform/pdf/templates/blue_button_report.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 PreSubmitSection has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      export function PreSubmitSection(props) {
        const {
          form,
          preSubmit = {},
          setPreSubmit,
      Severity: Minor
      Found in src/platform/forms/components/review/PreSubmitSection.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 ReviewFieldTemplate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function ReviewFieldTemplate(props) {
        const { children, uiSchema, schema, formContext } = props;
        const label = uiSchema['ui:title'] || props.label;
        const description = uiSchema['ui:description'];
        const textDescription = typeof description === 'string' ? description : null;
      Severity: Minor
      Found in src/platform/forms-system/src/js/review/ReviewFieldTemplate.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 updateSchemaFromUiSchema has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      export function updateSchemaFromUiSchema(
        schema,
        uiSchema,
        formData,
        index = null,
      Severity: Minor
      Found in src/platform/forms-system/src/js/state/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 AuthApp has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function AuthApp({ location }) {
        const [
          { auth, errorCode, returnUrl, loginType, state, requestId },
          setAuthState,
        ] = useState({
      Severity: Minor
      Found in src/applications/auth/containers/AuthApp.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 ApplicantRelationshipPage has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function ApplicantRelationshipPage({
        data,
        genOp,
        setFormData,
        goBack,

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

      export const SearchResultsHeader = props => {
        const { searchResults, pagination, query } = props;
        const {
          inProgress,
          context,

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

      const BDDPage = ({ setPageState, state = '' }) => {
        const [ariaDescribedby, setAriaDescribedby] = useState('');
        const [isDirty, setIsDirty] = useState(false);
        const [errorMessage, setErrorMessage] = useState(null);
      
      
      Severity: Minor
      Found in src/applications/disability-benefits/wizard/pages/bdd.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 BankruptcyDetails has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      const BankruptcyDetails = ({
        data,
        goBack,
        goForward,
        setFormData,

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

      const ContactInfo = ({
        data,
        goBack,
        goForward,
        onReviewPage,

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

      export default function RecentActivity({ claim }) {
        const { TOGGLE_NAMES, useToggleValue } = useFeatureToggle();
        const cst5103UpdateEnabled = useToggleValue(
          TOGGLE_NAMES.cst5103UpdateEnabled,
        );

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

      const SearchBenefits = ({
        cumulativeService,
        dispatchShowModal,
        eligForPostGiBill,
        enlistmentService,
      Severity: Minor
      Found in src/applications/gi/components/SearchBenefits.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

      File ToeApp.jsx has 288 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useEffect, useState } from 'react';
      import { connect } from 'react-redux';
      import { isArray } from 'lodash';
      import PropTypes from 'prop-types';
      import { VaBreadcrumbs } from '@department-of-veterans-affairs/web-components/react-bindings';
      Severity: Minor
      Found in src/applications/toe/containers/ToeApp.jsx - About 2 hrs to fix

        File pdfAddress.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // pdf-address.js
        // customized version of src/platform/forms/definitions/address.js,
        // with support added for PDF-specific maxLengths [street, street2, & city].
        import { createSelector } from 'reselect';
        import {
        Severity: Minor
        Found in src/applications/simple-forms/shared/definitions/pdfAddress.js - About 2 hrs to fix

          Similar blocks of code found in 13 locations. Consider refactoring.
          Open

          InsuranceSummary.propTypes = {
            contentAfterButtons: PropTypes.element,
            contentBeforeButtons: PropTypes.element,
            data: PropTypes.object,
            goBack: PropTypes.func,
          src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/DependentSummary.jsx on lines 147..157
          src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/InsuranceSummary.jsx on lines 159..169
          src/applications/check-in/components/pages/validate/ValidateDisplay.jsx on lines 166..176
          src/applications/ezr/components/FormPages/DependentSummary.jsx on lines 144..154
          src/applications/facility-locator/components/ResultsList.jsx on lines 267..277
          src/applications/hca/components/FormPages/DependentSummary.jsx on lines 142..152
          src/applications/mhv-secure-messaging/components/MessageActionButtons.jsx on lines 96..106
          src/applications/personalization/view-dependents/components/ViewDependentsList/ViewDependentsListItem.jsx on lines 127..137
          src/applications/representative-search/components/search/SearchControls.jsx on lines 289..299
          src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderList.jsx on lines 234..244
          src/applications/verify-your-enrollment/containers/VerificationReviewWrapper.jsx on lines 243..253
          src/applications/check-in/components/ExternalLink.jsx on lines 50..60

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 93.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 13 locations. Consider refactoring.
          Open

          ExternalLink.propTypes = {
            children: PropTypes.node,
            className: PropTypes.string,
            dataTestId: PropTypes.string,
            eventId: PropTypes.string,
          Severity: Major
          Found in src/applications/check-in/components/ExternalLink.jsx and 12 other locations - About 2 hrs to fix
          src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/DependentSummary.jsx on lines 147..157
          src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/InsuranceSummary.jsx on lines 159..169
          src/applications/check-in/components/pages/validate/ValidateDisplay.jsx on lines 166..176
          src/applications/ezr/components/FormPages/DependentSummary.jsx on lines 144..154
          src/applications/ezr/components/FormPages/InsuranceSummary.jsx on lines 155..165
          src/applications/facility-locator/components/ResultsList.jsx on lines 267..277
          src/applications/hca/components/FormPages/DependentSummary.jsx on lines 142..152
          src/applications/mhv-secure-messaging/components/MessageActionButtons.jsx on lines 96..106
          src/applications/personalization/view-dependents/components/ViewDependentsList/ViewDependentsListItem.jsx on lines 127..137
          src/applications/representative-search/components/search/SearchControls.jsx on lines 289..299
          src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderList.jsx on lines 234..244
          src/applications/verify-your-enrollment/containers/VerificationReviewWrapper.jsx on lines 243..253

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 93.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 13 locations. Consider refactoring.
          Open

          DependentSummary.propTypes = {
            contentAfterButtons: PropTypes.element,
            contentBeforeButtons: PropTypes.element,
            data: PropTypes.object,
            goBack: PropTypes.func,
          src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/InsuranceSummary.jsx on lines 159..169
          src/applications/check-in/components/pages/validate/ValidateDisplay.jsx on lines 166..176
          src/applications/ezr/components/FormPages/DependentSummary.jsx on lines 144..154
          src/applications/ezr/components/FormPages/InsuranceSummary.jsx on lines 155..165
          src/applications/facility-locator/components/ResultsList.jsx on lines 267..277
          src/applications/hca/components/FormPages/DependentSummary.jsx on lines 142..152
          src/applications/mhv-secure-messaging/components/MessageActionButtons.jsx on lines 96..106
          src/applications/personalization/view-dependents/components/ViewDependentsList/ViewDependentsListItem.jsx on lines 127..137
          src/applications/representative-search/components/search/SearchControls.jsx on lines 289..299
          src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderList.jsx on lines 234..244
          src/applications/verify-your-enrollment/containers/VerificationReviewWrapper.jsx on lines 243..253
          src/applications/check-in/components/ExternalLink.jsx on lines 50..60

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 93.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 13 locations. Consider refactoring.
          Open

          ViewDependentsListItem.propTypes = {
            dateOfBirth: PropTypes.string,
            firstName: PropTypes.string,
            lastName: PropTypes.string,
            manageDependentsToggle: PropTypes.bool,
          src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/DependentSummary.jsx on lines 147..157
          src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/InsuranceSummary.jsx on lines 159..169
          src/applications/check-in/components/pages/validate/ValidateDisplay.jsx on lines 166..176
          src/applications/ezr/components/FormPages/DependentSummary.jsx on lines 144..154
          src/applications/ezr/components/FormPages/InsuranceSummary.jsx on lines 155..165
          src/applications/facility-locator/components/ResultsList.jsx on lines 267..277
          src/applications/hca/components/FormPages/DependentSummary.jsx on lines 142..152
          src/applications/mhv-secure-messaging/components/MessageActionButtons.jsx on lines 96..106
          src/applications/representative-search/components/search/SearchControls.jsx on lines 289..299
          src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderList.jsx on lines 234..244
          src/applications/verify-your-enrollment/containers/VerificationReviewWrapper.jsx on lines 243..253
          src/applications/check-in/components/ExternalLink.jsx on lines 50..60

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 93.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language