department-of-veterans-affairs/vets-website

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

Summary

Maintainability
F
3 days
Test Coverage

File form.js has 377 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 manifest from '../manifest.json';
import transform from './submit-transformer';
import getHelp from '../../shared/components/GetFormHelp';
Severity: Minor
Found in src/applications/simple-forms/21-4138/config/form.js - About 5 hrs to fix

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

            higherLevelReviewPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.DECISION_REVIEW &&
                isEligibleForDecisionReview(formData.decisionDate) &&
                formData.decisionReviewType === DECISION_REVIEW_TYPES.ERROR_MADE,
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 1 other location - About 2 hrs to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 211..222

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

    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

            boardAppealPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.DECISION_REVIEW &&
                isEligibleForDecisionReview(formData.decisionDate) &&
                formData.decisionReviewType === DECISION_REVIEW_TYPES.BVA_REQUEST,
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 1 other location - About 2 hrs to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 199..210

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

    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

        identificationChapter: {
          title: 'Your identification information',
          pages: {
            identificationInformationPage: {
              depends: formData => isEligibleToSubmitStatement(formData),
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 308..320
    src/applications/simple-forms/21-4138/config/form.js on lines 334..346
    src/applications/simple-forms/21-4138/config/form.js on lines 347..359
    src/applications/simple-forms/21-4138/config/form.js on lines 360..372

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

    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

        statementChapter: {
          title: 'Your statement',
          pages: {
            statementPage: {
              depends: formData => isEligibleToSubmitStatement(formData),
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 308..320
    src/applications/simple-forms/21-4138/config/form.js on lines 321..333
    src/applications/simple-forms/21-4138/config/form.js on lines 334..346
    src/applications/simple-forms/21-4138/config/form.js on lines 347..359

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

    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

        personalInformationChapter: {
          title: 'Your personal information',
          pages: {
            personalInformationPage: {
              depends: formData => isEligibleToSubmitStatement(formData),
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 321..333
    src/applications/simple-forms/21-4138/config/form.js on lines 334..346
    src/applications/simple-forms/21-4138/config/form.js on lines 347..359
    src/applications/simple-forms/21-4138/config/form.js on lines 360..372

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

    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

        contactInformationChapter: {
          title: 'Your contact information',
          pages: {
            contactInformationPage: {
              depends: formData => isEligibleToSubmitStatement(formData),
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 308..320
    src/applications/simple-forms/21-4138/config/form.js on lines 321..333
    src/applications/simple-forms/21-4138/config/form.js on lines 334..346
    src/applications/simple-forms/21-4138/config/form.js on lines 360..372

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

    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

        mailingAddressChapter: {
          title: 'Your mailing address',
          pages: {
            mailingAddressPage: {
              depends: formData => isEligibleToSubmitStatement(formData),
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 308..320
    src/applications/simple-forms/21-4138/config/form.js on lines 321..333
    src/applications/simple-forms/21-4138/config/form.js on lines 347..359
    src/applications/simple-forms/21-4138/config/form.js on lines 360..372

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

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

            housingRisksPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.PRIORITY_PROCESSING,
              path: 'housing-risks',
              title:
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 6 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 144..153
    src/applications/simple-forms/21-4138/config/form.js on lines 154..163
    src/applications/simple-forms/21-4138/config/form.js on lines 223..232
    src/applications/simple-forms/21-4138/config/form.js on lines 255..264
    src/applications/simple-forms/21-4138/config/form.js on lines 286..295
    src/applications/simple-forms/21-4138/config/form.js on lines 296..305

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

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

            personalRecordsRequestPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.PERSONAL_RECORDS,
              path: 'personal-records-request',
              title: "There's a better way to request your personal records",
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 6 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 144..153
    src/applications/simple-forms/21-4138/config/form.js on lines 154..163
    src/applications/simple-forms/21-4138/config/form.js on lines 223..232
    src/applications/simple-forms/21-4138/config/form.js on lines 233..243
    src/applications/simple-forms/21-4138/config/form.js on lines 255..264
    src/applications/simple-forms/21-4138/config/form.js on lines 296..305

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

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

            decisionReviewPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.DECISION_REVIEW,
              path: 'decision-review',
              title: 'What to know before you request a decision review',
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 6 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 144..153
    src/applications/simple-forms/21-4138/config/form.js on lines 223..232
    src/applications/simple-forms/21-4138/config/form.js on lines 233..243
    src/applications/simple-forms/21-4138/config/form.js on lines 255..264
    src/applications/simple-forms/21-4138/config/form.js on lines 286..295
    src/applications/simple-forms/21-4138/config/form.js on lines 296..305

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

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

            aboutPriorityProcessingPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.PRIORITY_PROCESSING,
              path: 'about-priority-processing',
              title: 'What to know before you request priority processing',
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 6 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 144..153
    src/applications/simple-forms/21-4138/config/form.js on lines 154..163
    src/applications/simple-forms/21-4138/config/form.js on lines 233..243
    src/applications/simple-forms/21-4138/config/form.js on lines 255..264
    src/applications/simple-forms/21-4138/config/form.js on lines 286..295
    src/applications/simple-forms/21-4138/config/form.js on lines 296..305

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

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

            claimStatusToolPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.NEW_EVIDENCE,
              path: 'claim-status-tool',
              title: "There's a better way to submit new evidence",
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 6 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 144..153
    src/applications/simple-forms/21-4138/config/form.js on lines 154..163
    src/applications/simple-forms/21-4138/config/form.js on lines 223..232
    src/applications/simple-forms/21-4138/config/form.js on lines 233..243
    src/applications/simple-forms/21-4138/config/form.js on lines 255..264
    src/applications/simple-forms/21-4138/config/form.js on lines 286..295

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

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

            layWitnessStatementPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.BUDDY_STATEMENT,
              path: 'lay-witness-statement',
              title: "There's a better way to submit your statement to us",
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 6 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 154..163
    src/applications/simple-forms/21-4138/config/form.js on lines 223..232
    src/applications/simple-forms/21-4138/config/form.js on lines 233..243
    src/applications/simple-forms/21-4138/config/form.js on lines 255..264
    src/applications/simple-forms/21-4138/config/form.js on lines 286..295
    src/applications/simple-forms/21-4138/config/form.js on lines 296..305

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

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

            hardshipsPage: {
              depends: formData =>
                formData.statementType === STATEMENT_TYPES.PRIORITY_PROCESSING,
              path: 'hardships',
              title: 'Other reasons for request',
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/form.js and 6 other locations - About 1 hr to fix
    src/applications/simple-forms/21-4138/config/form.js on lines 144..153
    src/applications/simple-forms/21-4138/config/form.js on lines 154..163
    src/applications/simple-forms/21-4138/config/form.js on lines 223..232
    src/applications/simple-forms/21-4138/config/form.js on lines 233..243
    src/applications/simple-forms/21-4138/config/form.js on lines 286..295
    src/applications/simple-forms/21-4138/config/form.js on lines 296..305

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

    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