department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function content has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    () => {
      if (isLoading || awaitingResults) {
        return <LoadingIndicator />;
      }

    Function selectRequestedAppointmentData has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function routeToPageInFlow has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function routeToPageInFlow(callback, history, current, action, data) {
        return async (dispatch, getState) => {
          const flow = callback(getState());
      
          dispatch({
      Severity: Major
      Found in src/applications/vaos/new-appointment/redux/actions.js - About 2 hrs to fix

        Function LandingPageContainer has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const LandingPageContainer = () => {
          const { featureToggles, user } = useSelector(state => state);
          const [unreadMessageCount, setUnreadMessageCount] = useState();
          const profile = useSelector(selectProfile);
          const ssoe = useSelector(isAuthenticatedWithSSOe);
        Severity: Major
        Found in src/applications/mhv-landing-page/containers/LandingPageContainer.jsx - About 2 hrs to fix

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

            render() {
              const { logo, title, grants } = this.props.attributes;
          
              return (
                <div

            Function useHighlightedClaimOrAppeal has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const useHighlightedClaimOrAppeal = (appealsData, claimsData) => {
              // the appeals data sorted with the most recently updated appeal first
              const sortedAppeals = React.useMemo(
                () => {
                  // Array sorting is done in place. Sorting `appealsData` directly was

              Function fetchNotifications has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const fetchNotifications = () => async dispatch => {
                const getNotifications = () => {
                  const options = {
                    method: 'GET',
                    credentials: 'include',
              Severity: Major
              Found in src/applications/personalization/common/actions/notifications.js - About 2 hrs to fix

                Function content has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const content = () => {
                    if (labAndTestDetails) {
                      return (
                        <>
                          <PrintHeader />

                  File PrescriptionPrintOnly.jsx has 265 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React from 'react';
                  import PropTypes from 'prop-types';
                  import {
                    pdfStatusDefinitions,
                    pdfDefaultStatusDefinition,

                    File index.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import mapValues from 'lodash/mapValues';
                    import { endOfDay, isAfter, isValid, isWithinInterval } from 'date-fns';
                    import vaMedicalFacilities from 'vets-json-schema/dist/vaMedicalFacilities.json';
                    
                    import set from '~/platform/utilities/data/set';
                    Severity: Minor
                    Found in src/applications/hca/utils/helpers/index.js - About 2 hrs to fix

                      File DocumentRequestPage.jsx has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import Scroll from 'react-scroll';
                      import { merge } from 'lodash';
                      import { connect } from 'react-redux';
                      import PropTypes from 'prop-types';
                      Severity: Minor
                      Found in src/applications/claims-status/containers/DocumentRequestPage.jsx - About 2 hrs to fix

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

                        import React from 'react';
                        import { Link } from 'react-router';
                        import moment from 'moment';
                        
                        import {
                        Severity: Minor
                        Found in src/applications/post-911-gib-status/utils/helpers.jsx - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                              if (formContext.reviewMode) {
                                const {
                                  address1,
                                  address2,
                                  address3,

                            responses has 22 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            const responses = {
                              'GET /v0/feature_toggles': (_req, res) => {
                                const secondsOfDelay = 0;
                                delaySingleResponse(
                                  () =>
                            Severity: Minor
                            Found in src/applications/personalization/profile/mocks/server.js - About 2 hrs to fix

                              Function apiRequest has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function apiRequest(resource, optionalSettings, success, error) {
                                const apiVersion = (optionalSettings && optionalSettings.apiVersion) || 'v0';
                                const baseUrl = `${environment.API_URL}/${apiVersion}`;
                                const url = resource[0] === '/' ? [baseUrl, resource].join('') : resource;
                                const csrfTokenStored = localStorage.getItem('csrfToken');
                              Severity: Major
                              Found in src/platform/utilities/api/index.js - About 2 hrs to fix

                                Function findErrors has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    const findErrors = (name, err) => {
                                      if (err && typeof err === 'object') {
                                        // process the last type of error message which provides an `__errors`
                                        // message array. If there are multiple errors, we'll join them into
                                        // one message.
                                Severity: Major
                                Found in src/platform/forms-system/src/js/utilities/data/reduceErrors.js - About 2 hrs to fix

                                  Function renderLetterHistory has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const renderLetterHistory = diaryCode => {
                                    switch (diaryCode) {
                                      case '100':
                                      case '101':
                                      case '102':

                                    Function createTransaction has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function createTransaction(
                                      route,
                                      method,
                                      fieldName,
                                      payload,
                                    Severity: Major
                                    Found in src/platform/user/profile/vap-svc/actions/transactions.js - About 2 hrs to fix

                                      Function SaveResultsModal has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const SaveResultsModal = () => {
                                        const [isOpen, setIsOpen] = useState(false);
                                        const [showAlert, setShowAlert] = useState(false);
                                        const currentUrl = window.location.href;
                                        const toggleModal = open => {

                                        Function incomeLimits has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const incomeLimits = (state = initialState, action) => {
                                          switch (action.type) {
                                            case IL_UPDATE_DEPENDENTS:
                                              return {
                                                ...state,
                                        Severity: Major
                                        Found in src/applications/income-limits/reducers/index.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language