department-of-veterans-affairs/vets-website

View on GitHub
src/applications/pensions/components/IntroductionPage.jsx

Summary

Maintainability
D
2 days
Test Coverage

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

const IntroductionPage = props => {
  const { route } = props;
  const { formConfig, pageList } = route;
  const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();

Severity: Major
Found in src/applications/pensions/components/IntroductionPage.jsx - About 1 day to fix

    File IntroductionPage.jsx has 297 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useEffect } from 'react';
    import PropTypes from 'prop-types';
    
    import { focusElement } from 'platform/utilities/ui';
    import FormTitle from 'platform/forms-system/src/js/components/FormTitle';
    Severity: Minor
    Found in src/applications/pensions/components/IntroductionPage.jsx - About 3 hrs to fix

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

                    <ul>
                      <li>
                        Examination for Housebound Status or Permanent Need for
                        Regular Aid and Attendance (
                        <va-link
      Severity: Major
      Found in src/applications/pensions/components/IntroductionPage.jsx and 1 other location - About 5 hrs to fix
      src/applications/search/containers/SearchApp.jsx on lines 794..816

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

      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

        route: PropTypes.shape({
          formConfig: PropTypes.shape({
            prefillEnabled: PropTypes.bool,
            savedFormMessages: PropTypes.object,
            title: PropTypes.string,
      Severity: Major
      Found in src/applications/pensions/components/IntroductionPage.jsx and 1 other location - About 2 hrs to fix
      src/applications/accredited-representative-portal/accreditation/21a/containers/IntroductionPage.jsx on lines 164..172

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

      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-process-list-item header="Check your eligibility">
                <p className="vads-u-margin-y--1">
                  Check our eligibility requirements before you apply. If you think
                  you may be eligible, but you’re not sure, we encourage you to apply.
                </p>
      Severity: Major
      Found in src/applications/pensions/components/IntroductionPage.jsx and 2 other locations - About 55 mins to fix
      src/applications/burials-ez/components/IntroductionPage.jsx on lines 23..31
      src/applications/personalization/dashboard/components/debts/Debts.jsx on lines 91..99

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

      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