department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

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

        spouseMarriageHistoryDetailsPartFive: {
          depends: formData =>
            isChapterFieldRequired(formData, TASK_KEYS.addSpouse) &&
            formData?.spouseWasMarriedBefore,
          title:
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 299..311
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 312..324
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 325..337
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 338..350
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 393..404
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 405..416
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 417..428
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 429..441
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 442..453

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

        veteranMarriageHistoryDetailsPartFour: {
          depends: formData =>
            isChapterFieldRequired(formData, TASK_KEYS.addSpouse) &&
            formData?.veteranWasMarriedBefore,
          title:
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 299..311
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 312..324
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 325..337
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 338..350
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 351..363
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 393..404
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 405..416
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 417..428
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 442..453

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

        spouseMarriageHistoryDetailsPartFour: {
          depends: formData =>
            isChapterFieldRequired(formData, TASK_KEYS.addSpouse) &&
            formData?.spouseWasMarriedBefore,
          title:
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 299..311
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 312..324
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 325..337
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 351..363
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 393..404
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 405..416
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 417..428
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 429..441
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 442..453

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

        veteranMarriageHistoryDetailsPartTwo: {
          depends: formData =>
            isChapterFieldRequired(formData, TASK_KEYS.addSpouse) &&
            formData?.veteranWasMarriedBefore,
          title:
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 299..311
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 312..324
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 325..337
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 338..350
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 351..363
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 393..404
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 417..428
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 429..441
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 442..453

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

        spouseMarriageHistoryDetailsPartTwo: {
          depends: formData =>
            isChapterFieldRequired(formData, TASK_KEYS.addSpouse) &&
            formData?.spouseWasMarriedBefore,
          title:
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 299..311
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 325..337
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 338..350
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 351..363
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 393..404
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 405..416
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 417..428
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 429..441
src/applications/disability-benefits/686c-674-v2/config/form.js on lines 442..453

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

          <ButtonGroup
            buttons={[
              {
                label: 'Cancel',
                onClick: handlers.onCancel, // Define this function based on page-specific logic
src/applications/financial-status-report/components/householdIncome/AddIncome.jsx on lines 137..150
src/applications/financial-status-report/components/householdIncome/SpouseAddIncome.jsx on lines 143..156
src/applications/financial-status-report/components/otherAssets/AddAsset.jsx on lines 151..164
src/applications/financial-status-report/components/otherExpenses/AddOtherExpense.jsx on lines 142..155

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

  [CTA_WIDGET_TYPES.VETERAN_ID_CARD]: {
    id: CTA_WIDGET_TYPES.VETERAN_ID_CARD,
    deriveToolUrlDetails: () => ({
      url: '/records/get-veteran-id-cards/apply',
      redirect: false,
Severity: Major
Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 108..119
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 132..143
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 218..229
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 306..318

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

            <ButtonGroup
              buttons={[
                {
                  label: 'Cancel',
                  onClick: handlers.onCancel, // Define this function based on page-specific logic
src/applications/financial-status-report/components/householdIncome/AddIncome.jsx on lines 137..150
src/applications/financial-status-report/components/householdIncome/SpouseAddIncome.jsx on lines 143..156
src/applications/financial-status-report/components/otherAssets/AddAsset.jsx on lines 151..164
src/applications/financial-status-report/components/utilityBills/AddUtilityBill.jsx on lines 131..144

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

  [CTA_WIDGET_TYPES.DISABILITY_BENEFITS]: {
    id: CTA_WIDGET_TYPES.DISABILITY_BENEFITS,
    deriveToolUrlDetails: () => ({
      url: '/disability/how-to-file-claim',
      redirect: false,
Severity: Major
Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 132..143
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 218..229
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 294..305
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 306..318

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

  [CTA_WIDGET_TYPES.VET_TEC]: {
    id: CTA_WIDGET_TYPES.VET_TEC,
    deriveToolUrlDetails: () => ({
      url:
        '/education/about-gi-bill-benefits/how-to-use-benefits/vettec-high-tech-program/apply-for-vettec-form-22-0994',
Severity: Major
Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 108..119
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 132..143
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 218..229
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 294..305

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

  [CTA_WIDGET_TYPES.LETTERS]: {
    id: CTA_WIDGET_TYPES.LETTERS,
    deriveToolUrlDetails: () => ({
      url: '/records/download-va-letters/letters',
      redirect: false,
Severity: Major
Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 108..119
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 132..143
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 294..305
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 306..318

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

          <ButtonGroup
            buttons={[
              {
                label: 'Cancel',
                onClick: handlers.onCancel, // Define this function based on page-specific logic
src/applications/financial-status-report/components/householdIncome/SpouseAddIncome.jsx on lines 143..156
src/applications/financial-status-report/components/otherAssets/AddAsset.jsx on lines 151..164
src/applications/financial-status-report/components/otherExpenses/AddOtherExpense.jsx on lines 142..155
src/applications/financial-status-report/components/utilityBills/AddUtilityBill.jsx on lines 131..144

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

          <ButtonGroup
            buttons={[
              {
                label: 'Cancel',
                onClick: handlers.onCancel, // Define this function based on page-specific logic
src/applications/financial-status-report/components/householdIncome/AddIncome.jsx on lines 137..150
src/applications/financial-status-report/components/householdIncome/SpouseAddIncome.jsx on lines 143..156
src/applications/financial-status-report/components/otherExpenses/AddOtherExpense.jsx on lines 142..155
src/applications/financial-status-report/components/utilityBills/AddUtilityBill.jsx on lines 131..144

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

          <ButtonGroup
            buttons={[
              {
                label: 'Cancel',
                onClick: handlers.onCancel, // Define this function based on page-specific logic
src/applications/financial-status-report/components/householdIncome/AddIncome.jsx on lines 137..150
src/applications/financial-status-report/components/otherAssets/AddAsset.jsx on lines 151..164
src/applications/financial-status-report/components/otherExpenses/AddOtherExpense.jsx on lines 142..155
src/applications/financial-status-report/components/utilityBills/AddUtilityBill.jsx on lines 131..144

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

  [CTA_WIDGET_TYPES.GI_BILL_BENEFITS]: {
    id: CTA_WIDGET_TYPES.GI_BILL_BENEFITS,
    deriveToolUrlDetails: () => ({
      url: '/education/gi-bill/post-9-11/ch-33-benefit/status',
      redirect: false,
Severity: Major
Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 108..119
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 218..229
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 294..305
src/applications/static-pages/cta-widget/ctaWidgets.js on lines 306..318

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

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

export const recordAnalyticsEvent = (
  trackingPrefix,
  type,
  label,
  value,
src/applications/coronavirus-research/update/config/formHelper.js on lines 79..93

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

    withExpired: () => {
      const data = preCheckInData.get.createMockSuccessResponse(
        preCheckInData.get.expiredUUID,
      );
      cy.intercept('GET', '/check_in/v2/pre_check_ins/*', req => {
src/applications/check-in/api/local-mock-api/e2e/ApiInitializer.js on lines 175..183
src/applications/check-in/api/local-mock-api/e2e/ApiInitializer.js on lines 184..192
src/applications/check-in/api/local-mock-api/e2e/ApiInitializer.js on lines 202..210

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

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

        `VA-medications-list-${
          userName.first ? `${userName.first}-${userName.last}` : userName.last
        }-${dateFormat(Date.now(), 'M-D-YYYY_hmmssa').replace(/\./g, '')}`,
src/applications/mhv-medications/containers/Prescriptions.jsx on lines 331..333

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

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

  useEffect(
    () => {
      if (hasError) {
        recordEvent({
          event: 'visible-alert-box',
src/applications/appeals/995/components/EvidencePrivateRecordsAuthorization.jsx on lines 27..44

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

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

      <p>
        If you have questions or need help filling out this form, call us at{' '}
        <va-telephone contact={CONTACTS.VA_BENEFITS} />. We’re here Monday
        through Friday, 8:00 a.m. to 9:00 p.m.{' '}
        <dfn>
Severity: Major
Found in src/applications/appeals/shared/content/NeedHelp.jsx and 1 other location - About 1 hr to fix
src/applications/appeals/testing/hlr/content/NeedHelp.jsx on lines 16..24

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

Severity
Category
Status
Source
Language