department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function PrepareContent has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const PrepareContent = props => {
  const { smallHeading, router, appointmentCount } = props;
  const { jumpToPage } = useFormRouting(router);
  const { t } = useTranslation();
  const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
Severity: Minor
Found in src/applications/check-in/components/PrepareContent.jsx - About 1 hr to fix

    Function VeteranInfoBox has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const VeteranInfoBox = props => {
      const {
        first,
        middle,
        last,

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

        render() {
          const { submissionStatus, claimId } = this.state;
          if (submissionStatus === submissionStatuses.pending) {
            setTimeout(() => focusElement('.loading-indicator-container'));
            return (

        Function addForm0781 has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const addForm0781 = formData => {
          const clonedData = _.cloneDeep(formData);
          const incidentKeys = getFlatIncidentKeys();
          const incidents = incidentKeys
            .filter(incidentKey => clonedData[incidentKey])
        Severity: Minor
        Found in src/applications/disability-benefits/all-claims/utils/submit.js - About 1 hr to fix

          Function GroupCheckboxWidget has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const GroupCheckboxWidget = props => {
            const { value, options, formContext, onChange } = props;
            const { onReviewPage, reviewMode } = formContext || {};
            const { labels } = options;
          
          

            Function transformMarriage has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function transformMarriage(marriage) {
                  const transformedMarriage = { ...marriage };
                  if (
                    transformedMarriage['view:pastMarriage'] &&
                    transformedMarriage['view:pastMarriage'].reasonForSeparation
            Severity: Minor
            Found in src/applications/pensions/migrations.js - About 1 hr to fix

              Function FacilityReview has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const FacilityReview = props => {
                const { data, goToPath } = props;
                const plannedClinic = data['view:plannedClinic'];
                const veteranSelectedFacility = plannedClinic.veteranSelected;
                const selectedCaregiverSupportFacility = plannedClinic.caregiverSupport;

                Function useDetectFieldChanges has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const useDetectFieldChanges = formData => {
                  const prevDataRef = useRef();
                  const [shouldShowReviewButton, setShouldShowReviewButton] = useState(true);
                
                  useEffect(

                  Function updateFormData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const updateFormData = e => {
                      e.preventDefault();
                  
                      if (!employmentRecord.type || employmentRecord.type === '') {
                        setTypeError('Please select your type of work.');

                    Function ReadOnlyUserDescription has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const ReadOnlyUserDescription = props => {
                      const [isLoggedIn, setIsLoggedIn] = useState();
                      useEffect(
                        () => {
                          setIsLoggedIn(props.isLoggedIn);
                    Severity: Minor
                    Found in src/applications/vre/25-8832/components/ReadOnlyUserDescription.js - About 1 hr to fix

                      Function fetchFormStatus has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const fetchFormStatus = () => async dispatch => {
                        dispatch({
                          type: FSR_API_CALL_INITIATED,
                        });
                      
                      
                      Severity: Minor
                      Found in src/applications/financial-status-report/actions/index.js - About 1 hr to fix

                        Function updateFormData has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const updateFormData = e => {
                            e.preventDefault();
                        
                            if (!employmentRecord.type || employmentRecord.type === '') {
                              setTypeError('Please select your type of work.');

                          Function handleSearch has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const handleSearch = () => {
                              setFiltersCleared(false);
                              if (filterBoxRef.current.checkFormValidity()) return;
                          
                              let relativeToDate;

                            Function CrisisLineConnectButton has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const CrisisLineConnectButton = () => {
                              const [lastFocusableElement, setLastFocusableElement] = useState(null);
                              const [crisisModalOpened, setCrisisModalOpened] = useState(false);
                            
                              useEffect(

                              Function NeedHelp has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function NeedHelp() {
                                return (
                                  <div className="vads-u-margin-top--9 vads-u-margin-bottom--3">
                                    <h2 className="vads-u-font-size--h3 vads-u-margin-bottom--0">
                                      Need help?
                              Severity: Minor
                              Found in src/applications/vaos/components/NeedHelp.jsx - About 1 hr to fix

                                Function PreferredDatePage has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function PreferredDatePage() {
                                  const pageTitle = useSelector(state => getPageTitle(state, pageKey));
                                
                                  const dispatch = useDispatch();
                                  const { schema, data, pageChangeInProgress } = useSelector(

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

                                  export function uiSchema(
                                    addressTitle = applicantContactInfoAddressTitle,
                                    contactInfoSubheader = applicantContactInfoSubheader,
                                    contactInfoDescription = applicantContactInfoDescription,
                                  ) {

                                    Function locationUiSchema has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const locationUiSchema = uiRequiredCallback => {
                                      return {
                                        isOutsideUs: {
                                          'ui:title': 'This happened outside of the U.S.',
                                        },

                                      Function debtsReducer has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const debtsReducer = (state = initialState, action) => {
                                        switch (action.type) {
                                          case DEBTS_FETCH_INITIATED || COPAYS_FETCH_INITIATED:
                                            return {
                                              ...state,
                                      Severity: Minor
                                      Found in src/applications/personalization/dashboard/reducers/debts.js - About 1 hr to fix

                                        Function PrintOnlyPage has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const PrintOnlyPage = props => {
                                          const { children, title, preface, subtitle, hasError } = props;
                                          return (
                                            <div className="print-only landing-page">
                                              <div
                                        Severity: Minor
                                        Found in src/applications/mhv-medications/containers/PrintOnlyPage.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language