department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

Function parseLabsAndTests has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
Open

export const parseLabsAndTests = records => {
  return `
${txtLine}
1) Lab and test results

Severity: Minor
Found in src/applications/mhv-medical-records/util/txtHelpers/labsAndTests.js - About 1 day 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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

      <va-process-list uswds>
        <va-process-list-item header="Check to be sure you can request a Board Appeal">
          {filingDeadlineContent}
          <p>You can request a Board Appeal for these claim decisions:</p>
          <ul>
src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/IntroductionPage.jsx on lines 63..109

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 300.

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

      <va-process-list uswds>
        <va-process-list-item header="Check to be sure you can request a Board Appeal">
          {filingDeadlineContent}
          <p>You can request a Board Appeal for these claim decisions:</p>
          <ul>
src/applications/appeals/10182/containers/IntroductionPage.jsx on lines 60..106

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 300.

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

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

const SearchControls = props => {
  const {
    currentQuery,
    onChange,
    onSubmit,
Severity: Major
Found in src/applications/facility-locator/components/SearchControls.jsx - About 1 day to fix

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

    export const IdentityVerificationAlert = ({ onVerify }) => (
      <va-alert
        status="continue"
        class="vads-u-margin-y--4"
        data-testid="ezr-identity-alert"
    src/applications/_mock-form-ae-design-patterns/shared/components/alerts/IdentityVerificationAlert.jsx on lines 6..51

    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 297.

    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 2 locations. Consider refactoring.
    Open

    export const IdentityVerificationAlert = ({ onVerify }) => (
      <va-alert
        status="continue"
        class="vads-u-margin-y--4"
        data-testid="ezr-identity-alert"
    src/applications/ezr/components/FormAlerts/IdentityVerificationAlert.jsx on lines 6..51

    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 297.

    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

    Function IntroductionPage has 327 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const IntroductionPage = props => {
      const { route, toggleLoginModal, loggedIn } = props;
      const { formConfig, pageList, pathname, formData } = route;
      const [inquiryData, setInquiryData] = useState(false);
      const [searchReferenceNumber, setSearchReferenceNumber] = useState('');
    Severity: Major
    Found in src/applications/ask-va/containers/IntroductionPage.jsx - About 1 day to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      export const uiSchema = {
        stepChildren: {
          'ui:options': {
            itemName: 'Stepchild',
            viewField: StepchildInfo,
      src/applications/disability-benefits/686c-674-v2/config/chapters/stepchild-no-longer-part-of-household/stepchild-information/stepchild-information.js on lines 23..92

      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 294.

      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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      export const uiSchema = {
        stepChildren: {
          'ui:options': {
            itemName: 'Stepchild',
            viewField: StepchildInfo,
      src/applications/disability-benefits/686c-674/config/chapters/stepchild-no-longer-part-of-household/stepchild-information/stepchild-information.js on lines 23..92

      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 294.

      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

      Function StatusDropdown has 323 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const StatusDropdown = props => {
        const { status } = props;
      
        const content = () => {
          switch (status) {
      Severity: Major
      Found in src/applications/mhv-medications/components/shared/StatusDropdown.jsx - About 1 day to fix

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

        module.exports = {
          base: {
            data: [
              {
                id: '',
        src/applications/_mock-form-ae-design-patterns/mocks/endpoints/status/status.js on lines 1..77
        src/applications/representative-appoint/mocks/endpoints/status/status.js on lines 1..77

        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 293.

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

        module.exports = {
          base: {
            data: [
              {
                id: '',
        src/applications/personalization/profile/mocks/endpoints/status/status.js on lines 1..77
        src/applications/representative-appoint/mocks/endpoints/status/status.js on lines 1..77

        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 293.

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

        module.exports = {
          base: {
            data: [
              {
                id: '',
        src/applications/_mock-form-ae-design-patterns/mocks/endpoints/status/status.js on lines 1..77
        src/applications/personalization/profile/mocks/endpoints/status/status.js on lines 1..77

        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 293.

        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 2 locations. Consider refactoring.
        Open

        export default {
          uiSchema: {
            ...titleUI(
              replaceStrValues(content['household-veteran-income-title'], LAST_YEAR),
            ),
        src/applications/ezr/config/chapters/householdInformation/spouseAnnualIncome.js on lines 20..93

        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 293.

        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 2 locations. Consider refactoring.
        Open

        export default {
          uiSchema: {
            ...titleUI(
              replaceStrValues(content['household-spouse-income-title'], LAST_YEAR),
            ),
        src/applications/ezr/config/chapters/householdInformation/veteranAnnualIncome.js on lines 20..93

        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 293.

        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

        File polyfill-timezone-data.js has 704 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Everything in here is copied from @formatjs/intl-datetimeformat (add-all-tz
         * and locale-data/en) and pared down as small as possible (in theory).
         */
        
        
        Severity: Major
        Found in src/platform/polyfills/polyfill-timezone-data.js - About 1 day to fix

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

          import React from 'react';
          import * as Sentry from '@sentry/browser';
          
          import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
          import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/exports';
          Severity: Major
          Found in src/applications/claims-status/actions/index.js - About 1 day to fix

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

              constructor(props) {
                super(props);
                // Throw an error if there’s no viewComponent (should be React component)
                if (
                  !isReactComponent(get('ui:options.viewComponent', this.props.uiSchema))
            src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 48..92

            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 292.

            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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

              constructor(props) {
                super(props);
                // Throw an error if there’s no viewComponent (should be React component)
                if (
                  !isReactComponent(get('ui:options.viewComponent', this.props.uiSchema))
            src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 48..92

            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 292.

            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

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

            import fullSchema from 'vets-json-schema/dist/21-526EZ-ALLCLAIMS-schema.json';
            
            import environment from '@department-of-veterans-affairs/platform-utilities/environment';
            
            import FormFooter from '@department-of-veterans-affairs/platform-forms/FormFooter';
            Severity: Major
            Found in src/applications/disability-benefits/all-claims/config/form.js - About 1 day to fix
              Severity
              Category
              Status
              Source
              Language