department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

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

export const recipientsReducer = (state = initialState, action) => {
  switch (action.type) {
    case Actions.AllRecipients.GET_LIST: {
      const {
        associatedTriageGroups,
Severity: Minor
Found in src/applications/mhv-secure-messaging/reducers/recipients.js - About 1 hr to fix

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

      export default function NeedHelp() {
        return (
          <div className="vads-u-margin-top--9 vads-u-margin-bottom--3">
            <h2 className="vads-u-font-size--h3 vads-u-margin-bottom--0">
              Need help?
      Severity: Minor
      Found in src/applications/vaos/components/NeedHelp.jsx - 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 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 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 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 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,
                        });

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

                        renderWebResult(result, snippetKey = 'snippet', isBestBet = false, index) {
                          const strippedTitle = removeDoubleBars(
                            formatResponseString(result.title, true),
                          );
                          return (
                      Severity: Minor
                      Found in src/applications/search/containers/SearchApp.jsx - About 1 hr to fix

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

                          const downloadPdf = async () => {
                            const formattedText = convertHtmlForDownload(
                              htmlContent,
                              DOWNLOAD_FORMAT.PDF,
                            );

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

                            const searchResults = () => {
                              if (loading) {
                                return <va-loading-indicator message="Loading..." set-focus />;
                              }
                              if (representativeResults?.length) {

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

                            export default function NextStepsPage() {
                              const { data: formData } = useSelector(state => state.form);
                            
                              return (
                                <div className="row">

                              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 (id) {
                                      return (
                                        <>
                                          <va-card show-shadow>
                                            <div className="auth-card">

                                    Consider simplifying this complex logical expression.
                                    Open

                                        if (inquiryData?.attributes?.status) {
                                          const { status } = inquiryData.attributes;
                                          return (
                                            <>
                                              <h3 className="vads-u-font-weight--normal vads-u-font-size--base vads-u-font-family--sans vads-u-border-bottom--2px vads-u-border-color--gray-light vads-u-padding-bottom--2">
                                    Severity: Critical
                                    Found in src/applications/ask-va/containers/IntroductionPage.jsx - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                            if (err?.errors?.[0]?.code === '401' || err?.issue?.[0]?.code === '401') {
                                              errorTitle =
                                                err?.errors?.[0]?.title ||
                                                err?.issue?.[0]?.diagnostics ||
                                                'Not authorized';
                                      Severity: Critical
                                      Found in src/applications/vaos/utils/error.js - About 1 hr to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                            if (showTuitionAndFilters) {
                                              return (
                                                <>
                                                  {!smallScreen && (
                                                    <>
                                        Severity: Critical
                                        Found in src/applications/gi/containers/search/LocationSearchResults.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language