department-of-veterans-affairs/vets-website

View on GitHub
src/applications/_mock-form-ae-design-patterns/shared/components/InfoSection.jsx

Summary

Maintainability
A
3 hrs
Test Coverage

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

SubHeading.propTypes = {
  text: PropTypes.string.isRequired,
  editLink: PropTypes.string,
  id: PropTypes.string,
  level: PropTypes.number,
src/applications/claims-status/components/TabItem.jsx on lines 42..48
src/applications/gi/components/ScorecardTags.jsx on lines 20..26
src/applications/mhv-medications/containers/PrintOnlyPage.jsx on lines 49..55
src/applications/post-911-gib-status/components/InfoPair.jsx on lines 40..46

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

InfoBlock.propTypes = {
  label: PropTypes.string.isRequired,
  placeholder: PropTypes.string,
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
};
src/applications/proxy-rewrite/partials/desktop/header/mega-menu/level-two-links.jsx on lines 64..68
src/applications/vaos/components/CernerAlert.jsx on lines 66..70

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

ServicePeriod.propTypes = {
  applyToBenefit: PropTypes.string,
  branchOfService: PropTypes.string,
  endDate: PropTypes.string,
  startDate: PropTypes.string,
src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskGray/form/components/VeteranProfileInformation.jsx on lines 40..46
src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskGray/status/components/DocumentList/ListItem.jsx on lines 24..30
src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskOrange/pages/applicant-information/ApplicantInformation.jsx on lines 160..166
src/applications/caregivers/components/FormFields/FacilitySearch.jsx on lines 311..317
src/applications/caregivers/components/FormFields/VaMedicalCenter.jsx on lines 126..132
src/applications/claims-status/components/claim-status-tab/WhatWeAreDoing.jsx on lines 86..92
src/applications/combined-debt-portal/medical-copays/components/BalanceCard.jsx on lines 103..109
src/applications/disability-benefits/all-claims/components/ClaimConfirmationInfo.jsx on lines 51..57
src/applications/disability-benefits/view-payments/components/view-payments-lists/ViewPaymentsLists.jsx on lines 228..234
src/applications/ezr/components/PreSubmitNotice/index.jsx on lines 54..60
src/applications/facility-locator/containers/FacilityDetail.jsx on lines 158..164
src/applications/financial-status-report/components/household/DependentAges.jsx on lines 230..236
src/applications/financial-status-report/components/resolution/ResolutionOptions.jsx on lines 159..165
src/applications/gi/containers/search/FilterByLocation.jsx on lines 144..150
src/applications/hca/components/FormFields/DemographicViewField.jsx on lines 36..42
src/applications/hca/components/FormPages/DependentInformation.jsx on lines 252..258
src/applications/hca/components/FormPages/VeteranInformation.jsx on lines 39..45
src/applications/hca/components/PreSubmitNotice/index.jsx on lines 123..129
src/applications/ivc-champva/10-10D/pages/SupportingDocumentsPage.jsx on lines 27..33
src/applications/ivc-champva/10-7959C/components/SupportingDocumentsPage.jsx on lines 32..38
src/applications/ivc-champva/shared/components/applicantLists/ApplicantRelationshipPage.jsx on lines 310..316
src/applications/lgy/coe/status/components/DocumentList/ListItem.jsx on lines 24..30
src/applications/mhv-medical-records/components/RecordList/RecordList.jsx on lines 131..137
src/applications/mhv-medical-records/components/shared/DateSubheading.jsx on lines 27..33
src/applications/mhv-medical-records/components/shared/PrintDownload.jsx on lines 162..168
src/applications/mhv-secure-messaging/components/ComposeForm/FileInput.jsx on lines 197..203
src/applications/mhv-secure-messaging/components/FacilityCheckboxGroup.jsx on lines 83..89
src/applications/mhv-secure-messaging/components/MessageThread/MessageThreadItem.jsx on lines 166..172
src/applications/mhv-secure-messaging/components/Modals/RemoveAttachmentModal.jsx on lines 74..80
src/applications/mhv-secure-messaging/components/Search/SearchForm.jsx on lines 362..368
src/applications/my-education-benefits/components/DuplicateContactInfoModal.jsx on lines 101..107
src/applications/personalization/dashboard/components/Dashboard.jsx on lines 192..198
src/applications/personalization/view-dependents/components/ViewDependentsList/ViewDependentsList.jsx on lines 73..79
src/applications/representative-appoint/components/ProfileNotUpdatedNote.jsx on lines 47..53
src/applications/representative-appoint/components/SelectOrganization.jsx on lines 101..107
src/applications/representative-appoint/containers/App.jsx on lines 82..88
src/applications/simple-forms/form-upload/pages/helpers.jsx on lines 49..55
src/applications/survivor-dependent-education-benefit/22-5490/components/DuplicateContactInfoModal.jsx on lines 101..107
src/applications/toe/components/DuplicateContactInfoModal.jsx on lines 101..107
src/applications/vaos/appointment-list/components/PageLayout.jsx on lines 40..46
src/applications/vaos/components/AddToCalendar.jsx on lines 76..82
src/applications/vaos/components/VAOSApp/DowntimeMessage.jsx on lines 95..101
src/applications/vaos/new-appointment/components/VAFacilityPage/FacilitiesRadioWidget.jsx on lines 183..189
src/applications/verify-your-enrollment/components/CurrentBenefitsStatus.jsx on lines 47..53
src/applications/verify-your-enrollment/components/PageLink.jsx on lines 29..35
src/applications/verify/components/verifyButton.jsx on lines 40..46
src/platform/forms-system/src/js/components/BackLink.jsx on lines 99..105
src/platform/forms-system/src/js/components/ContactInfoReview.jsx on lines 301..307
src/platform/forms-system/src/js/review/submit-states/ThrottledError.jsx on lines 57..63
src/platform/forms-system/src/js/review/submit-states/ValidationError.jsx on lines 64..70
src/platform/forms/components/common/alerts/ErrorMessage.jsx on lines 42..48
src/platform/site-wide/loading-button/LoadingButton.jsx on lines 35..41
src/platform/user/authentication/components/CreateAccountLink.jsx on lines 53..59

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

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