department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,821 of 12,821 total issues

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

const bankInfoHelpText = (
  <va-additional-info
    trigger="What if I don’t have a bank account?"
    onClick={gaBankInfoHelpText}
  >
src/applications/edu-benefits/1990/components/ShowDirectDepositDropdown.jsx on lines 31..50
src/applications/edu-benefits/5490/components/ShowDirectDepositDropdown.jsx on lines 31..50

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

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 getApiData = url => {
    isLoading(true);
    return apiRequest(url)
      .then(res => {
        setApiData(res.data);
Severity: Major
Found in src/applications/ask-va/containers/TopicSelectPage.jsx and 2 other locations - About 2 hrs to fix
src/applications/ask-va/containers/CategorySelectPage.jsx on lines 52..63
src/applications/ask-va/containers/SubTopicSelectPage.jsx on lines 37..48

Duplicated Code

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

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

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

Tuning

This issue has a mass of 86.

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 bankInfoHelpText = (
  <va-additional-info
    trigger="What if I don’t have a bank account?"
    onClick={gaBankInfoHelpText}
  >
src/applications/edu-benefits/10203/components/ShowDirectDepositDropdown.jsx on lines 31..50
src/applications/edu-benefits/1990/components/ShowDirectDepositDropdown.jsx on lines 31..50

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

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

      [`incidentDate${index}`]: {
        title: setReviewTitle(`${REVIEW_TITLE_TOKEN}event`, index, formType),
        path: `disabilities/ptsd-incident-date-${index}`,
        depends: isAnswering781Questions(index),
        uiSchema: incidentDate.uiSchema(index),
src/applications/disability-benefits/all-claims/config/781/index.js on lines 106..116
src/applications/disability-benefits/all-claims/config/781/index.js on lines 118..128
src/applications/disability-benefits/all-claims/config/781/index.js on lines 130..140
src/applications/disability-benefits/all-claims/config/781/index.js on lines 174..184
src/applications/disability-benefits/all-claims/config/781/index.js on lines 220..230
src/applications/disability-benefits/all-claims/config/781/index.js on lines 232..242
src/applications/disability-benefits/all-claims/config/781/index.js on lines 252..262

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

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

      [`secondaryIncidentUnitAssignment${index}`]: {
        title: setReviewTitle(
          `Unit assignment for${REVIEW_TITLE_TOKEN}event`,
          index,
          formType,
src/applications/disability-benefits/all-claims/config/781/index.js on lines 98..104
src/applications/disability-benefits/all-claims/config/781/index.js on lines 106..116
src/applications/disability-benefits/all-claims/config/781/index.js on lines 118..128
src/applications/disability-benefits/all-claims/config/781/index.js on lines 130..140
src/applications/disability-benefits/all-claims/config/781/index.js on lines 174..184
src/applications/disability-benefits/all-claims/config/781/index.js on lines 232..242
src/applications/disability-benefits/all-claims/config/781/index.js on lines 252..262

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

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

      [`individualsInvolved${index}`]: {
        title: setReviewTitle(
          `Were other people involved in the${REVIEW_TITLE_TOKEN}event?`,
          index,
          formType,
src/applications/disability-benefits/all-claims/config/781/index.js on lines 98..104
src/applications/disability-benefits/all-claims/config/781/index.js on lines 106..116
src/applications/disability-benefits/all-claims/config/781/index.js on lines 118..128
src/applications/disability-benefits/all-claims/config/781/index.js on lines 174..184
src/applications/disability-benefits/all-claims/config/781/index.js on lines 220..230
src/applications/disability-benefits/all-claims/config/781/index.js on lines 232..242
src/applications/disability-benefits/all-claims/config/781/index.js on lines 252..262

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

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

      [`incidentLocation${index}`]: {
        title: setReviewTitle(
          `Location of${REVIEW_TITLE_TOKEN}event`,
          index,
          formType,
src/applications/disability-benefits/all-claims/config/781/index.js on lines 98..104
src/applications/disability-benefits/all-claims/config/781/index.js on lines 106..116
src/applications/disability-benefits/all-claims/config/781/index.js on lines 130..140
src/applications/disability-benefits/all-claims/config/781/index.js on lines 174..184
src/applications/disability-benefits/all-claims/config/781/index.js on lines 220..230
src/applications/disability-benefits/all-claims/config/781/index.js on lines 232..242
src/applications/disability-benefits/all-claims/config/781/index.js on lines 252..262

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

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

      [`incidentDescription${index}`]: {
        title: setReviewTitle(
          `Description of${REVIEW_TITLE_TOKEN}event`,
          index,
          formType,
src/applications/disability-benefits/all-claims/config/781/index.js on lines 98..104
src/applications/disability-benefits/all-claims/config/781/index.js on lines 106..116
src/applications/disability-benefits/all-claims/config/781/index.js on lines 118..128
src/applications/disability-benefits/all-claims/config/781/index.js on lines 130..140
src/applications/disability-benefits/all-claims/config/781/index.js on lines 220..230
src/applications/disability-benefits/all-claims/config/781/index.js on lines 232..242
src/applications/disability-benefits/all-claims/config/781/index.js on lines 252..262

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

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

      [`secondaryIncidentLocation${index}`]: {
        title: setReviewTitle(
          `Location of${REVIEW_TITLE_TOKEN}event`,
          index,
          formType,
src/applications/disability-benefits/all-claims/config/781/index.js on lines 98..104
src/applications/disability-benefits/all-claims/config/781/index.js on lines 106..116
src/applications/disability-benefits/all-claims/config/781/index.js on lines 118..128
src/applications/disability-benefits/all-claims/config/781/index.js on lines 130..140
src/applications/disability-benefits/all-claims/config/781/index.js on lines 174..184
src/applications/disability-benefits/all-claims/config/781/index.js on lines 220..230
src/applications/disability-benefits/all-claims/config/781/index.js on lines 252..262

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

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

      [`incidentUnitAssignment${index}`]: {
        title: setReviewTitle(
          `Unit assignment for${REVIEW_TITLE_TOKEN}event`,
          index,
          formType,
src/applications/disability-benefits/all-claims/config/781/index.js on lines 98..104
src/applications/disability-benefits/all-claims/config/781/index.js on lines 118..128
src/applications/disability-benefits/all-claims/config/781/index.js on lines 130..140
src/applications/disability-benefits/all-claims/config/781/index.js on lines 174..184
src/applications/disability-benefits/all-claims/config/781/index.js on lines 220..230
src/applications/disability-benefits/all-claims/config/781/index.js on lines 232..242
src/applications/disability-benefits/all-claims/config/781/index.js on lines 252..262

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

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

      [`secondaryIncidentDescription${index}`]: {
        title: setReviewTitle(
          `Description of${REVIEW_TITLE_TOKEN}event`,
          index,
          formType,
src/applications/disability-benefits/all-claims/config/781/index.js on lines 98..104
src/applications/disability-benefits/all-claims/config/781/index.js on lines 106..116
src/applications/disability-benefits/all-claims/config/781/index.js on lines 118..128
src/applications/disability-benefits/all-claims/config/781/index.js on lines 130..140
src/applications/disability-benefits/all-claims/config/781/index.js on lines 174..184
src/applications/disability-benefits/all-claims/config/781/index.js on lines 220..230
src/applications/disability-benefits/all-claims/config/781/index.js on lines 232..242

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

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

  it('should show an error message specific to email format validation', () => {
    const errors = { addError: sinon.stub() };
    const value = 'name@email';
    emailValidation(errors, value, null, null, errorMessages);
    expect(errors.addError.calledWith(errorMessages.format)).to.be.true;
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 68..73
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 82..87
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 111..116
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 118..123

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

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 mask = value => {
  const number = (value || '').toString().slice(-4);
  return srSubstitute(
    `●●●–●●–${number}`,
    `ending with ${number.split('').join(' ')}`,
src/applications/appeals/shared/components/VeteranInformation.jsx on lines 19..25
src/applications/appeals/testing/nod-new/components/VeteranInformation.jsx on lines 28..34
src/applications/appeals/testing/sc/components/_MockVeteranInformation.jsx on lines 22..28
src/applications/disability-benefits/686c-674-v2/config/chapters/veteran-information/veteran-information/VeteranInformationComponent.jsx on lines 22..28

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

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 mask = value => {
  const number = (value || '').toString().slice(-4);
  return srSubstitute(
    `●●●–●●–${number}`,
    `ending with ${number.split('').join(' ')}`,
src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/VeteranInformation.jsx on lines 19..25
src/applications/appeals/shared/components/VeteranInformation.jsx on lines 19..25
src/applications/appeals/testing/nod-new/components/VeteranInformation.jsx on lines 28..34
src/applications/appeals/testing/sc/components/_MockVeteranInformation.jsx on lines 22..28

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

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 mask = value => {
  const number = (value || '').toString().slice(-4);
  return srSubstitute(
    `●●●–●●–${number}`,
    `ending with ${number.split('').join(' ')}`,
src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/VeteranInformation.jsx on lines 19..25
src/applications/appeals/shared/components/VeteranInformation.jsx on lines 19..25
src/applications/appeals/testing/nod-new/components/VeteranInformation.jsx on lines 28..34
src/applications/disability-benefits/686c-674-v2/config/chapters/veteran-information/veteran-information/VeteranInformationComponent.jsx on lines 22..28

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

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

  it('should show an error message specific to symbol validation', () => {
    const errors = { addError: sinon.stub() };
    const value = 'email[]@name.com';
    symbolsValidation(errors, value, null, null, errorMessages);
    expect(errors.addError.calledWith(errorMessages.symbols)).to.be.true;
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 75..80
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 82..87
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 111..116
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 118..123

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

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

  it('should show an error message specific to name symbol validation', () => {
    const errors = { addError: sinon.stub() };
    const value = 'The "name"';
    validateNameSymbols(errors, value, null, null, errorMessages);
    expect(errors.addError.calledWithMatch(errorMessages.symbols)).to.be.true;
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 68..73
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 75..80
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 82..87
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 111..116

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

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 mask = value => {
    const number = (value || '').toString().slice(-4);
    return srSubstitute(
      `●●●–●●–${number}`,
      `ending with ${number.split('').join(' ')}`,
src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/VeteranInformation.jsx on lines 19..25
src/applications/appeals/shared/components/VeteranInformation.jsx on lines 19..25
src/applications/appeals/testing/sc/components/_MockVeteranInformation.jsx on lines 22..28
src/applications/disability-benefits/686c-674-v2/config/chapters/veteran-information/veteran-information/VeteranInformationComponent.jsx on lines 22..28

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

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 mask = value => {
  const number = (value || '').toString().slice(-4);
  return srSubstitute(
    `●●●–●●–${number}`,
    `ending with ${number.split('').join(' ')}`,
src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/VeteranInformation.jsx on lines 19..25
src/applications/appeals/testing/nod-new/components/VeteranInformation.jsx on lines 28..34
src/applications/appeals/testing/sc/components/_MockVeteranInformation.jsx on lines 22..28
src/applications/disability-benefits/686c-674-v2/config/chapters/veteran-information/veteran-information/VeteranInformationComponent.jsx on lines 22..28

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

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

  it('should show an error message specific to name symbol validation', () => {
    const errors = { addError: sinon.stub() };
    const value = 'Oops;';
    validateNameSymbols(errors, value, null, null, errorMessages);
    expect(errors.addError.calledWithMatch(errorMessages.symbols)).to.be.true;
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 68..73
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 75..80
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 82..87
src/platform/forms-system/src/js/web-component-tests/validations.unit.spec.js on lines 118..123

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

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