department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function ContactInfoNeeded has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ContactInfoNeeded = () => {
  const email = useSelector(state =>
    selectVAPContactInfoField(state, FIELD_NAMES.EMAIL),
  );
  const mailingAddress = useSelector(state =>

    Function EditConfirmCancelModal has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const EditConfirmCancelModal = props => {
      const { activeSection, onHide, isVisible } = props;
    
      const { onCancel } = useContext(EditContext);
    
    

      Function HealthcareError has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const HealthcareError = () => {
          // status will be 'warning' if toggle is on
          const status = useToggleValue(TOGGLE_NAMES.myVaUpdateErrorsWarnings)
            ? 'warning'
            : 'error';

        Function idcard has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function idcard(state = initialState, action) {
          switch (action.type) {
            case ATTRS_FETCHING:
              return {
                ...state,
        Severity: Minor
        Found in src/applications/veteran-id-card/reducers/idcard.js - About 1 hr to fix

          Function getRecordType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const getRecordType = record => {
            if (record.resourceType === fhirResourceTypes.DIAGNOSTIC_REPORT) {
              if (record.code?.text === 'CH') return labTypes.CHEM_HEM;
              if (
                record.code?.coding?.some(
          Severity: Minor
          Found in src/applications/mhv-medical-records/reducers/labsAndTests.js - About 1 hr to fix

            Function sharingReducer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const sharingReducer = (state = initialState, action) => {
              switch (action.type) {
                case Actions.Sharing.STATUS: {
                  const { consentStatus } = action.response;
                  return {
            Severity: Minor
            Found in src/applications/mhv-medical-records/reducers/sharing.js - About 1 hr to fix

              Function generateTxt has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  async () => {
                    setDownloadStarted(true);
                    setDownloadType('txt');
                    setBlueButtonRequested(true);
                    dispatch(clearAlerts());

                Function failedMsg has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const failedMsg = () => {
                    return (
                      <va-alert
                        status="warning"
                        visible

                  Function benefitEndDateExplanation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function benefitEndDateExplanation(condition, delimitingDate) {
                    switch (condition) {
                      case 'activeDuty':
                        return (
                          <div className="section benefit-end-date">
                  Severity: Minor
                  Found in src/applications/post-911-gib-status/utils/helpers.jsx - About 1 hr to fix

                    Function buildNonVAPrescriptionTXT has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const buildNonVAPrescriptionTXT = prescription => {
                      return `
                    ---------------------------------------------------------------------------------
                    
                    
                    
                    Severity: Minor
                    Found in src/applications/mhv-medications/util/txtConfigs.js - About 1 hr to fix

                      Function validateDate has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        errors,
                        dateString,
                        formData,
                        schema,
                        errorMessages,
                      Severity: Major
                      Found in src/platform/forms-system/src/js/validation.js - About 1 hr to fix

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

                              objectFields => {
                                const [first, ...rest] = objectFields;
                                // expand under functionality is controlled in the reducer by setting ui:collapsed, so
                                // we can check if its expanded by seeing if there are any visible "children"
                                const visible = rest.filter(
                        Severity: Minor
                        Found in src/platform/forms-system/src/js/review/ObjectField.jsx - About 1 hr to fix

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

                            pageBuilder.summaryPage = pageConfig => {
                              const requiredOpts = ['title', 'path', 'uiSchema', 'schema'];
                              verifyRequiredPropsPageConfig('summaryPage', requiredOpts, pageConfig);
                          
                              const summaryPageProps = {

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

                              render() {
                                const props = this.props;
                            
                                if (props.formContext.reviewMode) {
                                  return (
                            Severity: Minor
                            Found in src/platform/forms-system/src/js/widgets/ArrayCountWidget.jsx - About 1 hr to fix

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

                                constructor(props) {
                                  super(props);
                              
                                  // Throw an error if there’s no viewField (should be React component)
                                  if (!isReactComponent(this.props.uiSchema['ui:options'].viewField)) {
                              Severity: Minor
                              Found in src/platform/forms-system/src/js/fields/ArrayField.jsx - About 1 hr to fix

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

                                  addressValidationSuccessSingleMissingUnitNumber() {
                                    return asyncReturn(
                                      {
                                        addresses: [
                                          {
                                Severity: Minor
                                Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 hr to fix

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

                                  const mapStateToProps = (state, ownProps) => {
                                    const { transaction } = ownProps;
                                    const {
                                      addressFromUser,
                                      addressValidationError,

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

                                    export function setDismissedHCANotification(status, statusEffectiveAt) {
                                      return (dispatch, getState) => {
                                        const hasPreviouslyDismissedNotification = !!dismissedHCANotificationDate(
                                          getState(),
                                        );
                                    Severity: Minor
                                    Found in src/platform/user/profile/actions/hca.js - About 1 hr to fix

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

                                        addressValidationSuccessSingleBadUnitNumber() {
                                          return asyncReturn(
                                            {
                                              addresses: [
                                                {
                                      Severity: Minor
                                      Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js - About 1 hr to fix

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

                                          render() {
                                            const pageDescription = (
                                              <>
                                                <h3 className="vads-u-font-size--h4">Shipping address</h3>
                                                <div className="vads-u-margin-top--2">
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language