department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,736 of 12,814 total issues

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 calculateIncome has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const calculateIncome = (
      enhancedFSRActive,
      employmentRecords = [],
      currEmployment = [],
      addlIncRecords = [],
    Severity: Major
    Found in src/applications/financial-status-report/utils/calculateIncome.js - About 2 hrs to fix

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

      const getMonthlyIncome = formData => {
        const {
          additionalIncome: {
            addlIncRecords = [],
            spouse: { spAddlIncome = [] } = {},
      Severity: Major
      Found in src/applications/financial-status-report/utils/calculateIncome.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 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 PrinciplesOfExcellenceModalContent has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                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 CareSummariesDetails has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const CareSummariesDetails = () => {
                    const dispatch = useDispatch();
                    const careSummary = useSelector(
                      state => state.mr.careSummariesAndNotes.careSummariesAndNotesDetails,
                    );

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

                      import React, { useState } from 'react';
                      import { connect } from 'react-redux';
                      import { setData } from 'platform/forms-system/src/js/actions';
                      import { VaDate } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
                      import { parseISODate } from 'platform/forms-system/src/js/helpers';

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

                        export const recordType = {
                          ALLERGIES: 'allergies',
                          VACCINES: 'vaccines',
                          CARE_SUMMARIES_AND_NOTES: 'care summaries and notes',
                          LABS_AND_TESTS: 'lab and test results',
                        Severity: Minor
                        Found in src/applications/mhv-medical-records/util/constants.js - About 2 hrs to fix

                          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 = () => (

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

                            const VaFileInputField = props => {
                              const mappedProps = vaFileInputFieldMapping(props);
                              const dispatch = useDispatch();
                              const [file, setFile] = useState(null);
                              const formData = useSelector(state => state.form.data);

                              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 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 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: '' };

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

                                      const renderContent = () => {
                                        if (debtError) {
                                          return renderAlert(
                                            mcpError ? ALERT_TYPES.ALL_ERROR : ALERT_TYPES.ERROR,
                                            mcpStatements?.length,

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

                                      export const genSearchAreaFromCenter = query => {
                                        const { lat, lng, currentMapBoundsDistance, currentBounds } = query;
                                        return dispatch => {
                                          if (currentMapBoundsDistance > 500) {
                                            dispatch({ type: GEOCODE_FAILED });

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

                                        export default function OperationStatus(props) {
                                          const { operatingStatus, website, facilityType } = props;
                                          const visitText = useMemo(
                                            () => {
                                              if (facilityType === FacilityType.VA_CEMETERY) {
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language