department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,717 of 12,717 total issues

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

            <div
              key={batterySupply.productId}
              className={classnames({
                'vads-u-background-color--gray-lightest vads-u-margin-bottom--2 vads-u-margin-top--3': true,
                'vads-u-border-color--primary vads-u-border--3px vads-u-padding--21 dd-privacy-mask': isBatterySelected(
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 101..172
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 153..169
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 101..184
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 155..168
src/applications/disability-benefits/2346/components/Batteries.jsx on lines 109..190
src/applications/health-care-supply-reordering/components/Accessories.jsx on lines 103..155
src/applications/health-care-supply-reordering/components/ApneaSupplies.jsx on lines 103..170

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

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

                  <label
                    htmlFor={accessorySupply.productId}
                    className={classnames({
                      'usa-button vads-u-font-weight--bold vads-u-border--2px vads-u-border-color--primary vads-u-text-align--left vads-u-padding-x--2': true,
                      'vads-u-color--white': isAccessorySelected(
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 101..172
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 101..184
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 155..168
src/applications/disability-benefits/2346/components/Batteries.jsx on lines 109..190
src/applications/health-care-supply-reordering/components/Accessories.jsx on lines 103..155
src/applications/health-care-supply-reordering/components/ApneaSupplies.jsx on lines 103..170
src/applications/health-care-supply-reordering/components/Batteries.jsx on lines 111..173

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

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

            <div
              key={apneaSupply.productId}
              className={classnames({
                'vads-u-background-color--gray-lightest vads-u-margin-y--3': true,
                'vads-u-border-color--primary vads-u-border--3px vads-u-padding--21': isApneaSupplySelected(
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 101..172
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 153..169
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 101..184
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 155..168
src/applications/disability-benefits/2346/components/Batteries.jsx on lines 109..190
src/applications/health-care-supply-reordering/components/Accessories.jsx on lines 103..155
src/applications/health-care-supply-reordering/components/Batteries.jsx on lines 111..173

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

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

            <div
              key={accessorySupply.productId}
              className={classnames({
                'vads-u-background-color--gray-lightest vads-u-margin-y--3': true,
                'vads-u-border-color--primary vads-u-border--3px vads-u-padding--21 dd-privacy-mask': isAccessorySelected(
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 101..172
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 153..169
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 101..184
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 155..168
src/applications/disability-benefits/2346/components/Batteries.jsx on lines 109..190
src/applications/health-care-supply-reordering/components/ApneaSupplies.jsx on lines 103..170
src/applications/health-care-supply-reordering/components/Batteries.jsx on lines 111..173

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

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

            <div
              key={accessorySupply.productId}
              className={classnames({
                'vads-u-background-color--gray-lightest vads-u-margin-y--3': true,
                'vads-u-border-color--primary vads-u-border--3px vads-u-padding--21 dd-privacy-mask': isAccessorySelected(
src/applications/disability-benefits/2346/components/Accessories.jsx on lines 153..169
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 101..184
src/applications/disability-benefits/2346/components/ApneaSupplies.jsx on lines 155..168
src/applications/disability-benefits/2346/components/Batteries.jsx on lines 109..190
src/applications/health-care-supply-reordering/components/Accessories.jsx on lines 103..155
src/applications/health-care-supply-reordering/components/ApneaSupplies.jsx on lines 103..170
src/applications/health-care-supply-reordering/components/Batteries.jsx on lines 111..173

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

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

      {thursday && (
        <div className="row">
          <div className="small-6 columns">Thursday:</div>
          <div className="small-6 columns">{thursday}</div>
        </div>
src/applications/facility-locator/components/LocationHours.jsx on lines 34..39
src/applications/facility-locator/components/LocationHours.jsx on lines 42..47
src/applications/facility-locator/components/LocationHours.jsx on lines 50..55
src/applications/facility-locator/components/LocationHours.jsx on lines 58..63
src/applications/facility-locator/components/LocationHours.jsx on lines 74..79
src/applications/facility-locator/components/LocationHours.jsx on lines 82..87

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

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

      {monday && (
        <div className="row">
          <div className="small-6 columns">Monday:</div>
          <div className="small-6 columns">{monday}</div>
        </div>
src/applications/facility-locator/components/LocationHours.jsx on lines 34..39
src/applications/facility-locator/components/LocationHours.jsx on lines 50..55
src/applications/facility-locator/components/LocationHours.jsx on lines 58..63
src/applications/facility-locator/components/LocationHours.jsx on lines 66..71
src/applications/facility-locator/components/LocationHours.jsx on lines 74..79
src/applications/facility-locator/components/LocationHours.jsx on lines 82..87

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

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

      {friday && (
        <div className="row">
          <div className="small-6 columns">Friday:</div>
          <div className="small-6 columns">{friday}</div>
        </div>
src/applications/facility-locator/components/LocationHours.jsx on lines 34..39
src/applications/facility-locator/components/LocationHours.jsx on lines 42..47
src/applications/facility-locator/components/LocationHours.jsx on lines 50..55
src/applications/facility-locator/components/LocationHours.jsx on lines 58..63
src/applications/facility-locator/components/LocationHours.jsx on lines 66..71
src/applications/facility-locator/components/LocationHours.jsx on lines 82..87

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

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

      {sunday && (
        <div className="row">
          <div className="small-6 columns">Sunday:</div>
          <div className="small-6 columns">{sunday}</div>
        </div>
src/applications/facility-locator/components/LocationHours.jsx on lines 42..47
src/applications/facility-locator/components/LocationHours.jsx on lines 50..55
src/applications/facility-locator/components/LocationHours.jsx on lines 58..63
src/applications/facility-locator/components/LocationHours.jsx on lines 66..71
src/applications/facility-locator/components/LocationHours.jsx on lines 74..79
src/applications/facility-locator/components/LocationHours.jsx on lines 82..87

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

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

      {tuesday && (
        <div className="row">
          <div className="small-6 columns">Tuesday:</div>
          <div className="small-6 columns">{tuesday}</div>
        </div>
src/applications/facility-locator/components/LocationHours.jsx on lines 34..39
src/applications/facility-locator/components/LocationHours.jsx on lines 42..47
src/applications/facility-locator/components/LocationHours.jsx on lines 58..63
src/applications/facility-locator/components/LocationHours.jsx on lines 66..71
src/applications/facility-locator/components/LocationHours.jsx on lines 74..79
src/applications/facility-locator/components/LocationHours.jsx on lines 82..87

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

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

      {saturday && (
        <div className="row">
          <div className="small-6 columns">Saturday:</div>
          <div className="small-6 columns">{saturday}</div>
        </div>
src/applications/facility-locator/components/LocationHours.jsx on lines 34..39
src/applications/facility-locator/components/LocationHours.jsx on lines 42..47
src/applications/facility-locator/components/LocationHours.jsx on lines 50..55
src/applications/facility-locator/components/LocationHours.jsx on lines 58..63
src/applications/facility-locator/components/LocationHours.jsx on lines 66..71
src/applications/facility-locator/components/LocationHours.jsx on lines 74..79

Duplicated Code

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

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

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

Tuning

This issue has a mass of 61.

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

      {wednesday && (
        <div className="row">
          <div className="small-6 columns">Wednesday:</div>
          <div className="small-6 columns">{wednesday}</div>
        </div>
src/applications/facility-locator/components/LocationHours.jsx on lines 34..39
src/applications/facility-locator/components/LocationHours.jsx on lines 42..47
src/applications/facility-locator/components/LocationHours.jsx on lines 50..55
src/applications/facility-locator/components/LocationHours.jsx on lines 66..71
src/applications/facility-locator/components/LocationHours.jsx on lines 74..79
src/applications/facility-locator/components/LocationHours.jsx on lines 82..87

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

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

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

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

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

Refactorings

Further Reading

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

  'GET /vaos/v2/epsApi/provider-services/:providerServiceId': (req, res) => {
    return res.json({
      data: providerServices.providerServices.find(
        providerService => providerService?.id === req.params.providerServiceId,
      ),
Severity: Major
Found in src/applications/vaos/services/mocks/index.js and 5 other locations - About 1 hr to fix
src/applications/vaos/services/mocks/index.js on lines 589..595
src/applications/vaos/services/mocks/index.js on lines 599..605
src/applications/vaos/services/mocks/index.js on lines 609..615
src/applications/vaos/services/mocks/index.js on lines 629..638
src/applications/vaos/services/mocks/index.js on lines 655..661

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

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

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

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

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

Refactorings

Further Reading

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

export const isValidDate = dateString => {
  let isValid = true;
  const errors = {
    addError: () => {
      isValid = false;
Severity: Major
Found in src/applications/appeals/10182/validations/date.js and 5 other locations - About 1 hr to fix
src/applications/appeals/995/validations/date.js on lines 46..55
src/applications/appeals/996/validations/date.js on lines 30..39
src/applications/appeals/testing/hlr/validations/date.js on lines 30..39
src/applications/appeals/testing/sc/validations/date.js on lines 46..55
src/applications/appeals/testing/sc/validations/date.js on lines 87..96

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

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

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

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

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

Refactorings

Further Reading

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

export const OAUTH_KEYS = {
  CLIENT_ID: 'client_id',
  CODE_CHALLENGE: 'code_challenge',
  CODE_CHALLENGE_METHOD: 'code_challenge_method',
  REDIRECT_URI: 'redirect_uri',
Severity: Major
Found in src/platform/utilities/oauth/constants.js and 5 other locations - About 1 hr to fix
src/applications/ask-va/config/schema-helpers/formFlowHelper.js on lines 49..68
src/applications/mhv-medical-records/util/constants.js on lines 233..244
src/applications/mhv-medications/util/constants.js on lines 156..167
src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskRed/shared/constants.js on lines 1..12
src/applications/lgy/coe/shared/constants.js on lines 1..12

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

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

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

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

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

Refactorings

Further Reading

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

export const Paths = {
  MYHEALTH: '/my-health',
  MR_LANDING_PAGE: '/',
  LABS_AND_TESTS: '/labs-and-tests/',
  CARE_SUMMARIES_AND_NOTES: '/summaries-and-notes/',
Severity: Major
Found in src/applications/mhv-medical-records/util/constants.js and 5 other locations - About 1 hr to fix
src/applications/ask-va/config/schema-helpers/formFlowHelper.js on lines 49..68
src/applications/mhv-medications/util/constants.js on lines 156..167
src/platform/utilities/oauth/constants.js on lines 40..51
src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskRed/shared/constants.js on lines 1..12
src/applications/lgy/coe/shared/constants.js on lines 1..12

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

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

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

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

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

Refactorings

Further Reading

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

export const isValidDate = dateString => {
  let isValid = true;
  const errors = {
    addError: () => {
      isValid = false;
Severity: Major
Found in src/applications/appeals/995/validations/date.js and 5 other locations - About 1 hr to fix
src/applications/appeals/10182/validations/date.js on lines 31..40
src/applications/appeals/996/validations/date.js on lines 30..39
src/applications/appeals/testing/hlr/validations/date.js on lines 30..39
src/applications/appeals/testing/sc/validations/date.js on lines 46..55
src/applications/appeals/testing/sc/validations/date.js on lines 87..96

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

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

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

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

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

Refactorings

Further Reading

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

export const ACTIONS = {
  DELETE_FILE: 'DELETE_FILE',
  DOC_DESC: 'DOC_DESC',
  DOC_TYPE: 'DOC_TYPE',
  FILE_DESCRIPTION_REQUIRED: 'FILE_DESCRIPTION_REQUIRED',
src/applications/ask-va/config/schema-helpers/formFlowHelper.js on lines 49..68
src/applications/mhv-medical-records/util/constants.js on lines 233..244
src/applications/mhv-medications/util/constants.js on lines 156..167
src/platform/utilities/oauth/constants.js on lines 40..51
src/applications/lgy/coe/shared/constants.js on lines 1..12

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

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

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

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

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

Refactorings

Further Reading

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

  'GET /vaos/v2/epsApi/networks/:networkId': (req, res) => {
    return res.json({
      data: epsNetworks.networks.find(
        network => network?.id === req.params.networkId,
      ),
Severity: Major
Found in src/applications/vaos/services/mocks/index.js and 5 other locations - About 1 hr to fix
src/applications/vaos/services/mocks/index.js on lines 599..605
src/applications/vaos/services/mocks/index.js on lines 609..615
src/applications/vaos/services/mocks/index.js on lines 622..628
src/applications/vaos/services/mocks/index.js on lines 629..638
src/applications/vaos/services/mocks/index.js on lines 655..661

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

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

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

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

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

Refactorings

Further Reading

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

  'GET /vaos/v2/epsApi/referrals/:referralId': (req, res) => {
    return res.json({
      data: referrals.referrals.find(
        referral => referral?.id === req.params.referralId,
      ),
Severity: Major
Found in src/applications/vaos/services/mocks/index.js and 5 other locations - About 1 hr to fix
src/applications/vaos/services/mocks/index.js on lines 589..595
src/applications/vaos/services/mocks/index.js on lines 599..605
src/applications/vaos/services/mocks/index.js on lines 609..615
src/applications/vaos/services/mocks/index.js on lines 622..628
src/applications/vaos/services/mocks/index.js on lines 629..638

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

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