department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,841 of 12,841 total issues

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/toe/helpers.jsx 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/my-education-benefits/helpers.js on lines 734..743
src/applications/toe/helpers.jsx on lines 177..186

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

const debug = (message, status = 'info') => {
  const statusLookup = {
    warn,
    error,
    info,
src/applications/personalization/profile/mocks/script/utils.js on lines 22..32
src/applications/representative-appoint/mocks/script/utils.js on lines 22..32

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

        nonVeteranIdentificationInformationPage: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.NON_VETERAN ||
            formData.preparerType === PREPARER_TYPES.THIRD_PARTY_NON_VETERAN,
          path: 'non-veteran-identification-information',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 149..158
src/applications/simple-forms/20-10207/config/form.js on lines 159..168
src/applications/simple-forms/20-10207/config/form.js on lines 169..178
src/applications/simple-forms/20-10207/config/form.js on lines 194..203
src/applications/simple-forms/20-10207/config/form.js on lines 329..338
src/applications/simple-forms/20-10207/config/form.js on lines 339..348
src/applications/simple-forms/20-10207/config/form.js on lines 386..395
src/applications/simple-forms/20-10207/config/form.js on lines 396..405

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

        veteranIdentificationInformationPageB: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.NON_VETERAN ||
            formData.preparerType === PREPARER_TYPES.THIRD_PARTY_NON_VETERAN,
          path: 'veteran-identification-information-b',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 149..158
src/applications/simple-forms/20-10207/config/form.js on lines 159..168
src/applications/simple-forms/20-10207/config/form.js on lines 169..178
src/applications/simple-forms/20-10207/config/form.js on lines 179..188
src/applications/simple-forms/20-10207/config/form.js on lines 194..203
src/applications/simple-forms/20-10207/config/form.js on lines 329..338
src/applications/simple-forms/20-10207/config/form.js on lines 339..348
src/applications/simple-forms/20-10207/config/form.js on lines 386..395

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

        livingSituationPage: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.VETERAN ||
            formData.preparerType === PREPARER_TYPES.NON_VETERAN,
          path: 'living-situation',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 149..158
src/applications/simple-forms/20-10207/config/form.js on lines 159..168
src/applications/simple-forms/20-10207/config/form.js on lines 169..178
src/applications/simple-forms/20-10207/config/form.js on lines 179..188
src/applications/simple-forms/20-10207/config/form.js on lines 329..338
src/applications/simple-forms/20-10207/config/form.js on lines 339..348
src/applications/simple-forms/20-10207/config/form.js on lines 386..395
src/applications/simple-forms/20-10207/config/form.js on lines 396..405

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

        veteranNameAndDateOfBirthPageB: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.NON_VETERAN ||
            formData.preparerType === PREPARER_TYPES.THIRD_PARTY_NON_VETERAN,
          path: 'veteran-name-and-date-of-birth-b',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 149..158
src/applications/simple-forms/20-10207/config/form.js on lines 159..168
src/applications/simple-forms/20-10207/config/form.js on lines 169..178
src/applications/simple-forms/20-10207/config/form.js on lines 179..188
src/applications/simple-forms/20-10207/config/form.js on lines 194..203
src/applications/simple-forms/20-10207/config/form.js on lines 329..338
src/applications/simple-forms/20-10207/config/form.js on lines 339..348
src/applications/simple-forms/20-10207/config/form.js on lines 396..405

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

        nonVeteranPhoneAndEmailPage: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.NON_VETERAN ||
            formData.preparerType === PREPARER_TYPES.THIRD_PARTY_NON_VETERAN,
          path: 'non-veteran-phone-and-email',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 149..158
src/applications/simple-forms/20-10207/config/form.js on lines 159..168
src/applications/simple-forms/20-10207/config/form.js on lines 169..178
src/applications/simple-forms/20-10207/config/form.js on lines 179..188
src/applications/simple-forms/20-10207/config/form.js on lines 194..203
src/applications/simple-forms/20-10207/config/form.js on lines 329..338
src/applications/simple-forms/20-10207/config/form.js on lines 386..395
src/applications/simple-forms/20-10207/config/form.js on lines 396..405

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

const debug = (message, status = 'info') => {
  const statusLookup = {
    warn,
    error,
    info,
src/applications/_mock-form-ae-design-patterns/mocks/script/utils.js on lines 23..33
src/applications/representative-appoint/mocks/script/utils.js on lines 22..32

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

        veteranNameAndDateOfBirthPageA: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.VETERAN ||
            formData.preparerType === PREPARER_TYPES.THIRD_PARTY_VETERAN,
          path: 'veteran-name-and-date-of-birth-a',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 159..168
src/applications/simple-forms/20-10207/config/form.js on lines 169..178
src/applications/simple-forms/20-10207/config/form.js on lines 179..188
src/applications/simple-forms/20-10207/config/form.js on lines 194..203
src/applications/simple-forms/20-10207/config/form.js on lines 329..338
src/applications/simple-forms/20-10207/config/form.js on lines 339..348
src/applications/simple-forms/20-10207/config/form.js on lines 386..395
src/applications/simple-forms/20-10207/config/form.js on lines 396..405

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

        veteranIdentificationInformationPageA: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.VETERAN ||
            formData.preparerType === PREPARER_TYPES.THIRD_PARTY_VETERAN,
          path: 'veteran-identification-information-a',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 149..158
src/applications/simple-forms/20-10207/config/form.js on lines 159..168
src/applications/simple-forms/20-10207/config/form.js on lines 179..188
src/applications/simple-forms/20-10207/config/form.js on lines 194..203
src/applications/simple-forms/20-10207/config/form.js on lines 329..338
src/applications/simple-forms/20-10207/config/form.js on lines 339..348
src/applications/simple-forms/20-10207/config/form.js on lines 386..395
src/applications/simple-forms/20-10207/config/form.js on lines 396..405

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

        veteranPhoneAndEmailPage: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.VETERAN ||
            formData.preparerType === PREPARER_TYPES.THIRD_PARTY_VETERAN,
          path: 'veteran-phone-and-email',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 149..158
src/applications/simple-forms/20-10207/config/form.js on lines 159..168
src/applications/simple-forms/20-10207/config/form.js on lines 169..178
src/applications/simple-forms/20-10207/config/form.js on lines 179..188
src/applications/simple-forms/20-10207/config/form.js on lines 194..203
src/applications/simple-forms/20-10207/config/form.js on lines 339..348
src/applications/simple-forms/20-10207/config/form.js on lines 386..395
src/applications/simple-forms/20-10207/config/form.js on lines 396..405

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

const debug = (message, status = 'info') => {
  const statusLookup = {
    warn,
    error,
    info,
src/applications/_mock-form-ae-design-patterns/mocks/script/utils.js on lines 23..33
src/applications/personalization/profile/mocks/script/utils.js on lines 22..32

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

        nonVeteranNameAndDateOfBirthPage: {
          depends: formData =>
            formData.preparerType === PREPARER_TYPES.NON_VETERAN ||
            formData.preparerType === PREPARER_TYPES.THIRD_PARTY_NON_VETERAN,
          path: 'non-veteran-name-and-date-of-birth',
Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js and 8 other locations - About 2 hrs to fix
src/applications/simple-forms/20-10207/config/form.js on lines 149..158
src/applications/simple-forms/20-10207/config/form.js on lines 169..178
src/applications/simple-forms/20-10207/config/form.js on lines 179..188
src/applications/simple-forms/20-10207/config/form.js on lines 194..203
src/applications/simple-forms/20-10207/config/form.js on lines 329..338
src/applications/simple-forms/20-10207/config/form.js on lines 339..348
src/applications/simple-forms/20-10207/config/form.js on lines 386..395
src/applications/simple-forms/20-10207/config/form.js on lines 396..405

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

  const getDebts = () => {
    const options = {
      method: 'GET',
      credentials: 'include',
      headers: {
Severity: Major
Found in src/applications/personalization/dashboard/actions/debts.js and 4 other locations - About 2 hrs to fix
src/applications/financial-status-report/actions/index.js on lines 63..75
src/applications/personalization/common/actions/notifications.js on lines 16..31
src/applications/personalization/dashboard/actions/debts.js on lines 90..102
src/applications/personalization/dashboard/actions/form-status.js on lines 14..29

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

const getForms = () => {
  const options = {
    method: 'GET',
    credentials: 'include',
    headers: {
src/applications/financial-status-report/actions/index.js on lines 63..75
src/applications/personalization/common/actions/notifications.js on lines 16..31
src/applications/personalization/dashboard/actions/debts.js on lines 26..38
src/applications/personalization/dashboard/actions/debts.js on lines 90..102

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

  const getDebts = () => {
    const options = {
      method: 'GET',
      credentials: 'include',
      headers: {
Severity: Major
Found in src/applications/financial-status-report/actions/index.js and 4 other locations - About 2 hrs to fix
src/applications/personalization/common/actions/notifications.js on lines 16..31
src/applications/personalization/dashboard/actions/debts.js on lines 26..38
src/applications/personalization/dashboard/actions/debts.js on lines 90..102
src/applications/personalization/dashboard/actions/form-status.js on lines 14..29

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

  const getNotifications = () => {
    const options = {
      method: 'GET',
      credentials: 'include',
      headers: {
src/applications/financial-status-report/actions/index.js on lines 63..75
src/applications/personalization/dashboard/actions/debts.js on lines 26..38
src/applications/personalization/dashboard/actions/debts.js on lines 90..102
src/applications/personalization/dashboard/actions/form-status.js on lines 14..29

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

  const getCopays = () => {
    const options = {
      method: 'GET',
      credentials: 'include',
      headers: {
Severity: Major
Found in src/applications/personalization/dashboard/actions/debts.js and 4 other locations - About 2 hrs to fix
src/applications/financial-status-report/actions/index.js on lines 63..75
src/applications/personalization/common/actions/notifications.js on lines 16..31
src/applications/personalization/dashboard/actions/debts.js on lines 26..38
src/applications/personalization/dashboard/actions/form-status.js on lines 14..29

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

const mapStateToProps = state => ({
  supplies: state.form?.data?.supplies,
  formData: state.form?.data,
  order: state.form?.data?.order,
  eligibility: state.form?.data?.eligibility,
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 246..251
src/applications/health-care-supply-reordering/components/Accessories.jsx on lines 229..234
src/applications/health-care-supply-reordering/components/ApneaSupplies.jsx on lines 233..238

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

  useEffect(
    () => {
      if (!loggedIn || isLoadingFeatureFlags) {
        return;
      }
src/applications/appeals/shared/utils/useBrowserMonitoring.js on lines 92..107

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

Severity
Category
Status
Source
Language