department-of-veterans-affairs/vets-website

View on GitHub
src/platform/forms-system/src/js/components/ConfirmationView/components.jsx

Summary

Maintainability
D
2 days
Test Coverage

File components.jsx has 427 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useEffect, useRef } from 'react';
import classNames from 'classnames';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
import {
  VaAlert,

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

        <>
          <p className="help-talk">
            <strong>If you have trouble using this online form,</strong> call us at{' '}
            <va-telephone contact="8006982411" /> (
            <va-telephone contact="711" tty />
    src/applications/simple-forms/shared/components/GetFormHelp.jsx on lines 5..22

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

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

    WhatsNextProcessList.propTypes = {
      className: PropTypes.string,
      item1Actions: PropTypes.node,
      item1Content: PropTypes.node,
      item1Header: PropTypes.string,
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskGreen/EditContactInfoTaskGreen.jsx on lines 123..131
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskYellow/EditMailingAddressTaskYellow.jsx on lines 106..114
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/EditContactInfo.jsx on lines 123..131
    src/applications/caregivers/components/FormFields/AddressWithAutofill.jsx on lines 242..250
    src/applications/financial-status-report/components/employment/EmploymentRecord.jsx on lines 199..207
    src/applications/financial-status-report/components/shared/ContactInfoCard.jsx on lines 36..44
    src/applications/hca/containers/IdentityPage.jsx on lines 140..148
    src/applications/letters/containers/Main.jsx on lines 75..83
    src/applications/mhv-medications/components/MedicationsList/MedicationsList.jsx on lines 146..154
    src/applications/personalization/dashboard/components/health-care/HealthCareCTA.jsx on lines 146..154
    src/applications/representative-appoint/components/SelectAccreditedRepresentative.jsx on lines 189..197
    src/applications/terms-of-use/components/TermsAcceptanceAction.jsx on lines 60..68
    src/applications/vaos/covid-19-vaccine/components/ContactInfoPage.jsx on lines 123..131
    src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderSelect.jsx on lines 94..102
    src/applications/verify-your-enrollment/components/PeriodsToVerify.jsx on lines 147..155
    src/applications/check-in/components/layout/Wrapper.jsx on lines 101..109

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

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

    WhatsNextProcessListWithContext.propTypes = {
      className: PropTypes.string,
      item1Actions: PropTypes.node,
      item1Content: PropTypes.node,
      item1Header: PropTypes.string,
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskGreen/VeteranProfileInformation.jsx on lines 117..124
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskYellow/VeteranProfileInformationTaskYellow.jsx on lines 117..124
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/VeteranProfileInformation.jsx on lines 117..124
    src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskGray/form/components/VeteranProfileInformation.jsx on lines 134..141
    src/applications/appeals/shared/content/contestableIssues.jsx on lines 116..123
    src/applications/ask-va/components/YourPersonalInformationAuthenticated.jsx on lines 85..92
    src/applications/caregivers/components/FormFields/FacilityList.jsx on lines 92..99
    src/applications/claims-status/components/ClaimDetailLayout.jsx on lines 135..142
    src/applications/claims-status/containers/ClaimStatusPage.jsx on lines 140..147
    src/applications/claims-status/containers/OverviewPage.jsx on lines 147..154
    src/applications/combined-debt-portal/medical-copays/components/AccountSummary.jsx on lines 63..70
    src/applications/disability-benefits/all-claims/components/Autocomplete.jsx on lines 212..219
    src/applications/ezr/components/FormPages/VeteranProfileInformation.jsx on lines 110..117
    src/applications/facility-locator/components/SearchResultMessage.jsx on lines 36..43
    src/applications/financial-status-report/components/veteranInformation/VeteranInfoBox.jsx on lines 53..60
    src/applications/gi/components/profile/EstimateYourBenefitsSummarySheet.jsx on lines 144..151
    src/applications/gi/containers/ProfilePageHeader.jsx on lines 401..408
    src/applications/hca/components/FormFields/VaMedicalCenter.jsx on lines 231..238
    src/applications/mhv-medications/components/shared/PrintDownload.jsx on lines 230..237
    src/applications/mhv-secure-messaging/components/ComposeForm/CategoryInput.jsx on lines 66..73
    src/applications/mhv-secure-messaging/components/ComposeForm/ElectronicSignature.jsx on lines 49..56
    src/applications/mhv-secure-messaging/components/MessageActionButtons/MoveMessageToFolderBtn.jsx on lines 268..275
    src/applications/mhv-secure-messaging/components/MessageList/MessageList.jsx on lines 235..242
    src/applications/mhv-secure-messaging/components/MessageThreadHeader.jsx on lines 140..147
    src/applications/mhv-secure-messaging/components/Modals/DeleteDraftModal.jsx on lines 69..76
    src/applications/representative-appoint/components/ContactCard.jsx on lines 33..40
    src/applications/static-pages/facilities/vet-center/NearByVetCenters.jsx on lines 246..253
    src/applications/user-testing/new-conditions/components/Autocomplete.jsx on lines 213..220
    src/applications/vaos/components/FacilityPhone.jsx on lines 59..66
    src/applications/vaos/covid-19-vaccine/components/ConfirmationPageV2.jsx on lines 159..166
    src/applications/verify-your-enrollment/components/MoreInfoCard.jsx on lines 47..54
    src/applications/verify-your-enrollment/components/PayeeInformationCard.jsx on lines 76..83
    src/platform/forms-system/src/js/components/EditContactInfo.jsx on lines 101..108

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

    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

        <WhatsNextProcessList
          trackingPrefix={formConfig.trackingPrefix}
          className={className}
          item1Actions={item1Actions}
          item1Content={item1Content}
    src/platform/forms-system/src/js/patterns/array-builder/ArrayBuilderItemPage.jsx on lines 85..93

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

    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

    SubmissionAlertWithContext.propTypes = {
      actions: PropTypes.node,
      className: PropTypes.string,
      content: PropTypes.node,
      status: PropTypes.string,
    src/applications/facility-locator/components/SearchResultsHeader.jsx on lines 128..134

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

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

      useEffect(
        () => {
          if (alertRef?.current) {
            scrollTo('topScrollElement');
            // delay focus for Safari
    src/applications/appeals/10182/components/ConfirmationPageV2.jsx on lines 39..48
    src/applications/appeals/shared/components/ConfirmationCommon.jsx on lines 27..36
    src/applications/appeals/shared/components/ConfirmationDecisionReviews.jsx on lines 29..38
    src/applications/simple-forms/shared/components/ConfirmationPageView.jsx on lines 20..29

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

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

    SavePdfDownload.propTypes = {
      className: PropTypes.string,
      formId: PropTypes.string,
      pdfUrl: PropTypes.string,
      trackingPrefix: PropTypes.string,
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/DependentList.jsx on lines 185..190
    src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/components/InsurancePolicyList.jsx on lines 172..177
    src/applications/accredited-representative-portal/containers/SignedInLayout.jsx on lines 44..49
    src/applications/appeals/testing/nod-new/components/EditContactInfo.jsx on lines 38..43
    src/applications/ask-va/components/CustomYourQuestionReviewField.jsx on lines 76..81
    src/applications/ask-va/components/FormFields/CountrySelect.jsx on lines 32..37
    src/applications/ask-va/components/PageFieldSummary.jsx on lines 62..67
    src/applications/ask-va/components/RequireSignInModal.jsx on lines 66..71
    src/applications/avs/components/ParagraphBlock.jsx on lines 38..43
    src/applications/caregivers/components/FormPages/FacilityConfirmation.jsx on lines 81..86
    src/applications/claims-status/components/IndexLink.jsx on lines 25..30
    src/applications/claims-status/containers/ClaimsStatusApp.jsx on lines 100..105
    src/applications/claims-status/containers/StemClaimStatusPage.jsx on lines 105..110
    src/applications/combined-debt-portal/combined/components/BalanceCard.jsx on lines 55..60
    src/applications/disability-benefits/all-claims/components/ComboBox.jsx on lines 447..452
    src/applications/edu-benefits/10203/containers/IntroductionPage.jsx on lines 256..261
    src/applications/ezr/components/FormFields/DependentList.jsx on lines 185..190
    src/applications/ezr/components/FormFields/InsurancePolicyList.jsx on lines 172..177
    src/applications/ezr/components/FormPages/FinancialStatusConfirmation.jsx on lines 42..47
    src/applications/facility-locator/components/search-results-items/common/LocationPhoneLink.jsx on lines 92..97
    src/applications/financial-status-report/components/contactInfo/EditContactInfo.jsx on lines 66..71
    src/applications/financial-status-report/components/householdIncome/SpouseTransitionExplainer.jsx on lines 26..31
    src/applications/financial-status-report/components/shared/PreSubmitSignature.jsx on lines 261..266
    src/applications/financial-status-report/components/shared/StreamlinedExplainer.jsx on lines 24..29
    src/applications/gi/components/VaAccordionGi.jsx on lines 27..32
    src/applications/gi/components/vet-tec/VetTecEstimateYourBenefitsForm.jsx on lines 238..243
    src/applications/hca/components/FormFields/DependentList.jsx on lines 177..182
    src/applications/hca/components/FormPages/FinancialInformation.jsx on lines 71..76
    src/applications/hca/components/FormPages/FinancialOnboarding.jsx on lines 73..78
    src/applications/hca/components/FormPages/InsuranceInformation.jsx on lines 63..68
    src/applications/hca/components/IdentityPage/VerificationForm.jsx on lines 61..66
    src/applications/ivc-champva/shared/components/maskSSN.jsx on lines 67..72
    src/applications/mhv-landing-page/components/HeaderLayout.jsx on lines 168..173
    src/applications/mhv-landing-page/components/alerts/AlertMhvBasicAccount.jsx on lines 102..107
    src/applications/mhv-landing-page/components/alerts/AlertMhvRegistration.jsx on lines 64..69
    src/applications/mhv-medical-records/components/shared/NewRecordsIndicator.jsx on lines 231..236
    src/applications/mhv-medications/components/MedicationsList/MedicationsListFilter.jsx on lines 151..156
    src/applications/mhv-medications/components/shared/AllergiesErrorModal.jsx on lines 45..50
    src/applications/mhv-medications/components/shared/TrackingInfo.jsx on lines 88..93
    src/applications/mhv-secure-messaging/components/MessageActionButtons/TrashButton.jsx on lines 93..98
    src/applications/mhv-secure-messaging/components/MessageThread/MessageThreadBody.jsx on lines 31..36
    src/applications/mhv-secure-messaging/components/Modals/DeleteMessageModal.jsx on lines 35..40
    src/applications/mhv-secure-messaging/components/SectionGuideButton.jsx on lines 32..37
    src/applications/mhv-secure-messaging/components/shared/AlertBackgroundBox.jsx on lines 226..231
    src/applications/personalization/common/components/devtools/DevToolsLoader.jsx on lines 131..136
    src/applications/personalization/profile/components/direct-deposit/vye/components/AlertModal.jsx on lines 30..35
    src/applications/representative-appoint/components/ClaimantTypeForm.jsx on lines 33..38
    src/applications/representative-appoint/components/ContactAccreditedRepresentative.jsx on lines 124..129
    src/applications/representative-appoint/containers/PreSubmitInfo.jsx on lines 138..143
    src/applications/resources-and-support/components/SearchBar.jsx on lines 235..240
    src/applications/search/components/ResultsList.jsx on lines 58..63
    src/applications/static-pages/events/components/Results/ResultsWhereContent.jsx on lines 98..103
    src/applications/vaos/components/layout/DetailPageLayout.jsx on lines 125..130
    src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ReviewDirectScheduleInfo/ReviewDirectScheduleInfo.jsx on lines 40..45
    src/applications/vaos/new-appointment/components/VAFacilityPage/FacilitiesNotShown.jsx on lines 110..115
    src/applications/vaos/new-appointment/components/VAFacilityPage/NoValidVAFacilitiesV2.jsx on lines 79..84
    src/applications/vaos/new-appointment/components/VAFacilityPage/getEligibilityMessage.js on lines 116..121
    src/applications/verify-your-enrollment/components/Alert.jsx on lines 24..29
    src/applications/verify-your-enrollment/components/AlertModal.jsx on lines 29..34
    src/applications/verify-your-enrollment/components/EnrollmentStatus.jsx on lines 28..33
    src/platform/forms-system/src/js/review/submit-states/ClientError.jsx on lines 65..70
    src/platform/forms-system/src/js/review/submit-states/Default.jsx on lines 39..44
    src/platform/forms-system/src/js/review/submit-states/GenericError.jsx on lines 67..72
    src/platform/mhv/downtime/components/MHVDown.jsx on lines 44..49
    src/platform/mhv/downtime/components/MHVDowntimeApproaching.jsx on lines 34..39
    src/platform/user/authentication/components/VerifyAccountLink.jsx on lines 45..50
    src/applications/check-in/components/BackButton.jsx on lines 59..64
    src/applications/static-pages/facilities/FacilityMapWidgetDynamic.jsx on lines 124..129
    src/platform/forms-system/src/js/patterns/array-builder/ArrayBuilderSummaryPage.jsx on lines 543..548

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

    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