department-of-veterans-affairs/vets-website

View on GitHub
src/applications/simple-forms/21-0845/config/form.js

Summary

Maintainability
D
2 days
Test Coverage

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

// this form does NOT use JSON schema for its data model
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import footerContent from 'platform/forms/components/FormFooter';

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

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

        veteranIdentificationInfoChapter: {
          title: ({ formData }) =>
            formData?.authorizerType === AUTHORIZER_TYPES.VETERAN
              ? 'Your identification information'
              : 'Veteran’s identification information',
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 1 other location - About 2 hrs to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 158..173

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

    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

        veteranPersonalInfoChapter: {
          title: ({ formData }) =>
            formData?.authorizerType === AUTHORIZER_TYPES.VETERAN
              ? 'Your personal information'
              : 'Veteran’s personal information',
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 1 other location - About 2 hrs to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 174..189

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

    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

        authorizerContactInfoChapter: {
          title: 'Your contact information',
          pages: {
            authContactInfoPage: {
              path: 'authorizer-contact-information',
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 1 other location - About 2 hrs to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 126..141

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

    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

        authorizerAddressChapter: {
          title: 'Your address',
          pages: {
            authAddrPage: {
              path: 'authorizer-address',
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 1 other location - About 2 hrs to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 142..157

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

    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

            limitedInformationPage: {
              // limited info-scope
              path: 'disclosure-information-limited-information',
              title: 'Limited information',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 1 other location - About 1 hr to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 112..123

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

    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

            authPersInfoPage: {
              // nonVet authorizer
              path: 'authorizer-personal-information',
              title: 'Your personal information',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 1 other location - About 1 hr to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 274..285

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

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

            organizationAddressPage: {
              // organization third-party
              path: 'disclosure-information-organization-address',
              title: 'Organization’s address',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 201..212
    src/applications/simple-forms/21-0845/config/form.js on lines 213..224
    src/applications/simple-forms/21-0845/config/form.js on lines 225..236
    src/applications/simple-forms/21-0845/config/form.js on lines 237..248

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

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

            personNamePage: {
              // person third-party
              path: 'disclosure-information-person-name',
              title: 'Person’s name',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 213..224
    src/applications/simple-forms/21-0845/config/form.js on lines 225..236
    src/applications/simple-forms/21-0845/config/form.js on lines 237..248
    src/applications/simple-forms/21-0845/config/form.js on lines 249..260

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

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

            personAddressPage: {
              // person third-party
              path: 'disclosure-information-person-address',
              title: 'Person’s address',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 201..212
    src/applications/simple-forms/21-0845/config/form.js on lines 225..236
    src/applications/simple-forms/21-0845/config/form.js on lines 237..248
    src/applications/simple-forms/21-0845/config/form.js on lines 249..260

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

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

            organizationNamePage: {
              // organization third-party
              path: 'disclosure-information-organization-name',
              title: 'Organization’s name',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 201..212
    src/applications/simple-forms/21-0845/config/form.js on lines 213..224
    src/applications/simple-forms/21-0845/config/form.js on lines 237..248
    src/applications/simple-forms/21-0845/config/form.js on lines 249..260

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

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

            organizationRepresentativesPage: {
              // organization third-party
              path: 'disclosure-information-organization-representatives',
              title: 'Organization’s representatives',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-0845/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-0845/config/form.js on lines 201..212
    src/applications/simple-forms/21-0845/config/form.js on lines 213..224
    src/applications/simple-forms/21-0845/config/form.js on lines 225..236
    src/applications/simple-forms/21-0845/config/form.js on lines 249..260

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

    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