department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,852 of 12,852 total issues

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

export async function getData(apiRoute, options) {
  try {
    const response = await apiRequest(apiRoute, options);
    return response.data.attributes;
  } catch (error) {
src/applications/disability-benefits/686c-674-v2/config/utilities.js on lines 19..26
src/applications/disability-benefits/686c-674/config/utilities.js on lines 18..25
src/applications/disability-benefits/686c-674/util/index.js on lines 6..13
src/applications/personalization/view-dependents/util/index.js on lines 10..17
src/applications/rated-disabilities/util/index.js on lines 7..14
src/platform/user/profile/utilities/index.js on lines 165..172

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

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

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

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

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

Refactorings

Further Reading

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

export async function getData(apiRoute, options) {
  try {
    const response = await apiRequest(apiRoute, options);
    return response.data.attributes;
  } catch (error) {
src/applications/disability-benefits/686c-674-v2/config/utilities.js on lines 19..26
src/applications/disability-benefits/686c-674-v2/utils/index.js on lines 6..13
src/applications/disability-benefits/686c-674/config/utilities.js on lines 18..25
src/applications/disability-benefits/686c-674/util/index.js on lines 6..13
src/applications/rated-disabilities/util/index.js on lines 7..14
src/platform/user/profile/utilities/index.js on lines 165..172

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

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

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

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

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

Refactorings

Further Reading

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

export function validateName(errors, pageData) {
  const { first, last } = pageData;
  validateWhiteSpace(errors.first, first);
  validateWhiteSpace(errors.last, last);
}
src/applications/pre-need-integration/definitions/fullName.js on lines 3..7
src/applications/pre-need/definitions/fullName.js on lines 3..7
src/platform/forms/definitions/fullName.js on lines 3..7

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

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

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

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

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

Refactorings

Further Reading

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

export function validateName(errors, pageData) {
  const { first, last } = pageData;
  validateWhiteSpace(errors.first, first);
  validateWhiteSpace(errors.last, last);
}
Severity: Major
Found in src/applications/pre-need/definitions/fullName.js and 3 other locations - About 1 hr to fix
src/applications/edu-benefits/definitions/sponsorFullName.js on lines 3..7
src/applications/pre-need-integration/definitions/fullName.js on lines 3..7
src/platform/forms/definitions/fullName.js on lines 3..7

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

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

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

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

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

Refactorings

Further Reading

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

export function validateName(errors, pageData) {
  const { first, last } = pageData;
  validateWhiteSpace(errors.first, first);
  validateWhiteSpace(errors.last, last);
}
src/applications/edu-benefits/definitions/sponsorFullName.js on lines 3..7
src/applications/pre-need/definitions/fullName.js on lines 3..7
src/platform/forms/definitions/fullName.js on lines 3..7

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

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

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

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

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

Refactorings

Further Reading

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

export function validateName(errors, pageData) {
  const { first, last } = pageData;
  validateWhiteSpace(errors.first, first);
  validateWhiteSpace(errors.last, last);
}
Severity: Major
Found in src/platform/forms/definitions/fullName.js and 3 other locations - About 1 hr to fix
src/applications/edu-benefits/definitions/sponsorFullName.js on lines 3..7
src/applications/pre-need-integration/definitions/fullName.js on lines 3..7
src/applications/pre-need/definitions/fullName.js on lines 3..7

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

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

          <Route path={`${match.url}/facility-type`}>
            <TypeOfFacilityPage changeCrumb={newTitle => setCrumb(newTitle)} />
          </Route>
Severity: Major
Found in src/applications/vaos/new-appointment/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

        <Route path={`${match.url}`}>
          <PlanAheadPage changeCrumb={newTitle => setCrumb(newTitle)} />
        </Route>
Severity: Major
Found in src/applications/vaos/covid-19-vaccine/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

          <Route path={`${match.url}/preferred-date`}>
            <PreferredDatePage changeCrumb={newTitle => setCrumb(newTitle)} />
          </Route>
Severity: Major
Found in src/applications/vaos/new-appointment/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

        <Route path={`${match.url}/review`}>
          <ReviewPage changeCrumb={newTitle => setCrumb(newTitle)} />
        </Route>
Severity: Major
Found in src/applications/vaos/covid-19-vaccine/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

          <Route path={`${match.url}/sleep-care`}>
            <TypeOfSleepCarePage changeCrumb={newTitle => setCrumb(newTitle)} />
          </Route>
Severity: Major
Found in src/applications/vaos/new-appointment/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

          <Route path={`${match.url}/audiology-care`}>
            <TypeOfAudiologyCarePage
              changeCrumb={newTitle => setCrumb(newTitle)}
            />
          </Route>
Severity: Major
Found in src/applications/vaos/new-appointment/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

          <Route path={`${match.url}/location`}>
            <VAFacilityPageV2 changeCrumb={newTitle => setCrumb(newTitle)} />
          </Route>
Severity: Major
Found in src/applications/vaos/new-appointment/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

          <Route path={`${match.url}/clinic`}>
            <ClinicChoicePage changeCrumb={newTitle => setCrumb(newTitle)} />
          </Route>
Severity: Major
Found in src/applications/vaos/new-appointment/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120

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

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

          <Route path={`${match.url}/date-time`}>
            <DateTimeSelectPage changeCrumb={newTitle => setCrumb(newTitle)} />
          </Route>
Severity: Major
Found in src/applications/vaos/new-appointment/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

          <Route path={`${match.url}/eye-care`}>
            <TypeOfEyeCarePage changeCrumb={newTitle => setCrumb(newTitle)} />
          </Route>
Severity: Major
Found in src/applications/vaos/new-appointment/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 126..128
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

        <Route path={`${match.url}/contact-facility`}>
          <ContactFacilitiesPage changeCrumb={newTitle => setCrumb(newTitle)} />
        </Route>
Severity: Major
Found in src/applications/vaos/covid-19-vaccine/index.jsx and 10 other locations - About 1 hr to fix
src/applications/vaos/covid-19-vaccine/index.jsx on lines 174..176
src/applications/vaos/covid-19-vaccine/index.jsx on lines 187..189
src/applications/vaos/new-appointment/index.jsx on lines 84..86
src/applications/vaos/new-appointment/index.jsx on lines 95..97
src/applications/vaos/new-appointment/index.jsx on lines 98..100
src/applications/vaos/new-appointment/index.jsx on lines 101..105
src/applications/vaos/new-appointment/index.jsx on lines 106..108
src/applications/vaos/new-appointment/index.jsx on lines 109..111
src/applications/vaos/new-appointment/index.jsx on lines 118..120
src/applications/vaos/new-appointment/index.jsx on lines 155..157

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

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

  useEffect(
    () => {
      // clear error state between pages
      setCheckboxErrorMessage(null);
      setInputErrorMessage(null);
src/applications/appeals/shared/components/AreaOfDisagreement.jsx on lines 41..51
src/applications/appeals/testing/nod-new/components/AreaOfDisagreement.jsx on lines 40..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 55.

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

  useEffect(
    () => {
      // clear error state between pages
      setCheckboxErrorMessage(null);
      setInputErrorMessage(null);
src/applications/appeals/testing/hlr/components/AreaOfDisagreement.jsx on lines 46..56
src/applications/appeals/testing/nod-new/components/AreaOfDisagreement.jsx on lines 40..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 55.

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

              highSchoolGedExpectedGradDate: {
                'ui:title': 'Date expected to graduate',
                'ui:widget': 'date',
                'ui:options': {
                  expandUnder: 'minorHighSchoolQuestion',
Severity: Major
Found in src/applications/edu-benefits/1990/config/form.js and 2 other locations - About 1 hr to fix
src/applications/edu-benefits/1995/pages/applicantInformationUpdate.js on lines 86..98
src/applications/edu-benefits/5490/components/applicantInformationUpdate.jsx on lines 120..132

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

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