department-of-veterans-affairs/vets-website

View on GitHub
src/applications/ivc-champva/10-7959C/config/form.js

Summary

Maintainability
F
3 days
Test Coverage

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

import React from 'react';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
import get from 'platform/utilities/data/get';
import manifest from '../manifest.json';
Severity: Minor
Found in src/applications/ivc-champva/10-7959C/config/form.js - About 7 hrs to fix

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

          pages: {
            supportingFilesReview: {
              path: 'supporting-files',
              title: 'Upload your supporting files',
              depends: formData => showFileOverviewPage(formData),
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 1 other location - About 4 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 1226..1253

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

    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

            primaryEob: {
              path: 'insurance-eob',
              depends: formData =>
                get('applicantHasPrimary', formData) &&
                get('applicantPrimaryHasPrescription', formData),
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 339..349
    src/applications/ivc-champva/10-7959C/config/form.js on lines 370..380
    src/applications/ivc-champva/10-7959C/config/form.js on lines 381..391
    src/applications/ivc-champva/10-7959C/config/form.js on lines 429..439

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

    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

            secondaryComments: {
              path: 'secondary-insurance-comments',
              depends: formData =>
                get('applicantHasPrimary', formData) &&
                get('applicantHasSecondary', formData),
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 291..301
    src/applications/ivc-champva/10-7959C/config/form.js on lines 339..349
    src/applications/ivc-champva/10-7959C/config/form.js on lines 370..380
    src/applications/ivc-champva/10-7959C/config/form.js on lines 381..391

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

    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

            secondaryType: {
              path: 'secondary-insurance-plan',
              depends: formData =>
                get('applicantHasPrimary', formData) &&
                get('applicantHasSecondary', formData),
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 291..301
    src/applications/ivc-champva/10-7959C/config/form.js on lines 370..380
    src/applications/ivc-champva/10-7959C/config/form.js on lines 381..391
    src/applications/ivc-champva/10-7959C/config/form.js on lines 429..439

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

    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

            secondaryThroughEmployer: {
              path: 'secondary-insurance-type',
              depends: formData =>
                get('applicantHasPrimary', formData) &&
                get('applicantHasSecondary', formData),
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 291..301
    src/applications/ivc-champva/10-7959C/config/form.js on lines 339..349
    src/applications/ivc-champva/10-7959C/config/form.js on lines 381..391
    src/applications/ivc-champva/10-7959C/config/form.js on lines 429..439

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

    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

            secondaryPrescription: {
              path: 'secondary-insurance-prescription',
              depends: formData =>
                get('applicantHasPrimary', formData) &&
                get('applicantHasSecondary', formData),
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 4 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 291..301
    src/applications/ivc-champva/10-7959C/config/form.js on lines 339..349
    src/applications/ivc-champva/10-7959C/config/form.js on lines 370..380
    src/applications/ivc-champva/10-7959C/config/form.js on lines 429..439

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

    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

            primaryType: {
              path: 'insurance-plan',
              depends: formData => get('applicantHasPrimary', formData),
              title: formData =>
                `${fnp(formData)} ${
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 3 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 273..281
    src/applications/ivc-champva/10-7959C/config/form.js on lines 282..290
    src/applications/ivc-champva/10-7959C/config/form.js on lines 324..332

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

    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

            primaryThroughEmployer: {
              path: 'insurance-type',
              depends: formData => get('applicantHasPrimary', formData),
              title: formData =>
                `${fnp(formData)} type of insurance for ${
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 3 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 247..255
    src/applications/ivc-champva/10-7959C/config/form.js on lines 282..290
    src/applications/ivc-champva/10-7959C/config/form.js on lines 324..332

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

    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

            primaryPrescription: {
              path: 'insurance-prescription',
              depends: formData => get('applicantHasPrimary', formData),
              title: formData =>
                `${fnp(formData)} ${
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 3 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 247..255
    src/applications/ivc-champva/10-7959C/config/form.js on lines 273..281
    src/applications/ivc-champva/10-7959C/config/form.js on lines 324..332

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

    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

            primaryComments: {
              path: 'insurance-comments',
              depends: formData => get('applicantHasPrimary', formData),
              title: formData =>
                `${fnp(formData)} ${
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 3 other locations - About 1 hr to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 247..255
    src/applications/ivc-champva/10-7959C/config/form.js on lines 273..281
    src/applications/ivc-champva/10-7959C/config/form.js on lines 282..290

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

    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

            hasSecondaryHealthInsurance: {
              path: 'secondary-insurance',
              depends: formData => get('applicantHasPrimary', formData),
              title: formData => `${fnp(formData)} additional health insurance`,
              ...applicantHasInsuranceSchema(false),
    Severity: Minor
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 1 other location - About 55 mins to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 267..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 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

            primaryProvider: {
              path: 'insurance-info',
              depends: formData => get('applicantHasPrimary', formData),
              title: formData => `${fnp(formData)} health insurance information`,
              ...applicantProviderSchema(true),
    Severity: Minor
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 1 other location - About 55 mins to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 333..338

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

            medicareClass: {
              path: 'medicare-plan',
              title: formData => `${fnp(formData)} Medicare coverage`,
              depends: formData => get('applicantMedicareStatus', formData),
              ...applicantMedicareClassSchema,
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 2 other locations - About 45 mins to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 198..203
    src/applications/ivc-champva/10-7959C/config/form.js on lines 212..217

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

    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

            partBCarrier: {
              path: 'medicare-b-carrier',
              title: formData => `${fnp(formData)} Medicare Part B carrier`,
              depends: formData => get('applicantMedicareStatus', formData),
              ...applicantMedicarePartBCarrierSchema,
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 2 other locations - About 45 mins to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 175..180
    src/applications/ivc-champva/10-7959C/config/form.js on lines 212..217

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

    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

            hasMedicareD: {
              path: 'medicare-d-status',
              title: formData => `${fnp(formData)} Medicare Part D status`,
              depends: formData => get('applicantMedicareStatus', formData),
              ...applicantHasMedicareDSchema,
    Severity: Major
    Found in src/applications/ivc-champva/10-7959C/config/form.js and 2 other locations - About 45 mins to fix
    src/applications/ivc-champva/10-7959C/config/form.js on lines 175..180
    src/applications/ivc-champva/10-7959C/config/form.js on lines 198..203

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

    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