department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function UpcomingAppointmentsListItemAction has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UpcomingAppointmentsListItemAction = props => {
  const { appointment, router } = props;
  const { t } = useTranslation();
  const dispatch = useDispatch();
  const { goToNextPage, jumpToPage, getNextPageFromRouter } = useFormRouting(

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

    const createRoutesWithStore = () => {
      return (
        <Switch>
          {routes.map((route, i) => {
            const options = { appName: APP_NAMES.CHECK_IN };
    Severity: Minor
    Found in src/applications/check-in/day-of/routes.jsx - About 1 hr to fix

      Function PreCheckinConfirmation has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const PreCheckinConfirmation = props => {
        const { appointments, isLoading, router } = props;
        const selectForm = useMemo(makeSelectForm, []);
        const currentForm = useSelector(selectForm);
        const { t } = useTranslation();
      Severity: Minor
      Found in src/applications/check-in/components/PreCheckinConfirmation.jsx - About 1 hr to fix

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

          render() {
            const { calculatedRating } = this.props;
            const placeholder = '--';
        
            return (

          Function SubmissionErrorAlert has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const SubmissionErrorAlert = () => {
            useEffect(() => {
              focusElement('.caregiver-error-message');
            }, []);
          
          

            Function checkCommunityCareEligibility has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function checkCommunityCareEligibility() {
              return async (dispatch, getState) => {
                const state = getState();
                const communityCareEnabled = selectFeatureCommunityCare(state);
            
            
            Severity: Minor
            Found in src/applications/vaos/new-appointment/redux/actions.js - About 1 hr to fix

              Function hasConflict has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const hasConflict = (selectedDate, appointmentsByMonth, facilityTimeZone) => {
                let conflict = false;
                const selectedMonth = dateFns.format(new Date(selectedDate), 'yyyy-MM');
                if (!(selectedMonth in appointmentsByMonth)) {
                  return conflict;
              Severity: Minor
              Found in src/applications/vaos/referral-appointments/utils/provider.js - About 1 hr to fix

                Function getAbbreviationsAsArray has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const getAbbreviationsAsArray = value => {
                  if (!value) return [];
                  const mapping = {
                    OJT: [
                      { abbreviation: 'APP', description: 'Apprenticeships' },
                Severity: Minor
                Found in src/applications/gi/utils/helpers.js - About 1 hr to fix

                  Function sections has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      const sections = Object.keys(perTerm).map(section => {
                        const {
                          visible,
                          title,
                          learnMoreAriaLabel,
                  Severity: Minor
                  Found in src/applications/gi/components/profile/EstimatedBenefits.jsx - About 1 hr to fix

                    Function fetchSearchByLocationCoords has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function fetchSearchByLocationCoords(
                      location,
                      coordinates,
                      distance,
                      filters,
                    Severity: Minor
                    Found in src/applications/gi/actions/index.js - About 1 hr to fix

                      Function renderFacilityTable has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const renderFacilityTable = mainMap => {
                          const data = Array.of(createMainRow(mainMap.institution)).concat(
                            createBranchesAndExtensionsRows(mainMap, viewableRowCount),
                          );
                      
                      
                      Severity: Minor
                      Found in src/applications/gi/components/profile/SchoolLocations.jsx - About 1 hr to fix

                        Function calculateTuition has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function calculateTuition(constant, eligibility, institution, derived) {
                          if (derived.oldGiBill) {
                            return { qualifier: 'per year', value: 0, ratedQualifier: '/ year' };
                          }
                          if (institution.type === 'ojt') {
                        Severity: Minor
                        Found in src/applications/gi/selectors/estimator.js - About 1 hr to fix

                          Function updateSchema has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                updateSchema: (formData, addressSchema, addressUiSchema, index, path) => {
                                  let currentSchema = addressSchema;
                          
                                  const modifiedData = { ...formData };
                          
                          
                          Severity: Minor
                          Found in src/applications/pre-need-integration/definitions/address.js - About 1 hr to fix

                            Function renderAddressOption has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function renderAddressOption(address, id = 'userEntered') {
                                if (address !== undefined) {
                                  const { street, cityStateZip, country } =
                                    id !== 'userEntered'
                                      ? formatAddress(address)

                              Function fetchTotalDisabilityRating has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function fetchTotalDisabilityRating(recordAnalyticsEvent = recordEvent) {
                                return async dispatch => {
                                  dispatch({
                                    type: FETCH_TOTAL_RATING_STARTED,
                                  });

                                Consider simplifying this complex logical expression.
                                Open

                                      if (
                                        (keys.email && (contactInfo.email?.emailAddress || '') !== email) ||
                                        (keys.homePhone &&
                                          contactInfo.homePhone?.updatedAt !== homePhone?.updatedAt) ||
                                        (keys.mobilePhone &&
                                Severity: Critical
                                Found in src/platform/forms-system/src/js/components/ContactInfo.jsx - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                        if (
                                          (keys.email && (contactInfo.email?.emailAddress || '') !== email) ||
                                          (keys.homePhone &&
                                            contactInfo.homePhone?.updatedAt !== homePhone?.updatedAt) ||
                                          (keys.mobilePhone &&

                                    Consider simplifying this complex logical expression.
                                    Open

                                          if (
                                            (keys.email && (contactInfo.email?.emailAddress || '') !== email) ||
                                            (keys.homePhone &&
                                              contactInfo.homePhone?.updatedAt !== homePhone?.updatedAt) ||
                                            (keys.mobilePhone &&

                                      Consider simplifying this complex logical expression.
                                      Open

                                            if (
                                              (keys.email && (contactInfo.email?.emailAddress || '') !== email) ||
                                              (keys.homePhone &&
                                                contactInfo.homePhone?.updatedAt !== homePhone?.updatedAt) ||
                                              (keys.mobilePhone &&

                                        Consider simplifying this complex logical expression.
                                        Open

                                          if (id) {
                                            return (
                                              <>
                                                <va-card show-shadow>
                                                  <div className="auth-card">
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language