department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

File labels.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import constants from 'vets-json-schema/dist/constants.json';

export const militaryBranches = [
  'Air Force',
  'Army',
Severity: Minor
Found in src/platform/forms/address/data/labels.js - About 2 hrs to fix

    File SmApi.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import environment from '@department-of-veterans-affairs/platform-utilities/environment';
    import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/exports';
    import { DefaultFolders, threadSortingOptions } from '../util/constants';
    
    const apiBasePath = `${environment.API_URL}/my_health/v1`;
    Severity: Minor
    Found in src/applications/mhv-secure-messaging/api/SmApi.js - About 2 hrs to fix

      File VAFacilityPageV2.jsx has 272 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useEffect } from 'react';
      import { shallowEqual, useDispatch, useSelector } from 'react-redux';
      import { useHistory } from 'react-router-dom';
      import SchemaForm from 'platform/forms-system/src/js/components/SchemaForm';
      import { usePrevious } from 'platform/utilities/react-hooks';

        Function isValidForm has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function isValidForm(form, pageList, isTesting = false) {
          const pageListMap = new Map();
          pageList.forEach(page => pageListMap.set(page.pageKey, page));
          const validPages = Object.keys(form.pages).filter(pageKey =>
            isActivePage(find(pageList, { pageKey }), form.data),
        Severity: Major
        Found in src/platform/forms-system/src/js/validation.js - About 2 hrs to fix

          Function reduceErrors has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            errors.reduce((processedErrors, error) => {
              let errorIndex = null; // save key (index) of array items with __error
              const findErrors = (name, err) => {
                if (err && typeof err === 'object') {
                  // process the last type of error message which provides an `__errors`
          Severity: Major
          Found in src/platform/forms-system/src/js/utilities/data/reduceErrors.js - About 2 hrs to fix

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

              render() {
                return (
                  <div>
                    <h2 className="confirmation-page-title">
                      Thank you for signing up for our coronavirus research volunteer list

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

                render() {
                  return (
                    <div>
                      <h2 className="confirmation-page-title">
                        Thank you for signing up for our coronavirus research volunteer list

                Function listItems has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const listItems = dependents.map((item, index) => {
                    const { fullName, dependentRelation } = item;
                    const dependentName = normalizeFullName(fullName);
                    const modalDescription = replaceStrValues(
                      content['household-dependent-modal-remove-description'],
                Severity: Major
                Found in src/applications/ezr/components/FormFields/DependentList.jsx - About 2 hrs to fix

                  Function validateAddress has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const validateAddress = (formData, fullName) => async (
                    dispatch,
                    getState,
                  ) => {
                    dispatch({ type: ADDRESS_VALIDATION_START });
                  Severity: Major
                  Found in src/applications/verify-your-enrollment/actions/index.js - About 2 hrs to fix

                    Function listItems has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const listItems = dependents.map((item, index) => {
                        const { fullName, dependentRelation } = item;
                        const dependentName = normalizeFullName(fullName);
                        const modalDescription = replaceStrValues(
                          content['household-dependent-modal-remove-description'],

                      Function Demographics has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const Demographics = props => {
                        const dispatch = useDispatch();
                        const selectVeteranData = useMemo(makeSelectVeteranData, []);
                        const { t } = useTranslation();
                        const { demographics } = useSelector(selectVeteranData);
                      Severity: Major
                      Found in src/applications/check-in/day-of/pages/Demographics.jsx - About 2 hrs to fix

                        Function questionStatus has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const questionStatus = () => {
                            if (hasError) {
                              return (
                                <>
                                  <p>
                        Severity: Major
                        Found in src/applications/ask-va/containers/IntroductionPage.jsx - About 2 hrs to fix

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

                            const updateFormData = e => {
                              e.preventDefault();
                              if (isEditing) {
                                // find the one we are editing in the employeeRecords array
                                const updatedRecords = employmentRecords.map((item, arrayIndex) => {

                            Function InterstitialPage has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const InterstitialPage = props => {
                              const { acknowledge, type } = props;
                            
                              useEffect(() => {
                                focusElement(document.querySelector('h1'));
                            Severity: Major
                            Found in src/applications/mhv-secure-messaging/containers/InterstitialPage.jsx - About 2 hrs to fix

                              Function AuthorizedRoutes has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const AuthorizedRoutes = () => {
                                const contactListPage = useSelector(
                                  state =>
                                    state.featureToggles[
                                      FEATURE_FLAG_NAMES.mhvSecureMessagingEditContactList
                              Severity: Major
                              Found in src/applications/mhv-secure-messaging/containers/AuthorizedRoutes.jsx - About 2 hrs to fix

                                Function FacilityCheckboxGroup has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const FacilityCheckboxGroup = props => {
                                  const {
                                    facilityName,
                                    multipleFacilities,
                                    triageTeams,

                                  Function AppointmentListSection has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function AppointmentListSection() {
                                    useManualScrollRestoration();
                                  
                                    const featureBreadcrumbUrlUpdate = useSelector(state =>
                                      selectFeatureBreadcrumbUrlUpdate(state),
                                  Severity: Major
                                  Found in src/applications/vaos/appointment-list/index.jsx - About 2 hrs to fix

                                    Function LabAndTestDetails has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    const LabAndTestDetails = () => {
                                      const dispatch = useDispatch();
                                      const labAndTestDetails = useSelector(
                                        state => state.mr.labsAndTests.labsAndTestsDetails,
                                      );
                                    Severity: Major
                                    Found in src/applications/mhv-medical-records/containers/LabAndTestDetails.jsx - About 2 hrs to fix

                                      Function conditionReducer has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const conditionReducer = (state = initialState, action) => {
                                        switch (action.type) {
                                          case Actions.Conditions.GET: {
                                            return {
                                              ...state,
                                      Severity: Major
                                      Found in src/applications/mhv-medical-records/reducers/conditions.js - About 2 hrs to fix

                                        Function buildNonVAPrescriptionPDFList has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const buildNonVAPrescriptionPDFList = prescription => {
                                          return [
                                            {
                                              sections: [
                                                {
                                        Severity: Major
                                        Found in src/applications/mhv-medications/util/pdfConfigs.js - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language