department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function loadConnectedApps has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function loadConnectedApps() {
  return async dispatch => {
    recordEvent({ event: 'profile-get-connected-apps-started' });
    dispatch({ type: LOADING_CONNECTED_APPS });

    Function UNSAFE_componentWillReceiveProps has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      UNSAFE_componentWillReceiveProps(nextProps) {
        // Once the login logic is all done...
        // This will occur even for unauthenticated users and should only occur once.
        if (this.props.user.profile.loading && !nextProps.user.profile.loading) {
          const userProfile = nextProps.user.profile;
    Severity: Minor
    Found in src/applications/veteran-id-card/containers/VeteranIDCard.jsx - About 1 hr to fix

      Function useAlerts has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const useAlerts = dispatch => {
        const alertList = useSelector(state => state.mr.alerts?.alertList);
        const [activeAlert, setActiveAlert] = useState();
      
        useEffect(
      Severity: Minor
      Found in src/applications/mhv-medical-records/hooks/use-alerts.js - About 1 hr to fix

        Function formatDateAndTime has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const formatDateAndTime = rawDate => {
          let date = rawDate;
          if (typeof rawDate === 'string') {
            date = new Date(rawDate);
          }
        Severity: Minor
        Found in src/applications/mhv-medical-records/util/helpers.js - About 1 hr to fix

          Function convertTreatmentFacilities has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const convertTreatmentFacilities = recordList => {
            if (!recordList) return null;
            return recordList.map(record => ({
              facilityName: record.facilityName || NONE_ENTERED,
              facilityType:
          Severity: Minor
          Found in src/applications/mhv-medical-records/reducers/selfEnteredData.js - About 1 hr to fix

            Function submitEmail has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function submitEmail(email) {
              recordEvent({ event: 'vic-email-started' });
              return dispatch => {
                dispatch({ type: VIC_EMAIL_CAPTURING });
            
            
            Severity: Minor
            Found in src/applications/veteran-id-card/actions/index.js - About 1 hr to fix

              Function dropdownContent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      const dropdownContent = () => {
                        return (
                          <>
                            <p className="vads-u-padding-bottom--1">
                              A VA provider added this medication record in your VA medical

                Function allergiesReducer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const allergiesReducer = (state = initialState, action) => {
                  switch (action.type) {
                    case Actions.Allergies.GET_LIST: {
                      return {
                        ...state,
                Severity: Minor
                Found in src/applications/mhv-medications/reducers/allergies.js - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      } else if (prefillEnabled && !verifyRequiredPrefill) {
                        const H = `h${this.props.headingLevel}`;
                        const {
                          buttonOnly,
                          retentionPeriod,
                  Severity: Major
                  Found in src/platform/forms/save-in-progress/SaveInProgressIntro.jsx - About 1 hr to fix

                    Function uiSchemaValidate has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      errors,
                      uiSchema,
                      schema,
                      formData,
                      path = '',
                    Severity: Major
                    Found in src/platform/forms-system/src/js/validation.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (
                            nextProps.reviewMode &&
                            !nextProps.editModeOnReviewPage &&
                            nextProps.reviewMode === this.props.reviewMode &&
                            deepEquals(this.state, nextState) &&
                      Severity: Major
                      Found in src/platform/forms-system/src/js/components/SchemaForm.jsx - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                              } else if (
                                allowITF &&
                                !isCreating &&
                                !hasActiveITF &&
                                !createITFCalled &&
                        Severity: Major
                        Found in src/applications/appeals/995/containers/ITFWrapper.jsx - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                } else if (
                                  allowITF &&
                                  !isCreating &&
                                  !hasActiveITF &&
                                  !createITFCalled &&
                          Severity: Major
                          Found in src/applications/appeals/testing/sc/containers/ITFWrapper.jsx - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                } else if (prefillEnabled && !verifyRequiredPrefill) {
                                  const H = `h${this.props.headingLevel}`;
                                  const {
                                    buttonOnly,
                                    retentionPeriod,

                              Consider simplifying this complex logical expression.
                              Open

                                  if (
                                    nextProps.reviewMode &&
                                    !nextProps.editModeOnReviewPage &&
                                    nextProps.reviewMode === this.props.reviewMode &&
                                    deepEquals(this.state, nextState) &&

                                Consider simplifying this complex logical expression.
                                Open

                                    if (
                                      nextProps.reviewMode &&
                                      !nextProps.editModeOnReviewPage &&
                                      nextProps.reviewMode === this.props.reviewMode &&
                                      deepEquals(this.state, nextState) &&

                                  Consider simplifying this complex logical expression.
                                  Open

                                      } else if (prefillEnabled && !verifyRequiredPrefill) {
                                        const H = `h${this.props.headingLevel}`;
                                        const {
                                          buttonOnly,
                                          retentionPeriod,

                                    Consider simplifying this complex logical expression.
                                    Open

                                        if (
                                          nextProps.reviewMode &&
                                          !nextProps.editModeOnReviewPage &&
                                          nextProps.reviewMode === this.props.reviewMode &&
                                          deepEquals(this.state, nextState) &&

                                      Consider simplifying this complex logical expression.
                                      Open

                                          } else if (prefillEnabled && !verifyRequiredPrefill) {
                                            const H = `h${this.props.headingLevel}`;
                                            const {
                                              buttonOnly,
                                              retentionPeriod,

                                        Consider simplifying this complex logical expression.
                                        Open

                                                if (
                                                  [SENT_DATE_DESCENDING.value, DRAFT_DATE_DESCENDING.value].includes(
                                                    sortOrder,
                                                  ) ||
                                                  (sortOrder === SENDER_ALPHA_ASCENDING.value &&
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language