department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

Function TaskList has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const TaskList = () => {
  const { chapterTitles, getChapterPagesFromChapterIndex } = setupPages(
    formConfig,
  );

Severity: Minor
Found in src/applications/appeals/testing/nod-new/components/TaskList.jsx - About 1 hr to fix

    Function employmentHistoryPage has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function employmentHistoryPage(
      schema,
      usePostMilitaryJob = true,
    ) {
      let nonMilitaryJobs = schema.definitions.nonMilitaryJobs;
    Severity: Minor
    Found in src/applications/edu-benefits/pages/employmentHistory.js - About 1 hr to fix

      Function applicantInsuranceSOBSchema has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function applicantInsuranceSOBSchema(isPrimary) {
        const keyname = isPrimary
          ? 'primaryInsuranceScheduleOfBenefits'
          : 'secondaryInsuranceScheduleOfBenefits';
        return {

        Function ErrorsReducer has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const ErrorsReducer = (state = INITIAL_STATE, action) => {
          switch (action.type) {
            case CLEAR_ERROR: {
              const { errorType } = action.payload;
        
        
        Severity: Minor
        Found in src/applications/representative-search/reducers/errors.js - About 1 hr to fix

          Function MoreInformation has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const MoreInformation = props => {
            const { avs } = props;
            const { clinicalServices, clinicsVisited, moreHelpAndInformation } = avs;
          
            const renderClinicalService = service => {
          Severity: Minor
          Found in src/applications/avs/components/MoreInformation.jsx - About 1 hr to fix

            Function phoneUISchema has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function phoneUISchema(category) {
              const schema = {
                'ui:options': {
                  hideLabelText: true,
                  showFieldLabel: false,
            Severity: Minor
            Found in src/applications/toe/schema.js - About 1 hr to fix

              Function AppointmentBlock has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const AppointmentBlock = props => {
                const { appointments, page, router } = props;
                const selectApp = useMemo(makeSelectApp, []);
                const { app } = useSelector(selectApp);
                const { t } = useTranslation();
              Severity: Minor
              Found in src/applications/check-in/components/AppointmentBlock.jsx - About 1 hr to fix

                Function ActionLink has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const ActionLink = props => {
                  const { action, appointmentId, app, startTime } = props;
                  const { t } = useTranslation();
                  const { getPreCheckinComplete } = useStorage(app);
                
                
                Severity: Minor
                Found in src/applications/check-in/components/ActionLink.jsx - About 1 hr to fix

                  Function BreadCrumbs has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function BreadCrumbs() {
                    const { pathname } = useLocation();
                    const history = useHistory();
                    const uuidPathRegex = /^\/[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[89abcd][\da-f]{3}-[\da-f]{12}$/i;
                    const isDetailsPage = pathname.match(uuidPathRegex);
                  Severity: Minor
                  Found in src/applications/travel-pay/components/Breadcrumbs.jsx - About 1 hr to fix

                    Function isInsideListLoopReturn has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const isInsideListLoopReturn = (
                      chapter,
                      outerField,
                      uiTitle,
                      formChapter,
                    Severity: Minor
                    Found in src/applications/disability-benefits/686c-674/config/helpers.js - About 1 hr to fix

                      Function isInsideListLoopReturn has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const isInsideListLoopReturn = (
                        chapter,
                        outerField,
                        uiTitle,
                        formChapter,
                      Severity: Minor
                      Found in src/applications/disability-benefits/686c-674-v2/config/helpers.js - About 1 hr to fix

                        Function ResponseSentPage has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const ResponseSentPage = () => {
                          const alertRef = useRef(null);
                        
                          useEffect(
                            () => {
                        Severity: Minor
                        Found in src/applications/ask-va/containers/ResponseSentPage.jsx - About 1 hr to fix

                          Function renderAddressOption has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const renderAddressOption = (address, id = 'userEntered') => {
                              const hasConfirmedSuggestions = apiData.length > 0;
                              const { addressStreet, cityStateZip, addressCountry } = formatAddress(
                                address,
                              );

                            Function schoolTypesCheckboxes has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function schoolTypesCheckboxes(
                              handleIncludedSchoolTypesChange,
                              options,
                              smallScreen,
                              automatedTest = false,
                            Severity: Minor
                            Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 1 hr to fix

                              Function emailForm has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function emailForm(state = initialState, action) {
                                switch (action.type) {
                                  case VIC_SET_EMAIL:
                                    return {
                                      ...state,
                              Severity: Minor
                              Found in src/applications/veteran-id-card/reducers/emailForm.js - About 1 hr to fix

                                Function createBreadcrumbs has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const createBreadcrumbs = (location, prescription, currentPage) => {
                                  const { pathname } = location;
                                  const defaultBreadcrumbs = [
                                    {
                                      href: medicationsUrls.VA_HOME,
                                Severity: Minor
                                Found in src/applications/mhv-medications/util/helpers.js - About 1 hr to fix

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

                                  MessageThreadHeader.propTypes = {
                                    cannotReply: PropTypes.bool,
                                    isCreateNewModalVisible: PropTypes.bool,
                                    message: PropTypes.object,
                                    recipients: PropTypes.object,
                                  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/appeals/shared/content/contestableIssues.jsx on lines 116..123
                                  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 59..66
                                  src/applications/ezr/components/FormPages/VeteranProfileInformation.jsx on lines 110..117
                                  src/applications/financial-status-report/components/veteranInformation/VeteranInfoBox.jsx on lines 51..58
                                  src/applications/hca/components/FormFields/VaMedicalCenter.jsx on lines 238..245
                                  src/applications/mhv-medications/components/MedicationsList/MedicationsList.jsx on lines 106..113
                                  src/applications/mhv-medications/components/shared/PrintDownload.jsx on lines 214..221
                                  src/applications/mhv-secure-messaging/components/ComposeForm/CategoryInput.jsx on lines 66..73
                                  src/applications/mhv-secure-messaging/components/MessageActionButtons/MoveMessageToFolderBtn.jsx on lines 268..275
                                  src/applications/mhv-secure-messaging/components/MessageList/MessageList.jsx on lines 228..235
                                  src/applications/mhv-secure-messaging/components/Modals/DeleteDraftModal.jsx on lines 69..76
                                  src/applications/representative-appoint/components/ContactCard.jsx on lines 60..67
                                  src/applications/static-pages/facilities/vet-center/NearByVetCenters.jsx on lines 246..253
                                  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 73..80
                                  src/platform/user/authentication/components/VerifyButton.jsx on lines 45..52
                                  src/applications/vaos/components/FacilityPhone.jsx on lines 49..56

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

                                  ConfirmationPageV2.propTypes = {
                                    changeCrumb: PropTypes.func,
                                    clinic: PropTypes.object,
                                    data: PropTypes.object,
                                    facilityDetails: PropTypes.object,
                                  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/appeals/shared/content/contestableIssues.jsx on lines 116..123
                                  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 59..66
                                  src/applications/ezr/components/FormPages/VeteranProfileInformation.jsx on lines 110..117
                                  src/applications/financial-status-report/components/veteranInformation/VeteranInfoBox.jsx on lines 51..58
                                  src/applications/hca/components/FormFields/VaMedicalCenter.jsx on lines 238..245
                                  src/applications/mhv-medications/components/MedicationsList/MedicationsList.jsx on lines 106..113
                                  src/applications/mhv-medications/components/shared/PrintDownload.jsx on lines 214..221
                                  src/applications/mhv-secure-messaging/components/ComposeForm/CategoryInput.jsx on lines 66..73
                                  src/applications/mhv-secure-messaging/components/MessageActionButtons/MoveMessageToFolderBtn.jsx on lines 268..275
                                  src/applications/mhv-secure-messaging/components/MessageList/MessageList.jsx on lines 228..235
                                  src/applications/mhv-secure-messaging/components/MessageThreadHeader.jsx on lines 164..171
                                  src/applications/mhv-secure-messaging/components/Modals/DeleteDraftModal.jsx on lines 69..76
                                  src/applications/representative-appoint/components/ContactCard.jsx on lines 60..67
                                  src/applications/static-pages/facilities/vet-center/NearByVetCenters.jsx on lines 246..253
                                  src/applications/verify-your-enrollment/components/MoreInfoCard.jsx on lines 47..54
                                  src/applications/verify-your-enrollment/components/PayeeInformationCard.jsx on lines 73..80
                                  src/platform/user/authentication/components/VerifyButton.jsx on lines 45..52
                                  src/applications/vaos/components/FacilityPhone.jsx on lines 49..56

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

                                  MoveMessageToFolderBtn.propTypes = {
                                    activeFolder: PropTypes.object,
                                    allFolders: PropTypes.array,
                                    isCreateNewModalVisible: PropTypes.bool,
                                    isVisible: PropTypes.bool,
                                  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/appeals/shared/content/contestableIssues.jsx on lines 116..123
                                  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 59..66
                                  src/applications/ezr/components/FormPages/VeteranProfileInformation.jsx on lines 110..117
                                  src/applications/financial-status-report/components/veteranInformation/VeteranInfoBox.jsx on lines 51..58
                                  src/applications/hca/components/FormFields/VaMedicalCenter.jsx on lines 238..245
                                  src/applications/mhv-medications/components/MedicationsList/MedicationsList.jsx on lines 106..113
                                  src/applications/mhv-medications/components/shared/PrintDownload.jsx on lines 214..221
                                  src/applications/mhv-secure-messaging/components/ComposeForm/CategoryInput.jsx on lines 66..73
                                  src/applications/mhv-secure-messaging/components/MessageList/MessageList.jsx on lines 228..235
                                  src/applications/mhv-secure-messaging/components/MessageThreadHeader.jsx on lines 164..171
                                  src/applications/mhv-secure-messaging/components/Modals/DeleteDraftModal.jsx on lines 69..76
                                  src/applications/representative-appoint/components/ContactCard.jsx on lines 60..67
                                  src/applications/static-pages/facilities/vet-center/NearByVetCenters.jsx on lines 246..253
                                  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 73..80
                                  src/platform/user/authentication/components/VerifyButton.jsx on lines 45..52
                                  src/applications/vaos/components/FacilityPhone.jsx on lines 49..56

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

                                  PayeeInformationCard.propTypes = {
                                    applicantChapter: PropTypes.string,
                                    applicantClaimNumber: PropTypes.string,
                                    applicantName: PropTypes.string,
                                    loading: PropTypes.bool,
                                  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/appeals/shared/content/contestableIssues.jsx on lines 116..123
                                  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 59..66
                                  src/applications/ezr/components/FormPages/VeteranProfileInformation.jsx on lines 110..117
                                  src/applications/financial-status-report/components/veteranInformation/VeteranInfoBox.jsx on lines 51..58
                                  src/applications/hca/components/FormFields/VaMedicalCenter.jsx on lines 238..245
                                  src/applications/mhv-medications/components/MedicationsList/MedicationsList.jsx on lines 106..113
                                  src/applications/mhv-medications/components/shared/PrintDownload.jsx on lines 214..221
                                  src/applications/mhv-secure-messaging/components/ComposeForm/CategoryInput.jsx on lines 66..73
                                  src/applications/mhv-secure-messaging/components/MessageActionButtons/MoveMessageToFolderBtn.jsx on lines 268..275
                                  src/applications/mhv-secure-messaging/components/MessageList/MessageList.jsx on lines 228..235
                                  src/applications/mhv-secure-messaging/components/MessageThreadHeader.jsx on lines 164..171
                                  src/applications/mhv-secure-messaging/components/Modals/DeleteDraftModal.jsx on lines 69..76
                                  src/applications/representative-appoint/components/ContactCard.jsx on lines 60..67
                                  src/applications/static-pages/facilities/vet-center/NearByVetCenters.jsx on lines 246..253
                                  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/platform/user/authentication/components/VerifyButton.jsx on lines 45..52
                                  src/applications/vaos/components/FacilityPhone.jsx on lines 49..56

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language