department-of-veterans-affairs/vets-website

View on GitHub
src/applications/pre-need-integration/utils/helpers.js

Summary

Maintainability
F
2 wks
Test Coverage

File helpers.js has 1184 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import { merge } from 'lodash';
import PropTypes from 'prop-types';
import get from 'platform/utilities/data/get';
import omit from 'platform/utilities/data/omit';
Severity: Major
Found in src/applications/pre-need-integration/utils/helpers.js - About 3 days to fix

    Function validateMilitaryHistory has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
    Open

    export const validateMilitaryHistory = (errors, serviceRecords, formData) => {
      // Map the highestRank to the corresponding Rank Description from jsonData
      const rankMap = jsonData.reduce((map, rank) => {
        // eslint-disable-next-line no-param-reassign
        map[rank['Rank Code'].toUpperCase()] = rank[
    Severity: Minor
    Found in src/applications/pre-need-integration/utils/helpers.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function validateMilitaryHistory has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const validateMilitaryHistory = (errors, serviceRecords, formData) => {
      // Map the highestRank to the corresponding Rank Description from jsonData
      const rankMap = jsonData.reduce((map, rank) => {
        // eslint-disable-next-line no-param-reassign
        map[rank['Rank Code'].toUpperCase()] = rank[
    Severity: Major
    Found in src/applications/pre-need-integration/utils/helpers.js - About 2 hrs to fix

      Function transform has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      export function transform(formConfig, form) {
        // Copy over sponsor data if the claimant is the veteran.
        const populateSponsorData = application =>
          isVeteran({ application })
            ? merge({}, application, {
      Severity: Minor
      Found in src/applications/pre-need-integration/utils/helpers.js - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function transform has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function transform(formConfig, form) {
        // Copy over sponsor data if the claimant is the veteran.
        const populateSponsorData = application =>
          isVeteran({ application })
            ? merge({}, application, {
      Severity: Major
      Found in src/applications/pre-need-integration/utils/helpers.js - About 2 hrs to fix

        Function getCemeteries has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function getCemeteries() {
          return fetch(`${environment.API_URL}/v0/preneeds/cemeteries`, {
            credentials: 'include',
            headers: {
              'X-Key-Inflection': 'camel',
        Severity: Minor
        Found in src/applications/pre-need-integration/utils/helpers.js - About 1 hr to fix

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

          export function transform(formConfig, form) {
            // Copy over sponsor data if the claimant is the veteran.
            const populateSponsorData = application =>
              isVeteran({ application })
                ? merge({}, application, {
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 2 days to fix
          src/applications/pre-need/utils/helpers.js on lines 433..545

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

          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

          export const selfServiceRecordsUI = {
            'ui:title': 'Your service period(s)',
            'ui:options': {
              viewField: ServicePeriodView,
              itemName: 'Service period',
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 day to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 1251..1314

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

          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

          export const preparerServiceRecordsUI = {
            'ui:title': 'Applicant’s service period(s)',
            'ui:options': {
              viewField: ServicePeriodView,
              itemName: 'Service period',
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 day to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 1186..1249

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

          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

          class SSNWidget extends React.Component {
            constructor(props) {
              super(props);
              this.state = { val: props.value };
            }
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 day to fix
          src/applications/pre-need/utils/helpers.js on lines 555..584

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

          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

          export function getCemeteries() {
            return fetch(`${environment.API_URL}/v0/preneeds/cemeteries`, {
              credentials: 'include',
              headers: {
                'X-Key-Inflection': 'camel',
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 day to fix
          src/applications/pre-need/utils/helpers.js on lines 752..783

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

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

          export function parseResponse({ data }) {
            const { name } = data.attributes;
            const focusFileCard = () => {
              const target = $$('.schemaform-file-list li').find(entry =>
                entry.textContent?.trim().includes(name),
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 3 other locations - About 5 hrs to fix
          src/applications/pre-need/utils/helpers.js on lines 40..60
          src/applications/simple-forms/20-10207/helpers.js on lines 140..160
          src/applications/simple-forms/40-0247/helpers.js on lines 59..79

          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

          export function formatName(name) {
            const { first, middle, last, suffix } = name;
            return (
              (first || last) &&
              `${first} ${middle ? `${middle} ` : ''}${last}${
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 3 hrs to fix
          src/applications/pre-need/utils/helpers.js on lines 418..426

          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

          export 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-integration/utils/helpers.js and 1 other location - About 2 hrs to fix
          src/applications/pre-need/config/form.jsx on lines 89..97

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

            <va-additional-info trigger="What to know if you’re filling out this application for someone else">
              <p>
                One of these descriptions must be true for the applicant (the person
                you’re filling out this application for):
              </p>
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 2 hrs to fix
          src/applications/pre-need/utils/helpers.js on lines 276..288

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

          export const createPayload = (file, formId, password) => {
            const payload = new FormData();
            payload.set('form_id', formId);
            payload.append('file', file);
            if (password) {
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 2 other locations - About 1 hr to fix
          src/applications/pre-need/utils/helpers.js on lines 30..38
          src/applications/simple-forms/40-0247/helpers.js on lines 49..57

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

          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

          export const fullMaidenNameUI = merge({}, fullNameUI, {
            first: { 'ui:title': 'First name' },
            middle: { 'ui:title': 'Middle name' },
            last: { 'ui:title': 'Last name' },
            maiden: { 'ui:title': 'Maiden name' },
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 hr to fix
          src/applications/pre-need/utils/helpers.js on lines 547..553

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

          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

          export const militaryNameUI = {
            application: {
              veteran: {
                'view:hasServiceName': {
                  'ui:title': 'Did you serve under another name?',
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 hr to fix
          src/applications/pre-need/utils/helpers.js on lines 736..750

          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

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

              'ui:validations': [
                // require at least one value to be true/checked
                (errors, fields) => {
                  if (!Object.values(fields).some(val => val === true)) {
                    errors.addError('Please provide a response');
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 2 other locations - About 1 hr to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 925..932
          src/applications/pre-need/utils/helpers.js on lines 648..655

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

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

              'ui:validations': [
                // require at least one value to be true/checked
                (errors, fields) => {
                  if (!Object.values(fields).some(val => val === true)) {
                    errors.addError('Please provide a response');
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 2 other locations - About 1 hr to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 1065..1072
          src/applications/pre-need/utils/helpers.js on lines 648..655

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

          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

          export function claimantHeader({ formData }) {
            const name = formatName(formData.claimant.name);
            return <h4 className="highlight">{name}</h4>;
          }
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 hr to fix
          src/applications/pre-need/utils/helpers.js on lines 428..431

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

          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

            maritalStatus: {
              'ui:title': 'What’s your marital status?',
              'ui:widget': 'radio',
              'ui:options': {
                labels: {
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 hr to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 872..885

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

          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

            maritalStatus: {
              'ui:title': 'What’s your marital status?',
              'ui:widget': 'radio',
              'ui:options': {
                labels: {
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 hr to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 1012..1025

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

          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

          export const preparerFullMaidenNameUI = merge({}, fullMaidenNameUI, {
            first: { 'ui:title': 'Applicant’s first name' },
            middle: { 'ui:title': 'Applicant’s middle name' },
            last: { 'ui:title': 'Applicant’s last name' },
            maiden: { 'ui:title': 'Applicant’s maiden name' },
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 hr to fix
          src/applications/hca/config/chapters/militaryService/additionalInformation.js on lines 15..34

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

          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

          export const spouseRelationshipDescription = (
            <va-alert
              status="info"
              background-only
              role="status"
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 hr to fix
          src/applications/pre-need/utils/helpers.js on lines 291..304

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

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

          export const childRelationshipDescription = (
            <va-alert status="info" background-only role="status" id="child-relationship">
              You’re applying as the <strong>unmarried adult child</strong> of the service
              member or Veteran who’s your sponsor. We’ll ask you questions about your
              sponsor’s military status and history to determine if you qualify for burial
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 5 other locations - About 50 mins to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 346..357
          src/applications/pre-need-integration/utils/helpers.js on lines 419..426
          src/applications/pre-need/utils/helpers.js on lines 261..272
          src/applications/pre-need/utils/helpers.js on lines 306..314
          src/applications/pre-need/utils/helpers.js on lines 316..323

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

          export const veteranRelationshipDescription = (
            <va-alert
              status="info"
              background-only
              role="status"
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 5 other locations - About 50 mins to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 409..417
          src/applications/pre-need-integration/utils/helpers.js on lines 419..426
          src/applications/pre-need/utils/helpers.js on lines 261..272
          src/applications/pre-need/utils/helpers.js on lines 306..314
          src/applications/pre-need/utils/helpers.js on lines 316..323

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

          export const otherRelationshipDescription = (
            <va-alert status="info" background-only role="status" id="other-relationship">
              You’re applying on <strong>behalf</strong> of the service member or Veteran
              who’s your sponsor. We’ll ask you questions about your sponsor’s military
              status and history to determine if they qualify for burial in a VA national
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 5 other locations - About 50 mins to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 346..357
          src/applications/pre-need-integration/utils/helpers.js on lines 409..417
          src/applications/pre-need/utils/helpers.js on lines 261..272
          src/applications/pre-need/utils/helpers.js on lines 306..314
          src/applications/pre-need/utils/helpers.js on lines 316..323

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

          export const contactInfoDescription = (
            <va-additional-info trigger="Why do we need your contact information?">
              <p>
                We may contact you by phone if we need more information about your
                application.
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 2 other locations - About 50 mins to fix
          src/applications/pre-need/utils/helpers.js on lines 155..166
          src/applications/my-education-benefits/helpers.js on lines 50..60

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

          export function ApplicantDescriptionWrapper({ formContext }) {
            return (
              <div className="ApplicantDescriptionWrapper">
                <ApplicantDescription formContext={formContext} />
              </div>
          Severity: Minor
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 50 mins to fix
          src/applications/pre-need/utils/helpers.js on lines 68..74

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

                {isApplicantTheSponsor(formData) &&
                  !formContext.onReviewPage && (
                    <div className="sponsorDetailsSummaryBox">
                      <va-summary-box>
                        <p className="sponsorDetailsSummaryBoxText">
          Severity: Minor
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 40 mins to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 48..59

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

                {formContext.isLoggedIn &&
                  !formContext.onReviewPage && (
                    <div className="veteranApplicantDetailsSummaryBox">
                      <va-summary-box>
                        <p className="veteranApplicantDetailsSummaryBoxText">
          Severity: Minor
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 40 mins to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 113..124

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

          export const nonPreparerFullMaidenNameUI = merge({}, fullMaidenNameUI, {
            first: { 'ui:title': 'Your first name' },
            middle: { 'ui:title': 'Your middle name' },
            last: { 'ui:title': 'Your last name' },
            maiden: { 'ui:title': 'Maiden name' },
          Severity: Minor
          Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 35 mins to fix
          src/applications/_mock-form/pages/radioButtonGroup.js on lines 14..19

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

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

          export function sponsorMailingAddressHasState(item) {
            const country = get('application.veteran.address.country', item);
            const countriesWithStates = ['USA', 'CAN'];
            return countriesWithStates.includes(country);
          }
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 5 other locations - About 30 mins to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 547..554
          src/applications/pre-need-integration/utils/helpers.js on lines 556..560
          src/applications/pre-need/utils/helpers.js on lines 351..358
          src/applications/pre-need/utils/helpers.js on lines 360..364
          src/applications/pre-need/utils/helpers.js on lines 366..370

          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

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

          export function preparerAddressHasState(item) {
            const country = get(
              'application.applicant.view:applicantInfo.mailingAddress.country',
              item,
            );
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 5 other locations - About 30 mins to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 556..560
          src/applications/pre-need-integration/utils/helpers.js on lines 562..566
          src/applications/pre-need/utils/helpers.js on lines 351..358
          src/applications/pre-need/utils/helpers.js on lines 360..364
          src/applications/pre-need/utils/helpers.js on lines 366..370

          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

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

          export function applicantsMailingAddressHasState(item) {
            const country = get('application.claimant.address.country', item);
            const countriesWithStates = ['USA', 'CAN'];
            return countriesWithStates.includes(country);
          }
          Severity: Major
          Found in src/applications/pre-need-integration/utils/helpers.js and 5 other locations - About 30 mins to fix
          src/applications/pre-need-integration/utils/helpers.js on lines 547..554
          src/applications/pre-need-integration/utils/helpers.js on lines 562..566
          src/applications/pre-need/utils/helpers.js on lines 351..358
          src/applications/pre-need/utils/helpers.js on lines 360..364
          src/applications/pre-need/utils/helpers.js on lines 366..370

          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