department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function formReducer has 678 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function formReducer(state = initialState, action) {
  switch (action.type) {
    case FORM_PAGE_OPENED: {
      const { data, schema } = setupFormData(
        state.data,
Severity: Major
Found in src/applications/vaos/new-appointment/redux/reducer.js - About 3 days to fix

    File form.js has 1280 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import environment from '@department-of-veterans-affairs/platform-utilities/environment';
    import React from 'react';
    import { externalServices } from 'platform/monitoring/DowntimeNotification';
    import {
      checkboxGroupSchema,
    Severity: Major
    Found in src/applications/ivc-champva/10-10D/config/form.js - About 3 days to fix

      Function LandingPage has 655 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const LandingPage = () => {
        const user = useSelector(selectUser);
        const dispatch = useDispatch();
        const location = useLocation();
        const fullState = useSelector(state => state);
      Severity: Major
      Found in src/applications/mhv-medications/containers/LandingPage.jsx - About 3 days to fix

        File inboxMessages.js has 1256 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const { sub, formatISO } = require('date-fns');
        const {
          senderInfo,
          categoryInfo,
          triageGroupNames,
        Severity: Major
        Found in src/platform/mhv/api/mocks/secure-messaging/messages/inboxMessages.js - About 3 days to fix

          File countryList.js has 1243 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          const countryList = [
            {
              key: 'AFG',
              label: 'Afghanistan',
              value: 'AFG',
          Severity: Major
          Found in src/applications/check-in/utils/appConstants/countryList.js - About 3 days to fix

            File full-example.js has 1234 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            const all = {
              resourceType: 'Bundle',
              type: 'searchset',
              link: [
                {
            Severity: Major
            Found in src/platform/mhv/api/mocks/medical-records/allergies/full-example.js - About 3 days to fix

              File form.js has 1230 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              import { createSelector } from 'reselect';
              
              import fullSchema5490 from 'vets-json-schema/dist/22-5490-schema.json';
              import commonDefinitions from 'vets-json-schema/dist/definitions.json';
              Severity: Major
              Found in src/applications/fry-dea/config/form.js - About 3 days to fix

                File form.js has 1213 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React from 'react';
                import { createSelector } from 'reselect';
                import { Link } from 'react-router';
                
                import fullSchema1990e from 'vets-json-schema/dist/22-1990E-schema.json';
                Severity: Major
                Found in src/applications/toe/config/form.js - About 3 days to fix

                  File VAFacilityPageV2.unit.spec.js has 1180 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React from 'react';
                  import userEvent from '@testing-library/user-event';
                  import { expect } from 'chai';
                  
                  // eslint-disable-next-line import/no-unresolved

                    Function getStatusContents has 602 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function getStatusContents(appeal, name = {}) {
                      const { status, aoj, programArea } = appeal.attributes;
                      const appealType = appeal.type;
                      const statusType = status.type || status;
                      const details = status.details || {};
                    Severity: Major
                    Found in src/applications/claims-status/utils/appeals-v2-helpers.jsx - About 3 days to fix

                      File helpers.js has 1161 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import { merge } from 'lodash';
                      import get from 'platform/utilities/data/get';
                      import omit from 'platform/utilities/data/omit';
                      import * as Sentry from '@sentry/browser';
                      Severity: Major
                      Found in src/applications/pre-need-integration/utils/helpers.js - About 2 days to fix

                        File CalculateYourBenefitsForm.jsx has 1146 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import PropTypes from 'prop-types';
                        import React, { useState } from 'react';
                        import _ from 'lodash';
                        import classNames from 'classnames';
                        
                        
                        Severity: Major
                        Found in src/applications/gi/components/profile/CalculateYourBenefitsForm.jsx - About 2 days to fix

                          File moment-tz.js has 1126 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* istanbul ignore file */
                          //! moment-timezone.js
                          //! version : 0.5.25
                          //! Copyright (c) JS Foundation and other contributors
                          //! license : MIT
                          Severity: Major
                          Found in src/applications/personalization/dashboard/lib/moment-tz.js - About 2 days to fix

                            File helpers.jsx has 1124 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /* eslint-disable no-nested-ternary */
                            /* eslint-disable react/jsx-key */ // keys are defined, error being thrown in eslint even when key is defined
                            import React from 'react';
                            import ADDRESS_DATA from 'platform/forms/address/data';
                            import { v4 as uuidv4 } from 'uuid';
                            Severity: Major
                            Found in src/applications/verify-your-enrollment/helpers.jsx - About 2 days to fix

                              Function getStatusContents has 571 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function getStatusContents(appeal, name = {}) {
                                const { status, aoj, programArea } = appeal.attributes;
                                const appealType = appeal.type;
                                const statusType = status.type || status;
                                const details = status.details || {};
                              Severity: Major
                              Found in src/applications/personalization/dashboard/utils/getStatusContents.jsx - About 2 days to fix

                                Function renderAdditionalInfo has 564 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const renderAdditionalInfo = (diaryCode, dateOfLetter, benefitType) => {
                                  switch (diaryCode) {
                                    case '71':
                                      return {
                                        status:

                                  File helpers.js has 1101 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import merge from 'lodash/merge';
                                  import { format, isValid, parseISO } from 'date-fns';
                                  
                                  import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                                  import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/api';
                                  Severity: Major
                                  Found in src/applications/claims-status/utils/helpers.js - About 2 days to fix

                                    File calculator.js has 1093 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { isEmpty } from 'lodash';
                                    import { createSelector } from 'reselect';
                                    import {
                                      formatCurrency,
                                      isCountryUSA,
                                    Severity: Major
                                    Found in src/applications/gi/selectors/calculator.js - About 2 days to fix

                                      Function FileField has 549 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const FileField = props => {
                                        const {
                                          enableShortWorkflow,
                                          errorSchema,
                                          formContext,
                                      Severity: Major
                                      Found in src/platform/forms-system/src/js/fields/FileField.jsx - About 2 days to fix

                                        Function FacilitiesMap has 545 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const FacilitiesMap = props => {
                                          const [map, setMap] = useState(null);
                                          const searchResultTitleRef = useRef(null);
                                          const searchResultMessageRef = useRef();
                                          const [isMobile, setIsMobile] = useState(window.innerWidth <= 481);
                                        Severity: Major
                                        Found in src/applications/facility-locator/containers/FacilitiesMap.jsx - About 2 days to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language