department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function getDynamicContent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const getDynamicContent = formResponses => {
  // Final content to show on the results page
  const dynamicContentMatchingAnswer = [];

  // Get array of short names with responses in the store minus SERVICE_PERIOD and any question ending in '_A'
Severity: Minor
Found in src/applications/pact-act/utilities/results-1-1-dynamic-content.js - About 1 hr to fix

    Function useGetSearchResults has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function useGetSearchResults(articles, query, page) {
      const [results, setResults] = useState([]);
    
      // Refresh the results list when the query is submitted or the page is changed.
      useEffect(
    Severity: Minor
    Found in src/applications/resources-and-support/hooks/useGetSearchResults.js - About 1 hr to fix

      Function applyFocus has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const applyFocus = (parentId, headerHasFocused, setHeaderHasFocused) => {
        if (!headerHasFocused) {
          setTimeout(() => {
            const header = document
              .getElementById(parentId)
      Severity: Minor
      Found in src/applications/pact-act/utilities/page-setup.js - About 1 hr to fix

        Function renderAlert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const renderAlert = (alertType, statements) => {
          const alertInfo = alertMessage(alertType, APP_TYPES.DEBT);
          const showOther = statements > 0;
          const showVAReturnLink = !showOther && alertType !== ALERT_TYPES.ALL_ERROR;
        
        

          Function renderAlert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const renderAlert = (alertType, debts) => {
            const alertInfo = alertMessage(alertType, APP_TYPES.COPAY);
            const showOther = debts > 0;
            const showVAReturnLink = !showOther && alertType !== ALERT_TYPES.ALL_ERROR;
          
          

            Function SearchResultReducer has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const SearchResultReducer = (state = INITIAL_STATE, action) => {
              switch (action.type) {
                case FETCH_LOCATIONS:
                  return {
                    ...state,
            Severity: Minor
            Found in src/applications/facility-locator/reducers/searchResult.js - About 1 hr to fix

              Function addOrUpdateIssue has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const addOrUpdateIssue = () => {
                  setSubmitted(true);
                  if (!showIssueNameError && !invalidDate) {
                    const selectedCount =
                      getSelected(data).length + (currentData[SELECTED] ? 0 : 1);
              Severity: Minor
              Found in src/applications/appeals/shared/components/AddIssue.jsx - About 1 hr to fix

                Function WiderThanMobileLogoRow has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const WiderThanMobileLogoRow = () => {
                  return (
                    <div className="row va-flex usa-grid usa-grid-full va-header-logo-menu">
                      <div className="va-header-logo-wrapper">
                        <a

                  Function onContinueClick has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const onContinueClick = () => {
                      if (!formValue) {
                        setFormError(true);
                        applyErrorFocus('duw-dropdown');
                      } else {

                    Function DirectDepositDescription has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const DirectDepositDescription = () => {
                      const displayBankInfo = useCheckPath();
                    
                      return (
                        <div className="vads-u-margin-top--2 vads-u-margin-bottom--2">

                      Function applyFocus has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const applyFocus = (parentId, headerHasFocused, setHeaderHasFocused) => {
                        if (!headerHasFocused) {
                          setTimeout(() => {
                            const header = document
                              .getElementById(parentId)
                      Severity: Minor
                      Found in src/applications/discharge-wizard/utilities/page-setup.js - About 1 hr to fix

                        Function mapStateToProps has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const mapStateToProps = state => {
                          const { MEBClaimStatus, TOEClaimStatus } = state?.data;
                          let latestClaim;
                        
                          if (
                        Severity: Minor
                        Found in src/applications/education-letters/containers/InboxPage.jsx - About 1 hr to fix

                          Function onContinueClick has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const onContinueClick = () => {
                              if (!formValue) {
                                setFormError(true);
                                applyErrorFocus('duw-radio');
                              } else {

                            Function DirectDepositDescription has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const DirectDepositDescription = () => {
                              const displayBankInfo = useCheckPath();
                            
                              return (
                                <div className="vads-u-margin-top--2 vads-u-margin-bottom--2">

                              Function transformForSubmit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function transformForSubmit(formConfig, form) {
                                const transformedData = JSON.parse(
                                  formsSystemTransformForSubmit(formConfig, form),
                                );
                              
                              
                              Severity: Minor
                              Found in src/applications/ivc-champva/10-7959C/config/submitTransformer.js - About 1 hr to fix

                                Function DirectDepositDescription has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const DirectDepositDescription = () => {
                                  const displayBankInfo = useCheckPath();
                                
                                  return (
                                    <div className="vads-u-margin-top--2 vads-u-margin-bottom--2">

                                  Function PreferredFacilityAlert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const PreferredFacilityAlert = () => {
                                    // use logging to track the volume of users who receive this alert
                                    useEffect(() => {
                                      return () => {
                                        recordEvent({

                                    Function verifyEnrollment has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const verifyEnrollment = (state = initialState, action) => {
                                      switch (action.type) {
                                        case VERIFY_ENROLLMENT:
                                          return {
                                            ...state,

                                      Function libraryCount has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function libraryCount() {
                                        if (document.getElementById('no-results')) {
                                          document.getElementById('no-results').style.display = 'none';
                                          document.getElementById('va-pager-div').style.display = 'flex';
                                          document.getElementById('total-pages-div').style.display = 'flex';

                                        Function clinicsVisited has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const clinicsVisited = avs => {
                                          const shortTimezone = getShortTimezone(avs);
                                          const clinics = avs.clinicsVisited.map((clinic, idx) => {
                                            return (
                                              <div key={clinic.clinicIen}>
                                        Severity: Minor
                                        Found in src/applications/avs/components/YourAppointment.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language