department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,732 of 12,811 total issues

Function addFile has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const addFile = (file, state, setState) => {
  let docType = '';
  if (!isValidFileType(file)) {
    setState({
      ...state,

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

    export function fetchTotalDisabilityRating() {
      return dispatch => {
        const {
          FETCH_DISABILITY_RATING_STARTED,
          FETCH_DISABILITY_RATING_FAILED,
    Severity: Minor
    Found in src/applications/hca/utils/actions/disability-rating.js - About 1 hr to fix

      Function UnauthContext has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const UnauthContext = () => {
        const dispatch = useDispatch();
        const handleSigninClick = () => {
          recordEvent({ event: AUTH_EVENTS.LOGIN });
          dispatch(toggleLoginModal(true, 'coronavirus-vaccination'));
      Severity: Minor
      Found in src/applications/static-pages/BTSSS-login/UnauthContext/index.jsx - About 1 hr to fix

        Function prefillTransformer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function prefillTransformer(pages, formData, metadata, state) {
          const {
            residentialAddress,
            mailingAddress,
          } = state.user.profile?.vapContactInfo;
        Severity: Minor
        Found in src/applications/hca/utils/helpers/index.js - About 1 hr to fix

          Function updateDiariesService has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function updateDiariesService(shouldUpdate) {
            return async dispatch => {
              if (!shouldUpdate) {
                dispatch({
                  type: UPDATE_DIARIES_SKIP,

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

              render() {
                if (this.props.loading) {
                  return <va-loading-indicator message="Loading facility..." />;
                }
            
            
            Severity: Minor
            Found in src/applications/static-pages/facilities/FacilityMapWidget.jsx - About 1 hr to fix

              Function onSuccess has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const onSuccess = resp => {
                  const successfulSubmissions = resp.filter(response =>
                    response.status.toLowerCase().includes('processed'),
                  );
                  const failedSubmissions = resp.filter(
              Severity: Minor
              Found in src/applications/disability-benefits/2346/config/form.js - About 1 hr to fix

                Function TravelAgreement has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const TravelAgreement = props => {
                  const { router } = props;
                  const { t } = useTranslation();
                
                  const { goToPreviousPage } = useFormRouting(router);

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

                  const mapStateToProps = (state, ownProps) => {
                    const supplies = state.form?.data?.supplies;
                    const batterySupplies = supplies
                      ?.filter(battery => battery.productGroup?.includes('Battery'))
                      .filter(battery => moment().diff(battery.nextAvailabilityDate) >= 0);

                    Function submit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function submit(form, formConfig) {
                      const headers = { 'Content-Type': 'application/json' };
                    
                      const body = transform(formConfig, form);
                      const apiRequestOptions = {
                    Severity: Minor
                    Found in src/applications/burials-ez/utils/helpers.jsx - About 1 hr to fix

                      Function getDateFilters has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function getDateFilters() {
                        const today = utcToZonedTime(new Date());
                        let quarter = getQuarter(today);
                      
                        const dateRanges = [];
                      Severity: Minor
                      Found in src/applications/travel-pay/util/dates.js - About 1 hr to fix

                        Function newFolder has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const newFolder = folderName => async dispatch => {
                          try {
                            const response = await createFolder(folderName);
                        
                            dispatch({
                        Severity: Minor
                        Found in src/applications/mhv-secure-messaging/actions/folders.js - About 1 hr to fix

                          Function handleConfirmMoveFolderTo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const handleConfirmMoveFolderTo = () => {
                              if (selectedFolder === null) {
                                setFolderInputError(
                                  Constants.ErrorMessages.MoveConversation.FOLDER_REQUIRED,
                                );

                            Function getTab has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const getTab = (tabName, label) => {
                                const activeTab = tabName === tab;
                                const tabClasses = classNames(
                                  {
                                    'active-search-tab': activeTab,
                            Severity: Minor
                            Found in src/applications/gi/components/search/SearchTabs.jsx - About 1 hr to fix

                              Function renderInState has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const renderInState = () => {
                                  if (!displayedInputs.inState) return null;
                                  const { inStateTuitionInformation } = profile.attributes;
                                  const radioButtonsLabelText = 'Are you an in-state student?';
                                  const options = [

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

                                const mapStateToProps = state => {
                                  const allLoaded =
                                    _.difference(state.compare.selected, state.compare.details.loaded)
                                      .length === 0;
                                  const estimated = {};
                                Severity: Minor
                                Found in src/applications/gi/containers/ComparePage.jsx - About 1 hr to fix

                                  Function fetchSearchByLocationResults has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

                                    Function GiBillBreadcrumbs has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const GiBillBreadcrumbs = () => {
                                      const profileMatch = useRouteMatch('/institution/:facilityCode');
                                      const compareMatch = useRouteMatch('/compare');
                                      const crumbLiEnding = giDocumentTitle();
                                      const crumbs = [
                                    Severity: Minor
                                    Found in src/applications/gi/components/GiBillBreadcrumbs.jsx - About 1 hr to fix

                                      Function handleAdd has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        handleAdd() {
                                          const numberOfItems = this.props.formData.length;
                                          const lastIndex = numberOfItems - 1;
                                      
                                          if (errorSchemaIsValid(this.props.errorSchema[lastIndex])) {

                                        Function buildPrescriptionsTXT has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const buildPrescriptionsTXT = prescriptions => {
                                          let result = `
                                        ---------------------------------------------------------------------------------
                                        
                                          `;
                                        Severity: Minor
                                        Found in src/applications/mhv-medications/util/txtConfigs.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language