department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      setReferredBenefit,
      setWizardStatus,
      expander,
Severity: Major
Found in src/applications/static-pages/wizard/index.js - About 2 hrs to fix

    Function createRoutesWithStore has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const createRoutesWithStore = () => {
      return (
        <Switch>
          {routes.map((route, i) => {
            const options = { appName: APP_NAMES.PRE_CHECK_IN };
    Severity: Major
    Found in src/applications/check-in/pre-check-in/routes.jsx - About 2 hrs to fix

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

      const mapStateToProps = state => {
        const { featureToggles } = state;
        const selectedAddress = state.form?.data['view:currentAddress'];
        const shippingAddress = state.form?.data[selectedAddress];
        const { fullName, vetEmail, order, supplies } = state.form?.data;

        Function createPageListByChapterAskVa has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function createPageListByChapterAskVa(formConfig, pagesToMoveConfig) {
          const pagesByChapter = {};
          const modifiedFormConfig = {
            chapters: {},
          };
        Severity: Major
        Found in src/applications/ask-va/utils/reviewPageHelper.js - About 2 hrs to fix

          Function OrientationApp has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const OrientationApp = props => {
            const [step, setStep] = useState(0);
            const [isFirstRender, setIsFirstRender] = useState(true);
            const { wizardStateHandler } = props;
          
          
          Severity: Major
          Found in src/applications/vre/28-1900/orientation/OrientationApp.jsx - About 2 hrs to fix

            Function InnerNavigation has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const InnerNavigation = () => {
              const location = useLocation();
            
              const handleActiveLinksStyle = path => {
                let isInnerActive = false;
            Severity: Major
            Found in src/applications/mhv-secure-messaging/components/InnerNavigation.jsx - About 2 hrs to fix

              Function saveDraftHandler has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  async (type, e) => {
                    // Prevents 'auto' from running if isModalVisible is open
                    if (type === 'auto' && isModalVisible) {
                      return;
                    }

                Function confirmAppointment has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function confirmAppointment(history) {
                  return async (dispatch, getState) => {
                    const featureBreadcrumbUrlUpdate = selectFeatureBreadcrumbUrlUpdate(
                      getState(),
                    );
                Severity: Major
                Found in src/applications/vaos/covid-19-vaccine/redux/actions.js - About 2 hrs to fix

                  Function default has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function(state = INITIAL_STATE, action) {
                    switch (action.type) {
                      case AUTOCOMPLETE_STARTED:
                        return {
                          ...state,
                  Severity: Major
                  Found in src/applications/gi/reducers/autocomplete.js - About 2 hrs to fix

                    Function PrinciplesOfExcellenceModalContent has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function PrinciplesOfExcellenceModalContent() {
                      return (
                        <>
                          <h3>Principles of Excellence</h3>
                          <p>

                      Function VaccinesListItem has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const VaccinesListItem = props => {
                        const { record } = props;
                      
                        return (
                          <va-card

                        Function refreshReducer has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const refreshReducer = (state = initialState, action) => {
                          switch (action.type) {
                            case Actions.Refresh.SET_INITIAL_FHIR_LOAD: {
                              return {
                                ...state,
                        Severity: Major
                        Found in src/applications/mhv-medical-records/reducers/refresh.js - About 2 hrs to fix

                          File MCPAlerts.jsx has 253 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 ContestableIssues.jsx has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React, { useEffect, useState } from 'react';
                            import PropTypes from 'prop-types';
                            import { connect } from 'react-redux';
                            import { Link } from 'react-router';
                            import { VaModal } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
                            Severity: Minor
                            Found in src/applications/appeals/shared/components/ContestableIssues.jsx - About 2 hrs to fix

                              File deceasedDependentArrayPages.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import { format, parseISO } from 'date-fns';
                              import { capitalize } from 'lodash';
                              import {
                                titleUI,
                                arrayBuilderItemFirstPageTitleUI,

                                File debtSummaryCardContent.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import React from 'react';
                                import PropTypes from 'prop-types';
                                import { endDate } from '../../utils/helpers';
                                
                                const WarningIcon = () => (

                                  File PrescriptionDetailsDocumentation.jsx has 252 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import React, { useCallback, useEffect, useState, useRef } from 'react';
                                  import { useParams } from 'react-router-dom';
                                  import { useSelector, useDispatch } from 'react-redux';
                                  import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames';
                                  import PageNotFound from '@department-of-veterans-affairs/platform-site-wide/PageNotFound';

                                    Function submitForm has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function submitForm(formConfig, form) {
                                      const inProgressFormId = form.loadedData?.metadata?.inProgressFormId;
                                      const captureError = (error, errorType) => {
                                        Sentry.withScope(scope => {
                                          scope.setFingerprint([formConfig.trackingPrefix]);
                                    Severity: Major
                                    Found in src/platform/forms-system/src/js/actions.js - About 2 hrs to fix

                                      Function submitToUrl has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function submitToUrl(body, submitUrl, trackingPrefix, eventData) {
                                        // This item should have been set in any previous API calls
                                        const csrfTokenStored = localStorage.getItem('csrfToken');
                                        return new Promise((resolve, reject) => {
                                          const req = new XMLHttpRequest();
                                      Severity: Major
                                      Found in src/platform/forms-system/src/js/actions.js - About 2 hrs to fix

                                        Function getInitialFormValues has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const getInitialFormValues = options => {
                                          const { fieldName, data, modalData } = options;
                                        
                                          if (fieldName === FIELD_NAMES.EMAIL) {
                                            return data ? { ...data } : { emailAddress: '' };
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language