department-of-veterans-affairs/vets-website

View on GitHub
src/applications/gi/components/LicenseCertificationKeywordSearch.jsx

Summary

Maintainability
B
5 hrs
Test Coverage

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

                      <div
                        key={index}
                        role="option"
                        aria-selected={
                          selectedItem === item.label ? 'true' : 'false'
src/applications/gi/components/search/KeywordSearch.jsx on lines 189..201

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

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

      <Downshift
        inputValue={inputValue}
        onSelect={item => handleSuggestionSelected(item)}
        itemToString={item => {
          if (typeof item === 'string' || !item) {
src/applications/gi/components/search/KeywordSearch.jsx on lines 136..207

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

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

              {inputValue &&
                inputValue.length > 0 && (
                  <va-icon
                    size={3}
                    icon="cancel"
src/applications/gi/components/search/KeywordSearch.jsx on lines 171..180

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

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

LicenseCertificationKeywordSearch.propTypes = {
  onSelection: PropTypes.func.isRequired,
  inputValue: PropTypes.string,
  suggestions: PropTypes.array,
  onUpdateAutocompleteSearchTerm: PropTypes.func,
src/applications/claims-status/components/ClaimCard/ClaimCard.jsx on lines 23..28
src/applications/claims-status/components/ClaimPhase.jsx on lines 20..25
src/applications/discharge-wizard/components/questions/BranchOfService.jsx on lines 67..72
src/applications/discharge-wizard/components/questions/CourtMartial.jsx on lines 77..82
src/applications/discharge-wizard/components/questions/DischargeMonth.jsx on lines 63..68
src/applications/discharge-wizard/components/questions/DischargeType.jsx on lines 66..71
src/applications/discharge-wizard/components/questions/DischargeYear.jsx on lines 68..73
src/applications/discharge-wizard/components/questions/FailureToExhaust.jsx on lines 77..82
src/applications/discharge-wizard/components/questions/Intention.jsx on lines 66..71
src/applications/discharge-wizard/components/questions/PrevApplication.jsx on lines 68..73
src/applications/discharge-wizard/components/questions/PrevApplicationType.jsx on lines 82..87
src/applications/discharge-wizard/components/questions/PrevApplicationYear.jsx on lines 72..77
src/applications/discharge-wizard/components/questions/PriorService.jsx on lines 82..87
src/applications/discharge-wizard/components/questions/Reason.jsx on lines 70..75
src/applications/find-forms/components/SearchResult.jsx on lines 220..225
src/applications/mhv-medications/components/PrescriptionDetails/PrescriptionPrintOnly.jsx on lines 263..268
src/applications/personalization/dashboard/components/notifications/Notifications.jsx on lines 96..101
src/applications/static-pages/mhv-signin-cta/components/messages/UnverifiedAlert.jsx on lines 131..136
src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/index.jsx on lines 38..43
src/applications/vaos/new-appointment/components/VAFacilityPage/EligibilityModal.jsx on lines 47..52
src/platform/forms-system/src/js/components/ConfirmationView/ChapterSectionCollection.jsx on lines 344..349
src/platform/site-wide/user-nav/components/SearchMenu.jsx on lines 168..173
src/platform/user/authentication/components/SessionTimeoutModal.jsx on lines 155..160
src/applications/check-in/components/layout/ReloadWrapper.jsx on lines 134..139

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

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