department-of-veterans-affairs/vets-website

View on GitHub
src/applications/pre-need/config/form.jsx

Summary

Maintainability
F
4 days
Test Coverage

File form.jsx has 620 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';

import { merge } from 'lodash';
import get from 'platform/utilities/data/get';

Severity: Major
Found in src/applications/pre-need/config/form.jsx - About 1 day to fix

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

                    'view:applicantInfo': {
                      mailingAddress: merge(
                        {},
                        address.uiSchema("Preparer's mailing address"),
                        {
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 1 other location - About 4 hrs to fix
    src/applications/pre-need-integration/config/pages/preparerContactDetails.jsx on lines 28..48

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

    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

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

        supportingDocuments: {
          title: 'Supporting files',
          pages: {
            supportingDocuments: {
              title: 'Upload supporting files',
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 1 other location - About 3 hrs to fix
    src/applications/pre-need-integration/config/form.jsx on lines 591..617

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

    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

              uiSchema: {
                'ui:title': PreparerDetailsTitle,
                'ui:description': PreparerDescription,
                application: {
                  applicant: {
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 1 other location - About 3 hrs to fix
    src/applications/pre-need-integration/config/pages/preparerDetails.jsx on lines 11..38

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

    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

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

    function MailingAddressStateTitle(props) {
      const { elementPath } = props;
      const data = useSelector(state => state.form.data || {});
      const country = get(elementPath, data);
      if (country === 'CAN') {
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 1 other location - About 2 hrs to fix
    src/applications/pre-need-integration/utils/helpers.js on lines 1379..1387

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 79.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

                    address: merge(
                      {},
                      address.uiSchema('Sponsor’s mailing address'),
                      {
                        street: {
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 2 other locations - About 2 hrs to fix
    src/applications/pre-need-integration/config/pages/sponsorContactInformation.jsx on lines 24..37
    src/applications/pre-need/config/form.jsx on lines 355..373

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

    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

                    address: merge(
                      {},
                      address.uiSchema('Applicant’s mailing address'),
                      {
                        street: {
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 2 other locations - About 2 hrs to fix
    src/applications/pre-need-integration/config/pages/sponsorContactInformation.jsx on lines 24..37
    src/applications/pre-need/config/form.jsx on lines 426..444

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

    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

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

              schema: {
                type: 'object',
                properties: {
                  application: {
                    type: 'object',
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 1 other location - About 1 hr to fix
    src/applications/pre-need-integration/config/pages/preparer.jsx on lines 28..45

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

    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

    const {
      fullName,
      ssn,
      date,
      dateRange,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 2 other locations - About 1 hr to fix
    src/applications/ezr/config/chapters/militaryService/otherToxicExposure.js on lines 5..16
    src/applications/hca/config/chapters/militaryService/otherToxicExposure.js on lines 4..15

    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

            sponsorDateOfDeath: {
              path: 'sponsor-date-of-death',
              depends: formData =>
                !isVeteran(formData) && isSponsorDeceased(formData),
              uiSchema: sponsorDateOfDeath.uiSchema,
    Severity: Minor
    Found in src/applications/pre-need/config/form.jsx and 1 other location - About 50 mins to fix
    src/applications/pre-need-integration/config/form.jsx on lines 368..374

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

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

            sponsorDemographics: {
              title: 'Sponsor demographics',
              path: 'sponsor-demographics',
              depends: formData => !isVeteran(formData),
              uiSchema: sponsorDemographics.uiSchema,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 10 other locations - About 40 mins to fix
    src/applications/disability-benefits/all-claims/config/form.js on lines 216..222
    src/applications/disability-benefits/all-claims/config/form.js on lines 223..229
    src/applications/disability-benefits/all-claims/config/form.js on lines 636..642
    src/applications/pre-need-integration/config/form.jsx on lines 394..400
    src/applications/pre-need-integration/config/form.jsx on lines 428..434
    src/applications/pre-need-integration/config/form.jsx on lines 535..541
    src/applications/pre-need/config/form.jsx on lines 192..198
    src/applications/pre-need/config/form.jsx on lines 218..224
    src/applications/pre-need/config/form.jsx on lines 245..251
    src/applications/pre-need/config/form.jsx on lines 280..286

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

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

            sponsorMilitaryHistory: {
              path: 'sponsor-military-history',
              title: 'Sponsor’s service period(s)',
              depends: formData => !isVeteran(formData),
              uiSchema: sponsorMilitaryHistory.uiSchema,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 10 other locations - About 40 mins to fix
    src/applications/disability-benefits/all-claims/config/form.js on lines 216..222
    src/applications/disability-benefits/all-claims/config/form.js on lines 223..229
    src/applications/disability-benefits/all-claims/config/form.js on lines 636..642
    src/applications/pre-need-integration/config/form.jsx on lines 394..400
    src/applications/pre-need-integration/config/form.jsx on lines 428..434
    src/applications/pre-need-integration/config/form.jsx on lines 535..541
    src/applications/pre-need/config/form.jsx on lines 192..198
    src/applications/pre-need/config/form.jsx on lines 218..224
    src/applications/pre-need/config/form.jsx on lines 225..231
    src/applications/pre-need/config/form.jsx on lines 245..251

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

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

            sponsorDetails: {
              title: 'Sponsor details',
              path: 'sponsor-details',
              depends: formData => !isVeteran(formData),
              uiSchema: sponsorDetails.uiSchema,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 10 other locations - About 40 mins to fix
    src/applications/disability-benefits/all-claims/config/form.js on lines 216..222
    src/applications/disability-benefits/all-claims/config/form.js on lines 223..229
    src/applications/disability-benefits/all-claims/config/form.js on lines 636..642
    src/applications/pre-need-integration/config/form.jsx on lines 394..400
    src/applications/pre-need-integration/config/form.jsx on lines 428..434
    src/applications/pre-need-integration/config/form.jsx on lines 535..541
    src/applications/pre-need/config/form.jsx on lines 192..198
    src/applications/pre-need/config/form.jsx on lines 225..231
    src/applications/pre-need/config/form.jsx on lines 245..251
    src/applications/pre-need/config/form.jsx on lines 280..286

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

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

            nonVeteranApplicantDetails: {
              title: 'Applicant details',
              path: 'nonVeteran-applicant-details',
              depends: formData => !isVeteran(formData),
              uiSchema: nonVeteranApplicantDetails.uiSchema,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 10 other locations - About 40 mins to fix
    src/applications/disability-benefits/all-claims/config/form.js on lines 216..222
    src/applications/disability-benefits/all-claims/config/form.js on lines 223..229
    src/applications/disability-benefits/all-claims/config/form.js on lines 636..642
    src/applications/pre-need-integration/config/form.jsx on lines 394..400
    src/applications/pre-need-integration/config/form.jsx on lines 428..434
    src/applications/pre-need-integration/config/form.jsx on lines 535..541
    src/applications/pre-need/config/form.jsx on lines 218..224
    src/applications/pre-need/config/form.jsx on lines 225..231
    src/applications/pre-need/config/form.jsx on lines 245..251
    src/applications/pre-need/config/form.jsx on lines 280..286

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

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

            sponsorMilitaryDetails: {
              title: "Sponsor's military details",
              path: 'sponsor-military-details',
              depends: formData => !isVeteran(formData),
              uiSchema: sponsorMilitaryDetails.uiSchema,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 10 other locations - About 40 mins to fix
    src/applications/disability-benefits/all-claims/config/form.js on lines 216..222
    src/applications/disability-benefits/all-claims/config/form.js on lines 223..229
    src/applications/disability-benefits/all-claims/config/form.js on lines 636..642
    src/applications/pre-need-integration/config/form.jsx on lines 394..400
    src/applications/pre-need-integration/config/form.jsx on lines 428..434
    src/applications/pre-need-integration/config/form.jsx on lines 535..541
    src/applications/pre-need/config/form.jsx on lines 192..198
    src/applications/pre-need/config/form.jsx on lines 218..224
    src/applications/pre-need/config/form.jsx on lines 225..231
    src/applications/pre-need/config/form.jsx on lines 280..286

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

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

            sponsorMilitaryNameInformation: {
              title: 'Sponsor’s previous name',
              path: 'sponsor-military-name-information',
              depends: formData => isNotVeteranAndHasServiceName(formData),
              uiSchema: sponsorMilitaryNameInformation.uiSchema,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 8 other locations - About 35 mins to fix
    src/applications/disability-benefits/all-claims/config/8940/index.js on lines 186..192
    src/applications/disability-benefits/all-claims/config/form.js on lines 622..628
    src/applications/disability-benefits/all-claims/config/form.js on lines 629..635
    src/applications/disability-benefits/all-claims/config/form.js on lines 643..649
    src/applications/disability-benefits/all-claims/config/form.js on lines 650..656
    src/applications/pre-need-integration/config/form.jsx on lines 560..566
    src/applications/pre-need/config/form.jsx on lines 273..279
    src/applications/pre-need/config/form.jsx on lines 310..316

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

            currentlyBuriedPersons: {
              title: 'Name of deceased person(s)',
              path: 'current-burial-benefits',
              depends: formData => buriedWSponsorsEligibility(formData),
              uiSchema: currentlyBuriedPersons.uiSchema,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 8 other locations - About 35 mins to fix
    src/applications/disability-benefits/all-claims/config/8940/index.js on lines 186..192
    src/applications/disability-benefits/all-claims/config/form.js on lines 622..628
    src/applications/disability-benefits/all-claims/config/form.js on lines 629..635
    src/applications/disability-benefits/all-claims/config/form.js on lines 643..649
    src/applications/disability-benefits/all-claims/config/form.js on lines 650..656
    src/applications/pre-need-integration/config/form.jsx on lines 560..566
    src/applications/pre-need/config/form.jsx on lines 273..279
    src/applications/pre-need/config/form.jsx on lines 293..299

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

            applicantMilitaryNameInformation: {
              title: 'Previous name',
              path: 'applicant-military-name-information',
              depends: formData => isVeteranAndHasServiceName(formData),
              uiSchema: applicantMilitaryNameInformation.uiSchema,
    Severity: Major
    Found in src/applications/pre-need/config/form.jsx and 8 other locations - About 35 mins to fix
    src/applications/disability-benefits/all-claims/config/8940/index.js on lines 186..192
    src/applications/disability-benefits/all-claims/config/form.js on lines 622..628
    src/applications/disability-benefits/all-claims/config/form.js on lines 629..635
    src/applications/disability-benefits/all-claims/config/form.js on lines 643..649
    src/applications/disability-benefits/all-claims/config/form.js on lines 650..656
    src/applications/pre-need-integration/config/form.jsx on lines 560..566
    src/applications/pre-need/config/form.jsx on lines 293..299
    src/applications/pre-need/config/form.jsx on lines 310..316

    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

    function ApplicantContactInfoDescription() {
      const data = useSelector(state => state.form.data || {});
      return isVeteran(data)
        ? applicantContactInfoDescriptionVet
        : applicantContactInfoDescriptionNonVet;
    Severity: Minor
    Found in src/applications/pre-need/config/form.jsx and 1 other location - About 30 mins to fix
    src/applications/pre-need/config/pages/burialBenefits.jsx on lines 18..23

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

    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