department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function populateForm has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const populateForm = () => {
    if (recipientExists(draft.recipientId)) {
      setSelectedRecipientId(draft.recipientId);
    } else {
      const newRecipient = {

    Function IdentityNotVerified has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const IdentityNotVerified = () => {
      const content = (
        <>
          <p className="vads-u-font-size--base">
            We need to make sure you’re you — and not someone pretending to be you —
    Severity: Minor
    Found in src/applications/vre/28-1900/components/IdentityNotVerified.jsx - About 1 hr to fix

      Function getThreadList has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getThreadList = async params => {
        const {
          folderId = 0,
          pageSize = 10,
          pageNumber = 1,
      Severity: Minor
      Found in src/applications/mhv-secure-messaging/api/SmApi.js - About 1 hr to fix

        Function selectAppointmentLocality has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function selectAppointmentLocality(
          appointment,
          isPendingAppointment = false,
        ) {
          const practitioner = selectPractitionerName(appointment);
        Severity: Minor
        Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 hr to fix

          Function NoFilterMatchWarning has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const NoFilterMatchWarning = () => {
            const warningRef = useRef();
            useEffect(() => {
              focusElement(warningRef.current);
            });

            Function NoRegistrationMessage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function NoRegistrationMessage() {
              return (
                <FullWidthLayout>
                  <InfoAlert
                    status="error"
            Severity: Minor
            Found in src/applications/vaos/components/NoRegistrationMessage.jsx - About 1 hr to fix

              Function filteredAppointments has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  const filteredAppointments = appointments.filter(appointment => {
                    return req.query.statuses.some(status => {
                      if (appointment.attributes.status === status) {
                        // Automatically add appointments with these statuses to the collection
                        if (
              Severity: Minor
              Found in src/applications/vaos/services/mocks/index.js - About 1 hr to fix

                Function LoadProvidersErrorAlert has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function LoadProvidersErrorAlert() {
                  const headline = `We can’t load provider information`;
                  return (
                    <div id="providerSelectionFailed">
                      <InfoAlert

                  Function generateClaimTitle has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const generateClaimTitle = (claim, placement, tab) => {
                    // This will default to 'disability compensation'
                    const claimType = getClaimType(claim).toLowerCase();
                    const isRequestToAddOrRemoveDependent = addOrRemoveDependentClaimTypeCodes.includes(
                      claim?.attributes?.claimTypeCode,
                  Severity: Minor
                  Found in src/applications/claims-status/utils/helpers.js - About 1 hr to fix

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

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

                      Function eligibilityAndFilters has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const eligibilityAndFilters = cnt => {
                          const showTuitionAndFilters = cnt > 0 || usedFilters;
                      
                          if (showTuitionAndFilters) {
                            return (
                      Severity: Minor
                      Found in src/applications/gi/containers/search/LocationSearchResults.jsx - About 1 hr to fix

                        Function handleInputFocusWithPotentialOverLap has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const handleInputFocusWithPotentialOverLap = (
                          fieldId1,
                          fieldId2,
                          scrollableFieldId,
                        ) => {
                        Severity: Minor
                        Found in src/applications/gi/utils/helpers.js - About 1 hr to fix

                          Function makeLoadedCards has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const makeLoadedCards = () => {
                              setLoadedCards(
                                loaded.map((facilityCode, index) => {
                                  return (
                                    <li
                          Severity: Minor
                          Found in src/applications/gi/containers/CompareDrawer.jsx - About 1 hr to fix

                            Function preEligibilityChange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const preEligibilityChange = (e, name, number) => {
                                const field = e.target.name;
                                const { value } = e.target;
                            
                                if (field === 'giBillChapter' && value === '33a') {
                            Severity: Minor
                            Found in src/applications/gi/components/profile/BenefitsForm.jsx - About 1 hr to fix

                              Function renderOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const renderOptions = () => {
                                  const displayOptions = Array.isArray(options) ? options : [];
                                  return displayOptions.map((option, index) => {
                                    const { checked, optionLabel, name, learnMore, dataTestId } = option;
                              
                              
                              Severity: Minor
                              Found in src/applications/gi/components/VaCheckboxGroupGi.jsx - About 1 hr to fix

                                Function preEligibilityChange has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  const preEligibilityChange = e => {
                                    const { value } = e.target;
                                
                                    recordEvent({
                                      event: 'gibct-form-change',
                                Severity: Minor
                                Found in src/applications/gi/components/SearchBenefits.jsx - About 1 hr to fix

                                  Function HomePage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const HomePage = () => {
                                    return (
                                      <div className="vads-u-margin-bottom--8">
                                        <h1 data-testid="comparison-tool-title">GI Bill® Comparison Tool</h1>
                                        <p
                                  Severity: Minor
                                  Found in src/applications/gi/updated-gi/components/Homepage.jsx - About 1 hr to fix

                                    Function addressLabel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const addressLabel = address => {
                                      // Destructure address object for easier access
                                      const {
                                        addressLine1,
                                        addressLine2,

                                      Function transformServiceHistoryEntryIntoTableRow has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const transformServiceHistoryEntryIntoTableRow = entry => {
                                        const formattedBeginDate = entry.beginDate
                                          ? moment(entry.beginDate).format('LL')
                                          : '';
                                        const formattedEndDate = entry.endDate
                                      Severity: Minor
                                      Found in src/applications/personalization/profile/helpers.js - About 1 hr to fix

                                        Function promises has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            .map(([key, fetchFn]) => {
                                              if (key === 'appointments') {
                                                let fromDate;
                                                let toDate;
                                                if (dateFilter.option === 'any') {
                                        Severity: Minor
                                        Found in src/applications/mhv-medical-records/actions/blueButtonReport.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language