department-of-veterans-affairs/vets-website

View on GitHub
src/applications/pensions/components/FormAlerts/index.jsx

Summary

Maintainability
D
2 days
Test Coverage

File index.jsx has 314 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import PropTypes from 'prop-types';

export const AssetInformationAlert = () => (
  <va-additional-info trigger="How we define assets">
Severity: Minor
Found in src/applications/pensions/components/FormAlerts/index.jsx - About 3 hrs to fix

    Function TotalNetWorthOverTwentyFiveThousandAlert has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const TotalNetWorthOverTwentyFiveThousandAlert = () => {
      const linkText = 'Get VA Form 21P-0969 to download (opens in new tab)';
      return (
        <va-alert status="warning">
          <p className="vads-u-margin-y--0">
    Severity: Minor
    Found in src/applications/pensions/components/FormAlerts/index.jsx - About 1 hr to fix

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

          <va-accordion-item header="What we consider an asset">
            <p>
              Assets include the fair market value of all the real and personal
              property that you own, minus the amount of any mortgages you have. "Real
              property" is the land and buildings you own. And "personal property" is
      Severity: Major
      Found in src/applications/pensions/components/FormAlerts/index.jsx and 1 other location - About 4 hrs to fix
      src/applications/appeals/996/content/Authorization.jsx on lines 4..43

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

      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-alert status="warning">
            <p className="vads-u-margin-y--0">
              You’ll need to submit an {title} ({formName}
              ).
            </p>
      Severity: Major
      Found in src/applications/pensions/components/FormAlerts/index.jsx and 1 other location - About 3 hrs to fix
      src/applications/income-and-asset-statement/components/FormAlerts/index.jsx on lines 7..27

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

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

        <va-additional-info trigger="How to tell if you transferred assets">
          <p>You transferred assets if you made any of these transactions:</p>
          <ul>
            <li>You gave away money or property</li>
            <li>You sold a home that isn’t your primary residence</li>
      Severity: Major
      Found in src/applications/pensions/components/FormAlerts/index.jsx and 2 other locations - About 3 hrs to fix
      src/applications/ds-playground/pages/V1V3Page.jsx on lines 751..759
      src/applications/toe/components/confirmation/UnderReviewConfirmation.jsx on lines 105..118

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

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

            <ul>
              <li>
                They’re under 18 years old, <strong>or</strong>
              </li>
              <li>
      Severity: Major
      Found in src/applications/pensions/components/FormAlerts/index.jsx and 8 other locations - About 2 hrs to fix
      src/applications/combined-debt-portal/debt-letters/components/NeedHelp.jsx on lines 17..26
      src/applications/hca/components/IntroductionPage/GetStarted/ProcessTimeline.jsx on lines 34..46
      src/applications/ivc-champva/10-10D/components/Applicant/applicantFileUpload.js on lines 34..42
      src/applications/ivc-champva/10-10D/components/Applicant/applicantFileUpload.js on lines 49..57
      src/applications/ivc-champva/10-7959C/chapters/medicareInformation.js on lines 228..236
      src/applications/static-pages/health-care-manage-benefits/schedule-view-va-appointments-page/components/AuthContent/index.js on lines 78..87
      src/applications/static-pages/health-care-manage-benefits/schedule-view-va-appointments-page/components/UnauthContent/index.js on lines 49..58
      src/applications/veteran-id-card/containers/Main.jsx on lines 107..120

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

      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 SubmissionConfirmationAlert = () => (
        <va-alert status="success">
          <h3>Thank you for submitting your Veterans Pension application</h3>
          <p className="vads-u-margin-y--0">
            We’ve received your Veterans Pension application (VA Form 21P-527EZ).
      Severity: Major
      Found in src/applications/pensions/components/FormAlerts/index.jsx and 1 other location - About 1 hr to fix
      src/applications/claims-status/components/appeals-v2/AppealNotFound.jsx on lines 4..9

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

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

      export const AdoptionEvidenceAlert = () => (
        <va-alert status="warning">
          <p className="vads-u-margin-y--0">
            You’ll need to submit adoption papers or amended birth certificate with
            this application.
      Severity: Minor
      Found in src/applications/pensions/components/FormAlerts/index.jsx and 2 other locations - About 35 mins to fix
      src/applications/pensions/components/FormAlerts/index.jsx on lines 106..113
      src/applications/pensions/components/FormAlerts/index.jsx on lines 148..154

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

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

      export const DisabilityDocsAlert = () => (
        <va-alert status="warning">
          <p className="vads-u-margin-y--0">
            You’ll need to provide all private medical records for your child’s
            disability.
      Severity: Minor
      Found in src/applications/pensions/components/FormAlerts/index.jsx and 2 other locations - About 35 mins to fix
      src/applications/pensions/components/FormAlerts/index.jsx on lines 148..154
      src/applications/pensions/components/FormAlerts/index.jsx on lines 318..325

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

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

      export const MedicalEvidenceAlert = () => (
        <va-alert status="warning">
          <p className="vads-u-margin-y--0">
            You’ll need to provide medical evidence with this application.
          </p>
      Severity: Minor
      Found in src/applications/pensions/components/FormAlerts/index.jsx and 2 other locations - About 35 mins to fix
      src/applications/pensions/components/FormAlerts/index.jsx on lines 106..113
      src/applications/pensions/components/FormAlerts/index.jsx on lines 318..325

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

      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

      There are no issues that match your filters.

      Category
      Status