department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function UpgradeFailed has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const UpgradeFailed = () => {
  const content = {
    heading: 'We couldn’t upgrade your My HealtheVet account',
    alertText: (
      <>

    Function Footer has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Footer = () => {
      return (
        <footer data-testid="arp-footer" className="footer arp-footer">
          <div className="footer-inner">
            <div className="usa-grid usa-grid-full footer-banner vads-u-padding-top--2">

      Function renderWhyMightIHaveThisDebt has 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const renderWhyMightIHaveThisDebt = deductionCode => {
        switch (deductionCode) {
          case '30':
            return (
              <section>

        Function YourVAHealthFacilityPage has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const YourVAHealthFacilityPage = props => {
          const { data, setFormData, goBack, goForward } = props;
          const [apiData, setApiData] = useState(facilities);
          const [isSearching, setIsSearching] = useState(false);
          const [pageURL, setPageURL] = useState('');
        Severity: Major
        Found in src/applications/ask-va/containers/YourVAHealthFacility.jsx - About 2 hrs to fix

          Function ConfirmationPage has 70 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: Major
          Found in src/applications/caregivers/containers/ConfirmationPage.jsx - About 2 hrs to fix

            Function CategorySelect has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const CategorySelect = props => {
              const { id, onChange, value, loggedIn } = props;
              const dispatch = useDispatch();
            
              const [apiData, setApiData] = useState([]);
            Severity: Major
            Found in src/applications/ask-va/components/FormFields/CategorySelect.jsx - About 2 hrs to fix

              Function saveDraftHandler has 70 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  async (type, e) => {
                    const {
                      messageValid,
                      signatureValid,
                      checkboxValid,

                Function getLetterPdf has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function getLetterPdf(letterType, letterName, letterOptions, LH_MIGRATION__options) {
                  let settings;
                  if (letterType === LETTER_TYPES.benefitSummary) {
                    settings = {
                      // eslint-disable-next-line -- LH_MIGRATION
                Severity: Major
                Found in src/applications/letters/actions/letters.js - About 2 hrs to fix

                  Function getAppointmentSlots has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function getAppointmentSlots(startDate, endDate, initialFetch = false) {
                    return async (dispatch, getState) => {
                      const state = getState();
                      const siteId = getSiteIdFromFacilityId(
                        selectCovid19VaccineFormData(state).vaFacility,
                  Severity: Major
                  Found in src/applications/vaos/covid-19-vaccine/redux/actions.js - About 2 hrs to fix

                    Function getAddressUISchema has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function getAddressUISchema(label = '') {
                      const fieldOrder = ['street', 'street2', 'city', 'state', 'postalCode'];
                    
                      const addressChangeSelector = createSelector(
                        ({ formData, path }) => get(path.concat('city'), formData),
                    Severity: Major
                    Found in src/applications/vaos/new-appointment/fields/addressFields.js - About 2 hrs to fix

                      Function onAllComplete has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  onAllComplete: () => {
                                    if (canUseMocks()) {
                                      dispatch({ type: DONE_UPLOADING });
                                      dispatch(
                                        setNotification({
                      Severity: Major
                      Found in src/applications/claims-status/actions/index.js - About 2 hrs to fix

                        Function fetchMilitaryInformation has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function fetchMilitaryInformation(recordAnalyticsEvent = recordEvent) {
                          return async dispatch => {
                            dispatch({ type: FETCH_MILITARY_INFORMATION });
                        
                            const baseUrl = '/profile/service_history';
                        Severity: Major
                        Found in src/applications/personalization/profile/actions/index.js - About 2 hrs to fix

                          Function careSummariesAndNotesReducer has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const careSummariesAndNotesReducer = (state = initialState, action) => {
                            switch (action.type) {
                              case Actions.CareSummariesAndNotes.GET: {
                                return {
                                  ...state,

                            Function RxBreadcrumbs has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const RxBreadcrumbs = () => {
                              const location = useLocation();
                              const prescription = useSelector(
                                state => state.rx.prescriptions?.prescriptionDetails,
                              );
                            Severity: Major
                            Found in src/applications/mhv-medications/containers/RxBreadcrumbs.jsx - About 2 hrs to fix

                              Function pdfData has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  allergiesPdfList => {
                                    return {
                                      subject: `Single Medication Record - ${prescription?.prescriptionName}`,
                                      headerBanner: [
                                        {
                              Severity: Major
                              Found in src/applications/mhv-medications/containers/PrescriptionDetails.jsx - About 2 hrs to fix

                                Function setupJSDom has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function setupJSDom() {
                                  // Prevent warnings from displaying
                                  /* eslint-disable no-console */
                                  if (process.env.LOG_LEVEL === 'debug') {
                                    console.error = (error, reactError) => {
                                Severity: Major
                                Found in src/platform/testing/unit/mocha-setup.js - About 2 hrs to fix

                                  Function VaCheckboxGroupField has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export default function VaCheckboxGroupField(props) {
                                    const checkboxes = getCheckboxData(props.childrenProps);
                                  
                                    const onGroupChange = event => {
                                      const checkboxKey = event.target.dataset.key;

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

                                      render() {
                                        const {
                                          uiSchema,
                                          errorSchema,
                                          idSchema,
                                    Severity: Major
                                    Found in src/platform/forms-system/src/js/review/ReadOnlyArrayField.jsx - About 2 hrs to fix

                                      Function setHiddenFields has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function setHiddenFields(schema, uiSchema, formData, path = []) {
                                        if (!uiSchema) {
                                          return schema;
                                        }
                                      
                                      
                                      Severity: Major
                                      Found in src/platform/forms-system/src/js/state/helpers.js - About 2 hrs to fix

                                        Function formatOperatingHours has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const formatOperatingHours = operatingHours => {
                                          if (!operatingHours) return operatingHours;
                                          // Remove all whitespace and sanitize dashes.
                                          const sanitizedOperatingHours = operatingHours
                                            .replace(/ /g, '')
                                        Severity: Major
                                        Found in src/applications/facility-locator/utils/helpers.jsx - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language