department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

File helpers.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import moment from 'moment-timezone';
import * as Sentry from '@sentry/browser';
import { snakeCase } from 'lodash';
import { generatePdf } from '@department-of-veterans-affairs/platform-pdf/exports';
import { formatDateLong } from '@department-of-veterans-affairs/platform-utilities/exports';
Severity: Minor
Found in src/applications/mhv-medical-records/util/helpers.js - About 2 hrs to fix

    Function enterData has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function enterData(field) {
      switch (field.type) {
        // Select fields register as having type 'select-one'.
        case 'select-one':
          cy.wrap(field.element)
    Severity: Major
    Found in src/platform/testing/e2e/cypress/support/form-tester/index.js - About 2 hrs to fix

      Function makeMockApiRouter has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function makeMockApiRouter(opts) {
        // mockResponses[token][verb][response]
        const mockResponses = {};
      
        const router = express.Router(); // eslint-disable-line new-cap
      Severity: Major
      Found in src/platform/testing/e2e/mockapi.js - About 2 hrs to fix

        Function testForm has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const testForm = testConfig => {
          const {
            appName,
            arrayPages = [],
            dataPrefix,
        Severity: Major
        Found in src/platform/testing/e2e/cypress/support/form-tester/index.js - About 2 hrs to fix

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

            render() {
              const { currentLocation, formConfig, children, formData } = this.props;
              const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
              const lastPathComponent = currentLocation.pathname.split('/').pop();
              const isIntroductionPage = trimmedPathname.endsWith('introduction');
          Severity: Major
          Found in src/platform/forms-system/src/js/containers/FormApp.jsx - About 2 hrs to fix

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

              render() {
                // loading state for terms content is handled by parent component
                const { terms } = this.props;
            
                if (!terms.termsContent) {
            Severity: Major
            Found in src/platform/user/authorization/components/AcceptTermsPrompt.jsx - About 2 hrs to fix

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

                render() {
                  const {
                    addressValidationType,
                    suggestedAddresses,
                    addressFromUser,

                Function submit has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const submit = form => {
                  const currentAddress = form.data['view:currentAddress'];
                  const itemQuantities = form.data?.order?.length;
                  const { order, permanentAddress, temporaryAddress, vetEmail } = form.data;
                  for (const address of [permanentAddress, temporaryAddress]) {
                Severity: Major
                Found in src/applications/health-care-supply-reordering/config/form.js - About 2 hrs to fix

                  Function activeDutyNote has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const activeDutyNote = () => {
                      if (
                        eighteenOrOver(formData.relativeDateOfBirth) &&
                        (!hasServed || (hasServed && allServicePeriodsHaveEndDate))
                      ) {
                  Severity: Major
                  Found in src/applications/edu-benefits/5490/containers/PreSubmitInfo.jsx - About 2 hrs to fix

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

                      render() {
                        return (
                          <div className="schemaform-intro">
                            <FormTitle title="Apply for a Specially Adapted Housing Grant or Special Home Adaptation Grant" />
                            <p>
                    Severity: Major
                    Found in src/applications/sah/sahg/containers/IntroductionPage.jsx - About 2 hrs to fix

                      Function createDirectDepositPage has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function createDirectDepositPage(schema) {
                        const { bankAccountChangeUpdate, bankAccount } = schema.definitions;
                      
                        return {
                          title: 'Direct deposit',
                      Severity: Major
                      Found in src/applications/edu-benefits/pages/directDepositChangeUpdate.js - About 2 hrs to fix

                        Function facilityReducer has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function facilityReducer(state = initialState, action) {
                          switch (action.type) {
                            case FETCH_FACILITY_STARTED:
                              return { ...state, data: {}, loading: true, error: false };
                            case FETCH_FACILITY_SUCCESS:
                        Severity: Major
                        Found in src/applications/static-pages/facilities/reducers/index.js - About 2 hrs to fix

                          Function WiderThanMobileOfficialGovtWebsite has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const WiderThanMobileOfficialGovtWebsite = () => {
                            const [isExpanded, setIsExpanded] = useState(false);
                          
                            const toggleExpansion = () => {
                              setIsExpanded(!isExpanded);

                            Function CustomResolutionOptionReview has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const CustomResolutionOptionReview = props => {
                              const formData = useSelector(state => state.form.data);
                              const { selectedDebtsAndCopays = [] } = formData;
                            
                              const currentDebt = selectedDebtsAndCopays[props.pagePerItemIndex];

                              Function fetchConfirmedAppointmentDetails has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function fetchConfirmedAppointmentDetails(id, type) {
                                return async (dispatch, getState) => {
                                  try {
                                    const state = getState();
                                    const featureVAOSServiceVAAppointments = selectFeatureVAOSServiceVAAppointments(
                              Severity: Major
                              Found in src/applications/vaos/appointment-list/redux/actions.js - About 2 hrs to fix

                                Function openFacilityPageV2 has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function openFacilityPageV2(page, uiSchema, schema) {
                                  return async (dispatch, getState) => {
                                    try {
                                      const initialState = getState();
                                      const featureFacilitiesServiceV2 = selectFeatureFacilitiesServiceV2(
                                Severity: Major
                                Found in src/applications/vaos/new-appointment/redux/actions.js - About 2 hrs to fix

                                  Function getCompareCalculatorState has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const getCompareCalculatorState = (
                                    calculator,
                                    institution,
                                    constants,
                                  ) => {
                                  Severity: Major
                                  Found in src/applications/gi/selectors/compare.js - About 2 hrs to fix

                                    Function ConnectedDevicesContainer has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const ConnectedDevicesContainer = () => {
                                      const [hasLoaded, setHasLoaded] = useState(false);
                                      const [connectionAvailable, setConnectionAvailable] = useState(false);
                                      const [connectedDevices, setConnectedDevices] = useState([]);
                                      const [successAlert, setSuccessAlert] = useState(false);

                                      Function onChangeEvent has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        const onChangeEvent = option => {
                                          // title may be a React component
                                          const title = options.title?.props?.children || options.title || '';
                                          // this check isn't ideal since the message may exist and the question
                                          // may be dynamically toggled between being required or not

                                        Function removeDependents has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function removeDependents(state = initialState, action) {
                                          // schema, uiSchema, and formData are already extracted based on index (stateKey) here.
                                          if (action.type === FORM_DATA_UPDATED) {
                                            const {
                                              data: newFormData,
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language