department-of-veterans-affairs/vets-website

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

Summary

Maintainability
F
5 days
Test Coverage

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

import environment from 'platform/utilities/environment';
import footerContent from 'platform/forms/components/FormFooter';
import { scrollAndFocus } from 'platform/utilities/ui';

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

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

        veteranPersonalInfoChapter: {
          // for All flows
          title: ({ formData } = {}) =>
            formData.claimOwnership === CLAIM_OWNERSHIPS.SELF &&
            formData.claimantType === CLAIMANT_TYPES.VETERAN
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 3 other locations - About 3 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 346..362
    src/applications/simple-forms/21-10210/config/form.js on lines 363..379
    src/applications/simple-forms/21-10210/config/form.js on lines 380..396

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

        veteranIdentificationInfo: {
          // for all Flows
          title: ({ formData } = {}) =>
            formData.claimOwnership === CLAIM_OWNERSHIPS.SELF &&
            formData.claimantType === CLAIMANT_TYPES.VETERAN
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 3 other locations - About 3 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 329..345
    src/applications/simple-forms/21-10210/config/form.js on lines 363..379
    src/applications/simple-forms/21-10210/config/form.js on lines 380..396

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

        veteranMailingAddressInfo: {
          // for all Flows
          title: ({ formData } = {}) =>
            formData.claimOwnership === CLAIM_OWNERSHIPS.SELF &&
            formData.claimantType === CLAIMANT_TYPES.VETERAN
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 3 other locations - About 3 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 329..345
    src/applications/simple-forms/21-10210/config/form.js on lines 346..362
    src/applications/simple-forms/21-10210/config/form.js on lines 380..396

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

        veteranContactInfo: {
          // for all Flows
          title: ({ formData } = {}) =>
            formData.claimOwnership === CLAIM_OWNERSHIPS.SELF &&
            formData.claimantType === CLAIMANT_TYPES.VETERAN
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 3 other locations - About 3 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 329..345
    src/applications/simple-forms/21-10210/config/form.js on lines 346..362
    src/applications/simple-forms/21-10210/config/form.js on lines 363..379

    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

        claimantIdInfoChapter: {
          // for Flows 3 & 4: non-vet claimant
          title: ({ formData } = {}) =>
            formData.claimOwnership === CLAIM_OWNERSHIPS.SELF
              ? 'Your identification information'
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 2 other locations - About 3 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 235..253
    src/applications/simple-forms/21-10210/config/form.js on lines 292..310

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

    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

        claimantContactInfoChapter: {
          // for Flows 3 & 4: non-vet claimant
          title: ({ formData } = {}) =>
            formData.claimOwnership === CLAIM_OWNERSHIPS.SELF
              ? 'Your contact information'
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 2 other locations - About 3 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 235..253
    src/applications/simple-forms/21-10210/config/form.js on lines 254..272

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

    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

        claimantPersonalInfoChapter: {
          // for Flows 3 & 4: non-vet claimant
          title: ({ formData } = {}) =>
            formData.claimOwnership === CLAIM_OWNERSHIPS.SELF
              ? 'Your personal information'
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 2 other locations - About 3 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 254..272
    src/applications/simple-forms/21-10210/config/form.js on lines 292..310

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

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

        statementChapterA: {
          // for Flow 2: 3rd-party claim, vet claimant
          // populates SAME statement field as the other statementChapters
          title: 'Your statement',
          pages: {
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 3 other locations - About 2 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 217..234
    src/applications/simple-forms/21-10210/config/form.js on lines 311..328
    src/applications/simple-forms/21-10210/config/form.js on lines 397..414

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

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

        statementChapterC: {
          // for Flow 3: self claim, non-vet claimant
          // populates SAME statement field as the other statementChapters
          title: 'Your statement',
          pages: {
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 3 other locations - About 2 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 198..216
    src/applications/simple-forms/21-10210/config/form.js on lines 217..234
    src/applications/simple-forms/21-10210/config/form.js on lines 397..414

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

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

        statementChapterB: {
          // for Flow 4: 3rd-party claim, not-vet claimant
          // populates SAME statement field as the other statementChapters
          title: 'Your statement',
          pages: {
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 3 other locations - About 2 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 198..216
    src/applications/simple-forms/21-10210/config/form.js on lines 311..328
    src/applications/simple-forms/21-10210/config/form.js on lines 397..414

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

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

        statementChapterD: {
          // for Flow 1: self claim, vet claimant
          // populates SAME statement field as the other statementChapters
          title: 'Your statement',
          pages: {
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 3 other locations - About 2 hrs to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 198..216
    src/applications/simple-forms/21-10210/config/form.js on lines 217..234
    src/applications/simple-forms/21-10210/config/form.js on lines 311..328

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

    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

            witnessPersInfoPageA: {
              // for Flow 2: 3rd-party claim, vet claimant
              path: 'witness-personal-information-a',
              title: 'Name and relationship',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 1 other location - About 1 hr to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 160..171

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

    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

            witnessPersInfoPageB: {
              // for Flow 2: 3rd-party claim, non-vet claimant
              path: 'witness-personal-information-b',
              title: 'Name and relationship',
              depends: {
    Severity: Major
    Found in src/applications/simple-forms/21-10210/config/form.js and 1 other location - About 1 hr to fix
    src/applications/simple-forms/21-10210/config/form.js on lines 148..159

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

    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