department-of-veterans-affairs/vets-website

View on GitHub
src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderSelectionField.jsx

Summary

Maintainability
A
1 hr
Test Coverage

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

    return (
      <ProviderSelect
        formData={formData}
        initialProviderDisplayCount={INITIAL_PROVIDER_DISPLAY_COUNT}
        onChange={onChange}
src/applications/disability-benefits/all-claims/components/ConfirmationPoll.jsx on lines 110..120
src/applications/personalization/dashboard/components/benefit-application-drafts/ApplicationsInProgress.jsx on lines 180..190

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

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

ProviderSelectionField.propTypes = {
  formData: PropTypes.object.isRequired,
  idSchema: PropTypes.object.isRequired,
  onChange: PropTypes.func.isRequired,
};
src/applications/claims-status/components/appeals-v2/NextEvent.jsx on lines 12..16
src/applications/combined-debt-portal/medical-copays/components/DownloadStatement.jsx on lines 63..67
src/applications/dhp-connected-devices/components/DevicesToConnectSection.jsx on lines 102..106
src/applications/dhp-connected-devices/components/DisconnectModal.jsx on lines 31..35
src/applications/discharge-wizard/containers/FormPage.jsx on lines 32..36
src/applications/financial-status-report/components/householdIncome/SpousePayrollDeductionInputList.jsx on lines 248..252
src/applications/lgy/coe/form/components/statuses/Pending.jsx on lines 33..37
src/applications/personalization/profile/components/connected-apps/AppDeletedAlert.jsx on lines 32..36
src/applications/representative-search/components/results/PaginationWrapper.jsx on lines 29..33
src/applications/sco/components/HubRail/shared/liSpanAndVaLinkAndPTag.jsx on lines 11..15
src/applications/sco/components/HubRail/shared/liVaIconAndVaLink.jsx on lines 10..14
src/applications/static-pages/events/components/Search/FilterBy.jsx on lines 31..35
src/applications/vaos/appointment-list/components/PastAppointmentsList/PastAppointmentsDateDropdown.jsx on lines 43..47

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

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

There are no issues that match your filters.

Category
Status