department-of-veterans-affairs/vets-website

View on GitHub
src/applications/simple-forms/20-10206/config/form.js

Summary

Maintainability
D
2 days
Test Coverage

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

import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import footerContent from 'platform/forms/components/FormFooter';
import getHelp from '../../shared/components/GetFormHelp';

import manifest from '../manifest.json';
Severity: Minor
Found in src/applications/simple-forms/20-10206/config/form.js - About 2 hrs to fix

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

        disabilityExamDetailsChapter: {
          title: 'Disability exam details',
          pages: {
            disabilityExamDetailsPage: {
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 2 other locations - About 2 hrs to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 211..227
    src/applications/simple-forms/20-10206/config/form.js on lines 228..244

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

        otherCompensationAndPensionDetailsChapter: {
          title: 'Compensation and/or pension details',
          pages: {
            otherCompensationAndPensionDetailsPage: {
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 2 other locations - About 2 hrs to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 177..193
    src/applications/simple-forms/20-10206/config/form.js on lines 211..227

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

        lifeInsuranceBenefitDetailsChapter: {
          title: 'Life insurance benefit details',
          pages: {
            lifeInsuranceBenefitDetailsPage: {
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 2 other locations - About 2 hrs to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 177..193
    src/applications/simple-forms/20-10206/config/form.js on lines 228..244

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

        contactInformationChapter: {
          title: 'Your contact information',
          pages: {
            phoneEmailPage: {
              path: 'phone-email',
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 5 other locations - About 1 hr to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 104..115
    src/applications/simple-forms/20-10206/config/form.js on lines 141..152
    src/applications/simple-forms/20-10206/config/form.js on lines 165..176
    src/applications/simple-forms/20-10206/config/form.js on lines 263..274
    src/applications/simple-forms/20-10206/config/form.js on lines 275..286

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

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

        additionalInformationChapter: {
          title: 'Additional information',
          pages: {
            additionalRecordsInformationPage: {
              path: 'additional-records-information',
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 5 other locations - About 1 hr to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 104..115
    src/applications/simple-forms/20-10206/config/form.js on lines 141..152
    src/applications/simple-forms/20-10206/config/form.js on lines 153..164
    src/applications/simple-forms/20-10206/config/form.js on lines 165..176
    src/applications/simple-forms/20-10206/config/form.js on lines 275..286

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

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

        mailingAddressChapter: {
          title: 'Your mailing address',
          pages: {
            addressPage: {
              path: 'contact-information',
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 5 other locations - About 1 hr to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 104..115
    src/applications/simple-forms/20-10206/config/form.js on lines 153..164
    src/applications/simple-forms/20-10206/config/form.js on lines 165..176
    src/applications/simple-forms/20-10206/config/form.js on lines 263..274
    src/applications/simple-forms/20-10206/config/form.js on lines 275..286

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

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

        personalInformationChapter: {
          title: 'Your name and date of birth',
          pages: {
            personalInfoPage: {
              path: 'personal-information',
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 5 other locations - About 1 hr to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 141..152
    src/applications/simple-forms/20-10206/config/form.js on lines 153..164
    src/applications/simple-forms/20-10206/config/form.js on lines 165..176
    src/applications/simple-forms/20-10206/config/form.js on lines 263..274
    src/applications/simple-forms/20-10206/config/form.js on lines 275..286

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

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

        vaRegionalOfficeChapter: {
          title: 'VA regional office',
          pages: {
            associatedVARegionalOfficePage: {
              path: 'associated-va-regional-office',
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 5 other locations - About 1 hr to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 104..115
    src/applications/simple-forms/20-10206/config/form.js on lines 141..152
    src/applications/simple-forms/20-10206/config/form.js on lines 153..164
    src/applications/simple-forms/20-10206/config/form.js on lines 165..176
    src/applications/simple-forms/20-10206/config/form.js on lines 263..274

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

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

        recordsChapter: {
          title: 'Records',
          pages: {
            recordSelectionsPage: {
              path: 'record-selections',
    Severity: Major
    Found in src/applications/simple-forms/20-10206/config/form.js and 5 other locations - About 1 hr to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 104..115
    src/applications/simple-forms/20-10206/config/form.js on lines 141..152
    src/applications/simple-forms/20-10206/config/form.js on lines 153..164
    src/applications/simple-forms/20-10206/config/form.js on lines 263..274
    src/applications/simple-forms/20-10206/config/form.js on lines 275..286

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

    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

            nonCitizenIdentificationInfoPage: {
              depends: {
                preparerType: PREPARER_TYPES.NON_CITIZEN,
              },
              path: 'non-citizen-identification-information',
    Severity: Minor
    Found in src/applications/simple-forms/20-10206/config/form.js and 1 other location - About 55 mins to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 119..128

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

    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

            citizenIdentificationInfoPage: {
              depends: {
                preparerType: PREPARER_TYPES.CITIZEN,
              },
              path: 'citizen-identification-information',
    Severity: Minor
    Found in src/applications/simple-forms/20-10206/config/form.js and 1 other location - About 55 mins to fix
    src/applications/simple-forms/20-10206/config/form.js on lines 129..138

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

    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