department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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

    export const fetchDebtLetters = async (dispatch, debtLettersActive) => {
      dispatch(fetchDebtsInitiated());
      try {
        const options = {
          method: 'GET',
    Severity: Major
    Found in src/applications/combined-debt-portal/combined/actions/debts.js - About 2 hrs to fix

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

        export const IntroductionPage = props => {
          useEffect(() => {
            focusElement('h1');
            scrollTo('topContentElement');
          });
        Severity: Major
        Found in src/applications/appeals/testing/hlr/containers/IntroductionPage.jsx - About 2 hrs to fix

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

            render() {
              const { submission, data } = this.props.form;
              const { response } = submission;
              const name = data.applicantFullName;
          
          

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

            const renderMedicalRecordInfo = formValues => {
              if (['1', '2', '4'].indexOf(formValues['4_reason']) > -1) {
                let requestQuestion;
                if (parseInt(formValues['2_dischargeYear'], 10) >= 1992) {
                  requestQuestion = (
            Severity: Major
            Found in src/applications/discharge-wizard/components/gpSteps/StepTwo.jsx - About 2 hrs to fix

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

              export const verifyEnrollmentAction = verifications => {
                return async (dispatch, getState) => {
                  dispatch({ type: VERIFY_ENROLLMENT });
                  const {
                    checkClaimant: { claimantId },
              Severity: Major
              Found in src/applications/verify-your-enrollment/actions/index.js - About 2 hrs to fix

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

                export function transform(formConfig, form) {
                  // Copy over sponsor data if the claimant is the veteran.
                  const populateSponsorData = application =>
                    isVeteran({ application })
                      ? merge({}, application, {
                Severity: Major
                Found in src/applications/pre-need/utils/helpers.js - About 2 hrs to fix

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

                      () => {
                        if (!enrollmentVerification) {
                          return;
                        }
                  
                  

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

                    export const useData = () => {
                      // This custom hook is for fetching and preparing user data from the Redux state.
                      const dispatch = useDispatch();
                      const response = useSelector(state => state.personalInfo);
                      const claimantIdResponse = useSelector(state => state.checkClaimant);
                    Severity: Major
                    Found in src/applications/verify-your-enrollment/hooks/useData.js - About 2 hrs to fix

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

                      export const SearchResultReducer = (state = INITIAL_STATE, action) => {
                        switch (action.type) {
                          case FETCH_REPRESENTATIVES:
                          case SEARCH_COMPLETE:
                            return {
                      Severity: Major
                      Found in src/applications/representative-search/reducers/searchResult.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 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 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 NotFound has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const NotFound = () => {
                                const content = {
                                  heading: 'We couldn’t verify your identity',
                                  alertText: (
                                    <div>

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

                                export const submitTransformer = (formConfig, form) => {
                                  let dataToMap = JSON.parse(transformForSubmit(formConfig, form));
                                
                                  // map Veteran address data if mailing and home addresses match
                                  if (form.data['view:doesMailingMatchHomeAddress']) {
                                Severity: Major
                                Found in src/applications/hca/config/submit-transformer.js - About 2 hrs to fix

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

                                  const fsrApi = (state = initialState, action) => {
                                    switch (action.type) {
                                      case FSR_API_ERROR:
                                        return {
                                          ...state,
                                  Severity: Major
                                  Found in src/applications/financial-status-report/reducers/index.js - About 2 hrs to fix

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

                                      _override: (error, fullError) => {
                                        const errorMapping = {
                                          questions: {
                                            chapterKey: 'bankruptcyAttestationChapter',
                                            pageKey: 'bankruptcyHistory',
                                    Severity: Major
                                    Found in src/applications/financial-status-report/constants/reviewErrors.js - About 2 hrs to fix

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

                                      const CategoryInput = props => {
                                        const {
                                          categories,
                                          category,
                                          categoryError,

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

                                        export default function VideoInstructions() {
                                          return (
                                            <va-additional-info
                                              trigger="How to setup your device"
                                              disableBorder="true"
                                        Severity: Major
                                        Found in src/applications/vaos/components/VideoInstructions.jsx - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language