department-of-veterans-affairs/vets-website

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

Summary

Maintainability
F
1 wk
Test Coverage

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

import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import React from 'react';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
import {
  checkboxGroupSchema,
Severity: Major
Found in src/applications/ivc-champva/10-10D/config/form.js - About 3 days to fix

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

            page18d: {
              path: 'applicant-child-adoption-file/:index',
              arrayPath: 'applicants',
              showPagePerItem: true,
              title: item => `${applicantWording(item)} adoption documents`,
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 6 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 835..865
    src/applications/ivc-champva/10-10D/config/form.js on lines 1193..1220

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

    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

            page22: {
              path: 'applicant-other-insurance-10-7959c-file/:index',
              arrayPath: 'applicants',
              showPagePerItem: true,
              title: item => `${applicantWording(item)} 10-7959c upload`,
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 6 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 805..834
    src/applications/ivc-champva/10-10D/config/form.js on lines 835..865

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

    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

            page18e: {
              path: 'applicant-child-marriage-file/:index',
              arrayPath: 'applicants',
              showPagePerItem: true,
              title: item =>
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 6 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 805..834
    src/applications/ivc-champva/10-10D/config/form.js on lines 1193..1220

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

    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

            page21a: {
              path: 'applicant-other-insurance-upload/:index',
              arrayPath: 'applicants',
              showPagePerItem: true,
              title: item => `${applicantWording(item)} other health insurance`,
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 1 other location - About 5 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 1058..1084

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

    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

            page20a: {
              path: 'applicant-medicare-upload/:index',
              arrayPath: 'applicants',
              showPagePerItem: true,
              title: item => `${applicantWording(item)} Medicare Part A and B card`,
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 1 other location - About 5 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 1168..1192

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

    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

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

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

            page19: {
              path: 'applicant-medicare/:index',
              arrayPath: 'applicants',
              showPagePerItem: true,
              title: item =>
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 4 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 719..740
    src/applications/ivc-champva/10-10D/config/form.js on lines 1146..1167

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

    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

            page18: {
              path: 'applicant-relationship/:index',
              arrayPath: 'applicants',
              showPagePerItem: true,
              title: item => `${applicantWording(item)} relationship to sponsor`,
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 4 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 1004..1026
    src/applications/ivc-champva/10-10D/config/form.js on lines 1146..1167

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

    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

            page21: {
              path: 'applicant-other-insurance-status/:index',
              arrayPath: 'applicants',
              showPagePerItem: true,
              title: item => `${applicantWording(item)} other health insurance`,
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 4 hrs to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 719..740
    src/applications/ivc-champva/10-10D/config/form.js on lines 1004..1026

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

    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

              schema: applicantListSchema([], {
                titleSchema,
                'ui:description': blankSchema,
                applicantDependentStatus: {
                  type: 'object',
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 1 other location - About 1 hr to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 765..779

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

    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

              schema: applicantListSchema([], {
                titleSchema,
                'ui:description': blankSchema,
                applicantRelationshipOrigin: {
                  type: 'object',
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js and 1 other location - About 1 hr to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 893..907

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

    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

                  otherRelationshipToVeteran: {
                    'ui:title':
                      'Since your relationship with the applicant was not listed, please describe it here',
                    'ui:webComponentField': VaTextInputField,
                    'ui:options': {
    Severity: Minor
    Found in src/applications/ivc-champva/10-10D/config/form.js and 1 other location - About 40 mins to fix
    src/applications/simple-forms/21-0966/pages/thirdPartyPreparerRole.js on lines 23..35

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

    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

                  formData.applicants[index]?.applicantRelationshipToSponsor
                    ?.relationshipToVeteran === 'child' &&
                  isInRange(
                    getAgeInYears(formData.applicants[index]?.applicantDob),
                    18,
    Severity: Minor
    Found in src/applications/ivc-champva/10-10D/config/form.js and 1 other location - About 35 mins to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 874..880

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

    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

                  formData.applicants[index]?.applicantRelationshipToSponsor
                    ?.relationshipToVeteran === 'child' &&
                  isInRange(
                    getAgeInYears(formData.applicants[index]?.applicantDob),
                    18,
    Severity: Minor
    Found in src/applications/ivc-champva/10-10D/config/form.js and 1 other location - About 35 mins to fix
    src/applications/ivc-champva/10-10D/config/form.js on lines 917..923

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

    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