department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

File PreSubmitSection.jsx has 274 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// libs
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
Severity: Minor
Found in src/platform/forms/components/review/PreSubmitSection.jsx - About 2 hrs to fix

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

    import moment from 'moment';
    import { addDays, format, isValid } from 'date-fns';
    import { toggleValues } from '~/platform/site-wide/feature-toggles/selectors';
    import FEATURE_FLAG_NAMES from '~/platform/utilities/feature-toggles/featureFlagNames';
    import { deductionCodes } from '../constants/deduction-codes';
    Severity: Minor
    Found in src/applications/financial-status-report/utils/helpers.js - About 2 hrs to fix

      Function createDirectDepositPage has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function createDirectDepositPage() {
        const bankAccountProperties = {
          type: 'object',
          properties: {
            accountType: {
      Severity: Major
      Found in src/applications/edu-benefits/10203/pages/DirectDeposit.jsx - About 2 hrs to fix

        Function IntroductionPage has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function IntroductionPage(props) {
          const { route } = props;
          const { formConfig, pageList } = route;
          const { appType } = formConfig?.customText;
        
        
        Severity: Major
        Found in src/applications/ivc-champva/10-7959a/containers/IntroductionPage.jsx - About 2 hrs to fix

          Function libraryFilters has 64 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function libraryFilters(el) {
            // Grab our current page from the active pager button.
            if (el.srcElement.classList.contains('pager-numbers')) {
              activePage = parseInt(el.srcElement.text, 10);
              sessionStorage.setItem('pageNum', parseInt(el.srcElement.text, 10));

            Function ArrivedAtFacility has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ArrivedAtFacility = props => {
              const { router } = props;
              const { t } = useTranslation();
              const dispatch = useDispatch();
              const { goToNextPage } = useFormRouting(router);
            Severity: Major
            Found in src/applications/check-in/day-of/pages/ArrivedAtFacility.jsx - About 2 hrs to fix

              Function transformTOEForm has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function transformTOEForm(_formConfig, form) {
                const formFieldUserFullName = form?.data['view:userFullName']?.userFullName;
                const viewComponentUserFullName =
                  form?.loadedData?.formData['view:userFullName']?.userFullName;
                const formFieldDateOfBirth = form?.data?.dateOfBirth;
              Severity: Major
              Found in src/applications/toe/utils/form-submit-transform.js - About 2 hrs to fix

                Function IntroductionPage has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const IntroductionPage = props => {
                  const dispatch = useDispatch();
                  const { hasVaFileNumber, isLoading } = useSelector(
                    state => state?.vaFileNumber,
                  );

                  Function LandingPageUnauth has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const LandingPageUnauth = () => {
                    const dispatch = useDispatch();
                    const handleSignIn = () => {
                      dispatch(toggleLoginModal(true, 'mhv-sm-landing-page'));
                    };

                    Function selectRequestedAppointmentDetails has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function selectRequestedAppointmentDetails(state, id) {
                      const { appointmentDetailsStatus, facilityData } = state.appointments;
                      const featureVAOSServiceCCAppointments = selectFeatureVAOSServiceCCAppointments(
                        state,
                      );
                    Severity: Major
                    Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

                      Function specializedMissionAttributes has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const specializedMissionAttributes = () => {
                          const options = [
                            {
                              name: 'specialMissionHbcu',
                              checked: specialMissionHbcu,
                      Severity: Major
                      Found in src/applications/gi/containers/FilterYourResults.jsx - About 2 hrs to fix

                        Function mapRating has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const mapRating = institution => {
                            const { type } = institution; // used to identify if the training is OJT
                            let ratingAverage = false;
                            let ratingCount = -1;
                            let institutionRatingIsNotNull = false;
                        Severity: Major
                        Found in src/applications/gi/containers/CompareLayout.jsx - About 2 hrs to fix

                          Function StemAskVAQuestions has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function StemAskVAQuestions() {
                            const handler = {
                              recordLinkClick: () => {
                                recordEvent({
                                  event: 'nav-ask-va-questions-link-click',
                          Severity: Major
                          Found in src/applications/claims-status/components/StemAskVAQuestions.jsx - About 2 hrs to fix

                            Function validateMilitaryHistory has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const validateMilitaryHistory = (errors, serviceRecords, formData) => {
                              // Map the highestRank to the corresponding Rank Description from jsonData
                              const rankMap = jsonData.reduce((map, rank) => {
                                // eslint-disable-next-line no-param-reassign
                                map[rank['Rank Code'].toUpperCase()] = rank[
                            Severity: Major
                            Found in src/applications/pre-need-integration/utils/helpers.js - About 2 hrs to fix

                              Function mapStateToProps has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const mapStateToProps = state => {
                                const togglesLoaded = togglesAreLoaded(state);
                                const profileToggles = selectProfileToggles(state);
                                const signInServicesEligibleForDD = new Set([
                                  CSP_IDS.ID_ME,
                              Severity: Major
                              Found in src/applications/personalization/profile/components/Profile.jsx - About 2 hrs to fix

                                Function vaccineReducer has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const vaccineReducer = (state = initialState, action) => {
                                  switch (action.type) {
                                    case Actions.Vaccines.GET: {
                                      const vaccine = action.response;
                                      return {
                                Severity: Major
                                Found in src/applications/mhv-medical-records/reducers/vaccines.js - About 2 hrs to fix

                                  File address-schemas.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import React from 'react';
                                  
                                  import ADDRESS_DATA from 'platform/forms/address/data';
                                  import cloneDeep from 'platform/utilities/data/cloneDeep';
                                  import { validateAsciiCharacters } from 'platform/user/profile/vap-svc/util';

                                    File MCPAlerts.jsx has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import React from 'react';
                                    import recordEvent from 'platform/monitoring/record-event';
                                    import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
                                    import PropTypes from 'prop-types';
                                    import { currency, calcDueDate, formatDate } from '../utils/helpers';

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

                                      import { VA_FORM_IDS } from 'platform/forms/constants';
                                      import {
                                        yesNoSchema,
                                        yesNoUI,
                                      } from 'platform/forms-system/src/js/web-component-patterns';

                                        File utils.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                                        Open

                                        import React from 'react';
                                        
                                        export const orientationSteps = [
                                          {
                                            number: 0,
                                        Severity: Minor
                                        Found in src/applications/vre/28-1900/orientation/utils.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language