department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,732 of 12,811 total issues

Function EditPreferences has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const EditPreferences = () => {
  const [editListModal, setEditListModal] = useState(false);
  const editPreferencesButtonRef = useRef();
  const handleModalClose = useCallback(() => {
    focusElement(editPreferencesButtonRef.current);

    Function ClaimantInformationComponent has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function ClaimantInformationComponent() {
      const {
        gender,
        dob,
        userFullName: { first, last },

      Function handleDeleteDraftConfirm has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const handleDeleteDraftConfirm = () => {
          if (savedDraft) {
            setNavigationError(null);
            setIsModalVisible(false);
            dispatch(deleteDraft(draftId)).then(() => {

        Function FoldersList has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const FoldersList = props => {
          const { folders, showUnread } = props;
        
          return (
            <div className="vads-u-margin-top--2">
        Severity: Minor
        Found in src/applications/mhv-secure-messaging/components/FoldersList.jsx - About 1 hr to fix

          Function getFacilityPageInfo has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function getFacilityPageInfo(state) {
            const formInfo = getCovid19VaccineFormPageInfo(state, 'vaFacility');
            const data = selectCovid19VaccineFormData(state);
            const newBooking = selectCovid19VaccineNewBooking(state);
          
          
          Severity: Minor
          Found in src/applications/vaos/covid-19-vaccine/redux/selectors.js - About 1 hr to fix

            Function transformFormToAppointment has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function transformFormToAppointment(state) {
              const data = getFormData(state);
              const clinic = getChosenClinicInfo(state);
              const timezone = getTimezoneByFacilityId(data.vaFacility);
            
            

              Function clearAllFilters has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const clearAllFilters = () => {
                  dispatchFilterChange({
                    ...filters,
                    schools: true,
                    excludedSchoolTypes: [
              Severity: Minor
              Found in src/applications/gi/components/ClearFiltersBtn.jsx - About 1 hr to fix

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

                  const searchResults = (cnt, visible = true) => {
                    if (cnt > 0) {
                      const containerClassNames = classNames(
                        'location-search-results-container',
                        'usa-grid',
                Severity: Minor
                Found in src/applications/gi/containers/search/LocationSearchResults.jsx - About 1 hr to fix

                  Function otherCheckboxes has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function otherCheckboxes(
                    handleVetTechPreferredProviderChange,
                    options,
                    smallScreen,
                    automatedTest = false,
                  Severity: Minor
                  Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 1 hr to fix

                    Function LoginAlert has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const LoginAlert = () => {
                      const { ID_ME, LOGIN_GOV } = CSP_IDS;
                      const heading = `Verify your identity with Login.gov or ID.me to change your direct deposit information online`;
                      return (
                        <VaAlert status="continue" visible uswds>

                      Function yellowRibbonReducer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const yellowRibbonReducer = (state = initialState, action) => {
                        switch (action.type) {
                          case FETCH_RESULTS: {
                            return {
                              ...state,
                      Severity: Minor
                      Found in src/applications/yellow-ribbon/reducers/index.js - About 1 hr to fix

                        Function ItemList has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const ItemList = props => {
                          const { list } = props;
                          if (typeof list === 'string')
                            return (
                              <span data-dd-privacy="mask" data-testid="item-list-string">
                        Severity: Minor
                        Found in src/applications/mhv-medical-records/components/shared/ItemList.jsx - About 1 hr to fix

                          Function DownloadingRecordsInfo has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const DownloadingRecordsInfo = props => {
                            const { allowTxtDownloads } = props;
                          
                            const publicSharedContent = () => {
                              return (

                            Function redirectOrLoad has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              redirectOrLoad(props) {
                                // Stop a user that's been redirected from being redirected again after
                                // logging in
                                this.shouldRedirectOrLoad = false;
                            
                            
                            Severity: Minor
                            Found in src/platform/forms/save-in-progress/RoutedSavableApp.jsx - About 1 hr to fix

                              Function DefaultErrorMessage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const DefaultErrorMessage = () => {
                                  let InlineErrorComponent;
                                  if (isReactComponent(errorText)) {
                                    InlineErrorComponent = errorText;
                                  } else if (typeof errorText === 'string') {
                              Severity: Minor
                              Found in src/platform/forms/components/review/FormSaveErrorMessage.jsx - About 1 hr to fix

                                Function currentOrPastDateRangeUI has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const currentOrPastDateRangeUI = (fromOptions, toOptions, errorMessage) => {
                                  let fromLabel = 'From date';
                                  let toLabel = 'To date';
                                  let fromCustomOptions = {};
                                  let toCustomOptions = {};

                                  Function expandArrayPages has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function expandArrayPages(pageList, data) {
                                    const result = pageList.reduce(
                                      (acc, nextPage) => {
                                        const { lastArrayPath, arrayPages, currentList } = acc;
                                        // If we see an array page and we’re starting a section or in the middle of one, just add it
                                  Severity: Minor
                                  Found in src/platform/forms-system/src/js/helpers.js - About 1 hr to fix

                                    Function handleEdit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      handleEdit(key, editing, index = null) {
                                        if (editing || !this.hasValidationError(key, index)) {
                                          this.props.onEdit(key, editing, index);
                                          const name = fixSelector(key);
                                    
                                    

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

                                        render() {
                                          const { terms, topContent } = this.props;
                                          const enabled =
                                            this.props.isDataAvailable === true ||
                                            typeof this.props.isDataAvailable === 'undefined';

                                        Function deselectBasedOnValue has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          static deselectBasedOnValue(name, value, formData, properties) {
                                            // derive the notListedTextKey by looking at the form schema properties for a 'string' field type
                                            // be aware this logic limits the usage to a single text field for a 'write in' style field
                                            const notListedTextKey = Object.entries(properties).reduce(
                                              (previous, [propertyKey, { type }]) => {
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language