department-of-veterans-affairs/vets-website

View on GitHub
src/applications/my-education-benefits/helpers.js

Summary

Maintainability
F
2 wks
Test Coverage

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

import React from 'react';
import moment from 'moment';
import { DATE_TIMESTAMP, formFields } from './constants';
import { getSchemaCountryCode } from './utils/form-submit-transform';

Severity: Major
Found in src/applications/my-education-benefits/helpers.js - About 1 day to fix

    Function prefillTransformerV3 has 135 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function prefillTransformerV3(pages, formData, metadata, state) {
      const bankInformation = state.data?.bankInformation || {};
      const claimant = state.data?.formData?.data?.attributes?.claimant || {};
      const exclusionPeriods = Array.isArray(state.data?.exclusionPeriods)
        ? state.data?.exclusionPeriods
    Severity: Major
    Found in src/applications/my-education-benefits/helpers.js - About 5 hrs to fix

      Function prefillTransformerV4 has 125 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function prefillTransformerV4(pages, formData, metadata, state) {
        const bankInformation = state.data?.bankInformation || {};
        const claimant = state.data?.formData?.data?.attributes?.claimant || {};
        const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
        const contactInfo = claimant?.contactInfo || {};
      Severity: Major
      Found in src/applications/my-education-benefits/helpers.js - About 5 hrs to fix

        Function prefillTransformerV1 has 118 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function prefillTransformerV1(pages, formData, metadata, state) {
          const bankInformation = state.data?.bankInformation || {};
          const claimant = state.data?.formData?.data?.attributes?.claimant || {};
          const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
          const contactInfo = claimant?.contactInfo || {};
        Severity: Major
        Found in src/applications/my-education-benefits/helpers.js - About 4 hrs to fix

          Function prefillTransformerV2 has 116 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function prefillTransformerV2(pages, formData, metadata, state) {
            const bankInformation = state.data?.bankInformation || {};
            const claimant = state.data?.formData?.data?.attributes?.claimant || {};
            const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
            const contactInfo = claimant?.contactInfo || {};
          Severity: Major
          Found in src/applications/my-education-benefits/helpers.js - About 4 hrs to fix

            Function prefillTransformerV3 has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

            export function prefillTransformerV3(pages, formData, metadata, state) {
              const bankInformation = state.data?.bankInformation || {};
              const claimant = state.data?.formData?.data?.attributes?.claimant || {};
              const exclusionPeriods = Array.isArray(state.data?.exclusionPeriods)
                ? state.data?.exclusionPeriods
            Severity: Minor
            Found in src/applications/my-education-benefits/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 prefillTransformerV1 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            export function prefillTransformerV1(pages, formData, metadata, state) {
              const bankInformation = state.data?.bankInformation || {};
              const claimant = state.data?.formData?.data?.attributes?.claimant || {};
              const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
              const contactInfo = claimant?.contactInfo || {};
            Severity: Minor
            Found in src/applications/my-education-benefits/helpers.js - About 1 hr 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 prefillTransformerV4 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            export function prefillTransformerV4(pages, formData, metadata, state) {
              const bankInformation = state.data?.bankInformation || {};
              const claimant = state.data?.formData?.data?.attributes?.claimant || {};
              const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
              const contactInfo = claimant?.contactInfo || {};
            Severity: Minor
            Found in src/applications/my-education-benefits/helpers.js - About 1 hr 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 prefillTransformerV2 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            export function prefillTransformerV2(pages, formData, metadata, state) {
              const bankInformation = state.data?.bankInformation || {};
              const claimant = state.data?.formData?.data?.attributes?.claimant || {};
              const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
              const contactInfo = claimant?.contactInfo || {};
            Severity: Minor
            Found in src/applications/my-education-benefits/helpers.js - About 1 hr 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 formatReadableDate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const formatReadableDate = (rawDate, minimumDateDigits = 1) => {
              const months = [
                'January',
                'February',
                'March',
            Severity: Minor
            Found in src/applications/my-education-benefits/helpers.js - About 1 hr to fix

              Avoid too many return statements within this function.
              Open

                return prefillTransformerV1(pages, formData, metadata, state);
              Severity: Major
              Found in src/applications/my-education-benefits/helpers.js - About 30 mins to fix

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

                    [formFields.viewMailingAddress]: {
                      [formFields.address]: {
                        street: address?.addressLine1,
                        street2: address?.addressLine2 || undefined,
                        city: address?.city,
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 2 other locations - About 4 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 466..482
                src/applications/my-education-benefits/helpers.js on lines 747..763

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

                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

                    [formFields.viewMailingAddress]: {
                      [formFields.address]: {
                        street: address?.addressLine1,
                        street2: address?.addressLine2 || undefined,
                        city: address?.city,
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 2 other locations - About 4 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 602..618
                src/applications/my-education-benefits/helpers.js on lines 747..763

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

                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

                    [formFields.viewMailingAddress]: {
                      [formFields.address]: {
                        street: address?.addressLine1,
                        street2: address?.addressLine2 || undefined,
                        city: address?.city,
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 2 other locations - About 4 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 466..482
                src/applications/my-education-benefits/helpers.js on lines 602..618

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

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

                  if (profile?.userFullName?.first && profile?.userFullName?.last) {
                    firstName = profile.userFullName.first;
                    middleName = profile.userFullName.middle;
                    lastName = profile.userFullName.last;
                    // suffix = ???
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 6 other locations - About 4 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 263..273
                src/applications/my-education-benefits/helpers.js on lines 392..402
                src/applications/my-education-benefits/helpers.js on lines 673..683
                src/applications/survivor-dependent-education-benefit/22-5490/helpers.jsx on lines 105..115
                src/applications/toe/helpers.jsx on lines 115..125
                src/applications/toe/helpers.jsx on lines 240..250

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 122.

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

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

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

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

                Refactorings

                Further Reading

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

                  if (profile?.userFullName?.first && profile?.userFullName?.last) {
                    firstName = profile.userFullName.first;
                    middleName = profile.userFullName.middle;
                    lastName = profile.userFullName.last;
                    // suffix = ???
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 6 other locations - About 4 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 263..273
                src/applications/my-education-benefits/helpers.js on lines 392..402
                src/applications/my-education-benefits/helpers.js on lines 528..538
                src/applications/survivor-dependent-education-benefit/22-5490/helpers.jsx on lines 105..115
                src/applications/toe/helpers.jsx on lines 115..125
                src/applications/toe/helpers.jsx on lines 240..250

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 122.

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

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

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

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

                Refactorings

                Further Reading

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

                  if (profile?.userFullName?.first && profile?.userFullName?.last) {
                    firstName = profile.userFullName.first;
                    middleName = profile.userFullName.middle;
                    lastName = profile.userFullName.last;
                    // suffix = ???
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 6 other locations - About 4 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 263..273
                src/applications/my-education-benefits/helpers.js on lines 528..538
                src/applications/my-education-benefits/helpers.js on lines 673..683
                src/applications/survivor-dependent-education-benefit/22-5490/helpers.jsx on lines 105..115
                src/applications/toe/helpers.jsx on lines 115..125
                src/applications/toe/helpers.jsx on lines 240..250

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 122.

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

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

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

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

                Refactorings

                Further Reading

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

                  if (profile?.userFullName?.first && profile?.userFullName?.last) {
                    firstName = profile.userFullName.first;
                    middleName = profile.userFullName.middle;
                    lastName = profile.userFullName.last;
                    // suffix = ???
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 6 other locations - About 4 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 392..402
                src/applications/my-education-benefits/helpers.js on lines 528..538
                src/applications/my-education-benefits/helpers.js on lines 673..683
                src/applications/survivor-dependent-education-benefit/22-5490/helpers.jsx on lines 105..115
                src/applications/toe/helpers.jsx on lines 115..125
                src/applications/toe/helpers.jsx on lines 240..250

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 122.

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

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

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

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

                Refactorings

                Further Reading

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

                  if (suffix) {
                    newData[formFields.viewUserFullName].userFullName.suffix =
                      state?.form?.pages?.applicantInformation?.schema?.properties[
                        formFields.viewUserFullName
                      ]?.properties?.userFullName?.properties?.suffix?.enum?.find(e =>
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 3 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 360..367
                src/applications/my-education-benefits/helpers.js on lines 490..497
                src/applications/my-education-benefits/helpers.js on lines 777..784
                src/applications/toe/helpers.jsx on lines 209..216
                src/applications/toe/helpers.jsx on lines 339..346

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

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

                  if (suffix) {
                    newData[formFields.viewUserFullName].userFullName.suffix =
                      state?.form?.pages?.applicantInformation?.schema?.properties[
                        formFields.viewUserFullName
                      ]?.properties?.userFullName?.properties?.suffix?.enum?.find(e =>
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 3 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 360..367
                src/applications/my-education-benefits/helpers.js on lines 639..646
                src/applications/my-education-benefits/helpers.js on lines 777..784
                src/applications/toe/helpers.jsx on lines 209..216
                src/applications/toe/helpers.jsx on lines 339..346

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

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

                  if (suffix) {
                    newData[formFields.viewUserFullName].userFullName.suffix =
                      state?.form?.pages?.applicantInformation?.schema?.properties[
                        formFields.viewUserFullName
                      ]?.properties?.userFullName?.properties?.suffix?.enum?.find(e =>
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 3 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 360..367
                src/applications/my-education-benefits/helpers.js on lines 490..497
                src/applications/my-education-benefits/helpers.js on lines 639..646
                src/applications/toe/helpers.jsx on lines 209..216
                src/applications/toe/helpers.jsx on lines 339..346

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

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

                  if (suffix) {
                    newData[formFields.viewUserFullName].userFullName.suffix =
                      state?.form?.pages?.applicantInformation?.schema?.properties[
                        formFields.viewUserFullName
                      ]?.properties?.userFullName?.properties?.suffix?.enum?.find(e =>
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 3 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 490..497
                src/applications/my-education-benefits/helpers.js on lines 639..646
                src/applications/my-education-benefits/helpers.js on lines 777..784
                src/applications/toe/helpers.jsx on lines 209..216
                src/applications/toe/helpers.jsx on lines 339..346

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

                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 function obfuscate(str, numVisibleChars = 4, obfuscateChar = '●') {
                  if (!str) {
                    return '';
                  }
                
                
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 2 other locations - About 3 hrs to fix
                src/applications/survivor-dependent-education-benefit/22-5490/helpers.jsx on lines 23..36
                src/applications/toe/helpers.jsx on lines 20..33

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

                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 toSnakeCase = obj => {
                  const result = {};
                  Object.keys(obj).forEach(key => {
                    const snakeKey = key.replace(/([A-Z])/g, '_$1').toLowerCase();
                    result[snakeKey] = obj[key];
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 1 other location - About 2 hrs to fix
                src/applications/toe/helpers.jsx on lines 445..452

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

                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

                      [formFields.address]: {
                        street: address?.addressLine1,
                        street2: address?.addressLine2 || undefined,
                        city: address?.city,
                        state: address?.stateCode,
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 1 other location - About 2 hrs to fix
                src/applications/toe/helpers.jsx on lines 192..199

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

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

                    [formFields.viewPhoneNumbers]: {
                      [formFields.mobilePhoneNumber]: {
                        phone: mobilePhoneNumber?.replace(/\D/g, '') || undefined,
                        isInternational: mobilePhoneIsInternational,
                      },
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 2 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 453..462
                src/applications/my-education-benefits/helpers.js on lines 589..598
                src/applications/my-education-benefits/helpers.js on lines 734..743
                src/applications/toe/helpers.jsx on lines 177..186
                src/applications/toe/helpers.jsx on lines 302..311

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

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

                    [formFields.viewPhoneNumbers]: {
                      [formFields.mobilePhoneNumber]: {
                        phone: mobilePhoneNumber?.replace(/\D/g, '') || undefined,
                        isInternational: mobilePhoneIsInternational,
                      },
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 2 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 324..333
                src/applications/my-education-benefits/helpers.js on lines 453..462
                src/applications/my-education-benefits/helpers.js on lines 589..598
                src/applications/toe/helpers.jsx on lines 177..186
                src/applications/toe/helpers.jsx on lines 302..311

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

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

                    [formFields.viewPhoneNumbers]: {
                      [formFields.mobilePhoneNumber]: {
                        phone: mobilePhoneNumber?.replace(/\D/g, '') || undefined,
                        isInternational: mobilePhoneIsInternational,
                      },
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 2 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 324..333
                src/applications/my-education-benefits/helpers.js on lines 589..598
                src/applications/my-education-benefits/helpers.js on lines 734..743
                src/applications/toe/helpers.jsx on lines 177..186
                src/applications/toe/helpers.jsx on lines 302..311

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

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

                    [formFields.viewPhoneNumbers]: {
                      [formFields.mobilePhoneNumber]: {
                        phone: mobilePhoneNumber?.replace(/\D/g, '') || undefined,
                        isInternational: mobilePhoneIsInternational,
                      },
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 2 hrs to fix
                src/applications/my-education-benefits/helpers.js on lines 324..333
                src/applications/my-education-benefits/helpers.js on lines 453..462
                src/applications/my-education-benefits/helpers.js on lines 734..743
                src/applications/toe/helpers.jsx on lines 177..186
                src/applications/toe/helpers.jsx on lines 302..311

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

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

                  if (vapMobilePhone.areaCode && vapMobilePhone.phoneNumber) {
                    mobilePhoneNumber = [
                      vapMobilePhone.areaCode,
                      vapMobilePhone.phoneNumber,
                    ].join();
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 11 other locations - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 284..292
                src/applications/my-education-benefits/helpers.js on lines 297..302
                src/applications/my-education-benefits/helpers.js on lines 413..421
                src/applications/my-education-benefits/helpers.js on lines 426..431
                src/applications/my-education-benefits/helpers.js on lines 549..557
                src/applications/my-education-benefits/helpers.js on lines 562..567
                src/applications/my-education-benefits/helpers.js on lines 707..712
                src/applications/toe/helpers.jsx on lines 136..144
                src/applications/toe/helpers.jsx on lines 149..154
                src/applications/toe/helpers.jsx on lines 261..269
                src/applications/toe/helpers.jsx on lines 274..279

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

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

                  if (vapHomePhone.areaCode && vapHomePhone.phoneNumber) {
                    homePhoneNumber = [vapHomePhone.areaCode, vapHomePhone.phoneNumber].join();
                    homePhoneIsInternational = vapHomePhone.isInternational;
                  } else {
                    homePhoneNumber = contactInfo?.homePhoneNumber;
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 11 other locations - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 284..292
                src/applications/my-education-benefits/helpers.js on lines 297..302
                src/applications/my-education-benefits/helpers.js on lines 413..421
                src/applications/my-education-benefits/helpers.js on lines 426..431
                src/applications/my-education-benefits/helpers.js on lines 549..557
                src/applications/my-education-benefits/helpers.js on lines 694..702
                src/applications/my-education-benefits/helpers.js on lines 707..712
                src/applications/toe/helpers.jsx on lines 136..144
                src/applications/toe/helpers.jsx on lines 149..154
                src/applications/toe/helpers.jsx on lines 261..269
                src/applications/toe/helpers.jsx on lines 274..279

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

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

                  if (vapMobilePhone.areaCode && vapMobilePhone.phoneNumber) {
                    mobilePhoneNumber = [
                      vapMobilePhone.areaCode,
                      vapMobilePhone.phoneNumber,
                    ].join();
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 11 other locations - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 284..292
                src/applications/my-education-benefits/helpers.js on lines 297..302
                src/applications/my-education-benefits/helpers.js on lines 426..431
                src/applications/my-education-benefits/helpers.js on lines 549..557
                src/applications/my-education-benefits/helpers.js on lines 562..567
                src/applications/my-education-benefits/helpers.js on lines 694..702
                src/applications/my-education-benefits/helpers.js on lines 707..712
                src/applications/toe/helpers.jsx on lines 136..144
                src/applications/toe/helpers.jsx on lines 149..154
                src/applications/toe/helpers.jsx on lines 261..269
                src/applications/toe/helpers.jsx on lines 274..279

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

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

                  if (vapMobilePhone.areaCode && vapMobilePhone.phoneNumber) {
                    mobilePhoneNumber = [
                      vapMobilePhone.areaCode,
                      vapMobilePhone.phoneNumber,
                    ].join();
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 11 other locations - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 284..292
                src/applications/my-education-benefits/helpers.js on lines 297..302
                src/applications/my-education-benefits/helpers.js on lines 413..421
                src/applications/my-education-benefits/helpers.js on lines 426..431
                src/applications/my-education-benefits/helpers.js on lines 562..567
                src/applications/my-education-benefits/helpers.js on lines 694..702
                src/applications/my-education-benefits/helpers.js on lines 707..712
                src/applications/toe/helpers.jsx on lines 136..144
                src/applications/toe/helpers.jsx on lines 149..154
                src/applications/toe/helpers.jsx on lines 261..269
                src/applications/toe/helpers.jsx on lines 274..279

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

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

                  if (vapMobilePhone.areaCode && vapMobilePhone.phoneNumber) {
                    mobilePhoneNumber = [
                      vapMobilePhone.areaCode,
                      vapMobilePhone.phoneNumber,
                    ].join();
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 11 other locations - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 297..302
                src/applications/my-education-benefits/helpers.js on lines 413..421
                src/applications/my-education-benefits/helpers.js on lines 426..431
                src/applications/my-education-benefits/helpers.js on lines 549..557
                src/applications/my-education-benefits/helpers.js on lines 562..567
                src/applications/my-education-benefits/helpers.js on lines 694..702
                src/applications/my-education-benefits/helpers.js on lines 707..712
                src/applications/toe/helpers.jsx on lines 136..144
                src/applications/toe/helpers.jsx on lines 149..154
                src/applications/toe/helpers.jsx on lines 261..269
                src/applications/toe/helpers.jsx on lines 274..279

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

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

                  if (vapHomePhone.areaCode && vapHomePhone.phoneNumber) {
                    homePhoneNumber = [vapHomePhone.areaCode, vapHomePhone.phoneNumber].join();
                    homePhoneIsInternational = vapHomePhone.isInternational;
                  } else {
                    homePhoneNumber = contactInfo?.homePhoneNumber;
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 11 other locations - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 284..292
                src/applications/my-education-benefits/helpers.js on lines 413..421
                src/applications/my-education-benefits/helpers.js on lines 426..431
                src/applications/my-education-benefits/helpers.js on lines 549..557
                src/applications/my-education-benefits/helpers.js on lines 562..567
                src/applications/my-education-benefits/helpers.js on lines 694..702
                src/applications/my-education-benefits/helpers.js on lines 707..712
                src/applications/toe/helpers.jsx on lines 136..144
                src/applications/toe/helpers.jsx on lines 149..154
                src/applications/toe/helpers.jsx on lines 261..269
                src/applications/toe/helpers.jsx on lines 274..279

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

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

                  if (vapHomePhone.areaCode && vapHomePhone.phoneNumber) {
                    homePhoneNumber = [vapHomePhone.areaCode, vapHomePhone.phoneNumber].join();
                    homePhoneIsInternational = vapHomePhone.isInternational;
                  } else {
                    homePhoneNumber = contactInfo?.homePhoneNumber;
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 11 other locations - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 284..292
                src/applications/my-education-benefits/helpers.js on lines 297..302
                src/applications/my-education-benefits/helpers.js on lines 413..421
                src/applications/my-education-benefits/helpers.js on lines 426..431
                src/applications/my-education-benefits/helpers.js on lines 549..557
                src/applications/my-education-benefits/helpers.js on lines 562..567
                src/applications/my-education-benefits/helpers.js on lines 694..702
                src/applications/toe/helpers.jsx on lines 136..144
                src/applications/toe/helpers.jsx on lines 149..154
                src/applications/toe/helpers.jsx on lines 261..269
                src/applications/toe/helpers.jsx on lines 274..279

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

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

                  if (vapHomePhone.areaCode && vapHomePhone.phoneNumber) {
                    homePhoneNumber = [vapHomePhone.areaCode, vapHomePhone.phoneNumber].join();
                    homePhoneIsInternational = vapHomePhone.isInternational;
                  } else {
                    homePhoneNumber = contactInfo?.homePhoneNumber;
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 11 other locations - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 284..292
                src/applications/my-education-benefits/helpers.js on lines 297..302
                src/applications/my-education-benefits/helpers.js on lines 413..421
                src/applications/my-education-benefits/helpers.js on lines 549..557
                src/applications/my-education-benefits/helpers.js on lines 562..567
                src/applications/my-education-benefits/helpers.js on lines 694..702
                src/applications/my-education-benefits/helpers.js on lines 707..712
                src/applications/toe/helpers.jsx on lines 136..144
                src/applications/toe/helpers.jsx on lines 149..154
                src/applications/toe/helpers.jsx on lines 261..269
                src/applications/toe/helpers.jsx on lines 274..279

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

                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

                    trainingPeriods: serviceHistory?.trainingPeriods?.map(exclusionPeriod => {
                      return {
                        from: moment(exclusionPeriod.beginDate).format(DATE_TIMESTAMP),
                        to: moment(exclusionPeriod.endDate).format(DATE_TIMESTAMP),
                      };
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 1 other location - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 195..200

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

                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

                    exclusionPeriods: serviceHistory?.exclusionPeriods?.map(exclusionPeriod => {
                      return {
                        from: moment(exclusionPeriod.beginDate).format(DATE_TIMESTAMP),
                        to: moment(exclusionPeriod.endDate).format(DATE_TIMESTAMP),
                      };
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 1 other location - About 1 hr to fix
                src/applications/my-education-benefits/helpers.js on lines 201..206

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

                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 post911GiBillNote = (
                  <div className="usa-alert background-color-only">
                    <h3>You’re applying for the Post-9/11 GI Bill®</h3>
                    <p>
                      At this time, you can only apply for the Post-9/11 GI Bill (Chapter 33)
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 2 other locations - About 50 mins to fix
                src/applications/pre-need-integration/utils/helpers.js on lines 240..251
                src/applications/pre-need/utils/helpers.js on lines 155..166

                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

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

                    [formFields.viewUserFullName]: {
                      [formFields.userFullName]: {
                        first: firstName || undefined,
                        middle: middleName || undefined,
                        last: lastName || undefined,
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 35 mins to fix
                src/applications/my-education-benefits/helpers.js on lines 312..318
                src/applications/my-education-benefits/helpers.js on lines 441..447
                src/applications/my-education-benefits/helpers.js on lines 722..728
                src/applications/toe/helpers.jsx on lines 165..171
                src/applications/toe/helpers.jsx on lines 290..296

                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

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

                    [formFields.viewUserFullName]: {
                      [formFields.userFullName]: {
                        first: firstName || undefined,
                        middle: middleName || undefined,
                        last: lastName || undefined,
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 35 mins to fix
                src/applications/my-education-benefits/helpers.js on lines 441..447
                src/applications/my-education-benefits/helpers.js on lines 577..583
                src/applications/my-education-benefits/helpers.js on lines 722..728
                src/applications/toe/helpers.jsx on lines 165..171
                src/applications/toe/helpers.jsx on lines 290..296

                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

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

                    [formFields.viewUserFullName]: {
                      [formFields.userFullName]: {
                        first: firstName || undefined,
                        middle: middleName || undefined,
                        last: lastName || undefined,
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 35 mins to fix
                src/applications/my-education-benefits/helpers.js on lines 312..318
                src/applications/my-education-benefits/helpers.js on lines 577..583
                src/applications/my-education-benefits/helpers.js on lines 722..728
                src/applications/toe/helpers.jsx on lines 165..171
                src/applications/toe/helpers.jsx on lines 290..296

                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

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

                    [formFields.viewUserFullName]: {
                      [formFields.userFullName]: {
                        first: firstName || undefined,
                        middle: middleName || undefined,
                        last: lastName || undefined,
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 5 other locations - About 35 mins to fix
                src/applications/my-education-benefits/helpers.js on lines 312..318
                src/applications/my-education-benefits/helpers.js on lines 441..447
                src/applications/my-education-benefits/helpers.js on lines 577..583
                src/applications/toe/helpers.jsx on lines 165..171
                src/applications/toe/helpers.jsx on lines 290..296

                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 mapNotificationMethodV2({ notificationMethod }) {
                  if (notificationMethod === 'EMAIL') {
                    return 'No, just send me email notifications';
                  }
                  if (notificationMethod === 'TEXT') {
                Severity: Minor
                Found in src/applications/my-education-benefits/helpers.js and 1 other location - About 35 mins to fix
                src/applications/toe/helpers.jsx on lines 83..92

                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

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

                export function titleCase(str) {
                  return str[0].toUpperCase() + str.slice(1).toLowerCase();
                }
                Severity: Major
                Found in src/applications/my-education-benefits/helpers.js and 3 other locations - About 30 mins to fix
                src/applications/fry-dea/helpers.jsx on lines 17..19
                src/applications/survivor-dependent-education-benefit/22-5490/helpers.jsx on lines 19..21
                src/applications/toe/helpers.jsx on lines 16..18

                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