department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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

export function fetchUser() {
  return async dispatch => {
    dispatch({
      type: FETCH_USER,
    });
Severity: Minor
Found in src/applications/accredited-representative-portal/actions/user.js - About 1 hr to fix

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

      const searchResults = () => {
        if (loading) {
          return loader();
        }
        if (hasFacilities()) {

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

        const filterAndSortInquiries = loa => {
          return inquiries
            .filter(
              card =>
                categoryFilter === 'All' ||
      Severity: Minor
      Found in src/applications/ask-va/containers/DashboardCards.jsx - About 1 hr to fix

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

        const ConfirmationPage = () => {
          const { submission, data } = useSelector(state => state.form);
          const { response, timestamp } = submission;
          const name = data.veteranFullName;
        
        
        Severity: Minor
        Found in src/applications/caregivers/containers/ConfirmationPage.jsx - About 1 hr to fix

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

          const clearSpouseData = formData => {
            return {
              ...formData,
              questions: {
                ...formData.questions,

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

            export const saveDraft = (messageData, type, id) => async dispatch => {
              recordEvent({
                // For Google Analytics
                event: 'secure-messaging-save-draft-type',
                'secure-messaging-save-draft': type,
            Severity: Minor
            Found in src/applications/mhv-secure-messaging/actions/draftDetails.js - About 1 hr to fix

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

                  () => {
                    return (
                      isTranstioningFacility && (
                        <va-alert status="warning" class="vads-u-margin-y--2">
                          <h1 slot="headline">

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

                const appointmentIcon = appointment => {
                  const isPhone = isVAPhoneAppointment(appointment);
                  const {
                    isCommunityCare,
                    isCompAndPenAppointment,

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

                  export function transformFormToVAOSVARequest(state) {
                    const data = getFormData(state);
                    const typeOfCare = getTypeOfCare(data);
                  
                    return {

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

                    export function getAppointmentTimezone(appointment) {
                      // Appointments with timezone included in api
                      if (appointment?.timezone) {
                        const abbreviation = getTimezoneAbbrFromApi(appointment);
                    
                    
                    Severity: Minor
                    Found in src/applications/vaos/services/appointment/index.js - About 1 hr to fix

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

                        const renderScholarships = () => {
                          if (!displayedInputs.scholarships) return null;
                          const scholarshipsId = 'scholarships';
                          const scholarshipsFieldId = `${scholarshipsId}-field`;
                          return (

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

                        export function fetchNameAutocompleteSuggestions(name, filterFields, version) {
                          if (name === '' || name === null || name === undefined) {
                            return { type: NAME_AUTOCOMPLETE_SUCCEEDED, payload: [] };
                          }
                        
                        
                        Severity: Minor
                        Found in src/applications/gi/actions/index.js - About 1 hr to fix

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

                            const renderTuition = () => {
                              if (!displayedInputs.tuition) return null;
                          
                              const tuitionFeesId = 'tuitionFees';
                              const tuitionFeesFieldId = `${tuitionFeesId}-field`;

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

                              const renderTuitionAssist = () => {
                                if (!displayedInputs.tuitionAssist) return null;
                                const tuitionAssistId = 'tuitionAssist';
                                const tuitionAssistFieldId = `${tuitionAssistId}-field`;
                                return (

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

                              export function getCemeteries() {
                                return fetch(`${environment.API_URL}/v0/preneeds/cemeteries`, {
                                  credentials: 'include',
                                  headers: {
                                    'X-Key-Inflection': 'camel',
                              Severity: Minor
                              Found in src/applications/pre-need-integration/utils/helpers.js - About 1 hr to fix

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

                                const nationalExamsReducer = (state = INITIAL_STATE, action) => {
                                  switch (action.type) {
                                    case FETCH_NATIONAL_EXAMS_STARTED:
                                      return { ...state, loading: true, error: null };
                                
                                
                                Severity: Minor
                                Found in src/applications/gi/reducers/nationalExams.js - About 1 hr to fix

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

                                  export const fetchResultsApi = async (options = {}) => {
                                    // Derive options properties.
                                    const city = options?.city;
                                    const contribution_amount = options?.contributionAmount;
                                    const mockRequest = options?.mockRequest;
                                  Severity: Minor
                                  Found in src/applications/yellow-ribbon/api/index.js - About 1 hr to fix

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

                                    function allDependents(state = initialState, action) {
                                      switch (action.type) {
                                        case FETCH_ALL_DEPENDENTS_SUCCESS:
                                          if (action.response.persons && action.response.persons.length > 0) {
                                            allPeople = splitPersons(action.response.persons);
                                    Severity: Minor
                                    Found in src/applications/personalization/view-dependents/reducers/index.js - About 1 hr to fix

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

                                      export function uiSchema(
                                        subHeader = veteranApplicantDetailsSubHeader,
                                        description = '',
                                        nameUI = nonPreparerFullMaidenNameUI,
                                        ssnUI = ssnDashesUI,

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

                                        function deepEqual(obj1, obj2) {
                                          if (obj1 === obj2) return true;
                                        
                                          if (
                                            typeof obj1 !== 'object' ||
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language