department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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

  const updateFormData = () => {
    const { from: startDate, to: endDate, isCurrent } = employmentRecord;

    // If start date or end date is invalid, set errors and stop
    if (

    Function fetchPastAppointments has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function validateMilitaryHistory has 62 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const validateMilitaryHistory = (
        errors,
        serviceRecords,
        useAllFormData,
      ) => {
      Severity: Major
      Found in src/applications/pre-need-integration/utils/helpers.js - About 2 hrs to fix

        Function RadioWidget has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function RadioWidget(props) {
          const { options, formContext = {}, value, disabled, onChange, id } = props;
          const { enumOptions, labels = {} } = options;
        
          const onReviewPage = formContext?.onReviewPage || false;

          Function GenderIdentityAdditionalInfo has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function GenderIdentityAdditionalInfo() {
            return (
              <>
                <p className="vads-u-color--gray-medium vads-u-display--block vads-u-font-weight--normal vads-u-margin--0 vads-u-width--full">
                  You can change your selection at any time. If you decide you no longer

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

            export const validateAddress = (formData, fullName) => async (
              dispatch,
              getState,
            ) => {
              dispatch({ type: ADDRESS_VALIDATION_START });

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

                render() {
                  let message;
              
                  if (this.props.errors) {
                    message = this.renderErrors();
              Severity: Major
              Found in src/applications/veteran-id-card/containers/Main.jsx - About 2 hrs to fix

                Function allergyReducer has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

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

                    render() {
                      let view;
                  
                      if (this.props.success) {
                        view = (
                  Severity: Major
                  Found in src/applications/veteran-id-card/containers/EmailCapture.jsx - About 2 hrs to fix

                    File day-of.reducers.unit.spec.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import { expect } from 'chai';
                    
                    import {
                      receivedDemographicsDataHandler,
                      receivedAppointmentDetailsHandler,

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

                      import { parse, addDays, format, isAfter, isFuture, isValid } from 'date-fns';
                      import { toggleValues } from '~/platform/site-wide/feature-toggles/selectors';
                      import FEATURE_FLAG_NAMES from '~/platform/utilities/feature-toggles/featureFlagNames';
                      import { formatDateLong } from 'platform/utilities/date';
                      import { deductionCodes } from '../constants/deduction-codes';
                      Severity: Minor
                      Found in src/applications/financial-status-report/utils/helpers.js - About 2 hrs to fix

                        File ContactFacilitiesPage.unit.spec.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import React from 'react';
                        import { expect } from 'chai';
                        
                        import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';
                        import ContactFacilitiesPage from './ContactFacilitiesPage';

                          File index.cc-request.unit.spec.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* eslint-disable camelcase */
                          import React from 'react';
                          import { expect } from 'chai';
                          
                          import userEvent from '@testing-library/user-event';

                            Function applicantInformation has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function applicantInformation(schema, options) {
                              // Use the defaults as necessary, but override with the options given
                              const prefix = options && options.isVeteran ? 'veteran' : 'relative';
                              const mergedOptions = Object.assign({}, defaults(prefix), options);
                              const { fields, required, labels } = mergedOptions;
                            Severity: Major
                            Found in src/platform/forms/pages/applicantInformation.jsx - About 2 hrs to fix

                              Function apiRequest has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function apiRequest(
                                resource,
                                optionalSettings,
                                success,
                                error,
                              Severity: Major
                              Found in src/platform/utilities/api/index.js - About 2 hrs to fix

                                Function getNonArraySchema has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function getNonArraySchema(schema, uiSchema = {}) {
                                  if (
                                    schema.type === 'array' &&
                                    !get('ui:options.keepInPageOnReview', uiSchema)
                                  ) {
                                Severity: Major
                                Found in src/platform/forms-system/src/js/helpers.js - About 2 hrs to fix

                                  Function ProfileInformationView has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const ProfileInformationView = props => {
                                    const { data, fieldName, title, id } = props;
                                  
                                    const titleLower = title.toLowerCase();
                                  
                                  

                                    Function submitRepresentativeReport has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const submitRepresentativeReport = newReport => {
                                      return async dispatch => {
                                        dispatch({
                                          type: REPORT_SUBMITTED,
                                          payload: {

                                      Function AuthBenefitsPackagePage has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const AuthBenefitsPackagePage = props => {
                                        const { location, route, router } = props;
                                        const { pathname } = location;
                                        const { pageList } = route;
                                        const { schema } = definition;
                                      Severity: Major
                                      Found in src/applications/hca/containers/AuthBenefitsPackagePage.jsx - About 2 hrs to fix

                                        Function CopyResultsModal has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const CopyResultsModal = () => {
                                          const [isOpen, setIsOpen] = useState(false);
                                          const [showAlert, setShowAlert] = useState(false);
                                          const currentUrl = window.location.href;
                                          const toggleModal = open => {
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language