department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function captureError has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const captureError = (error, details) => {
  if (error instanceof Error) {
    Sentry.withScope(scope => {
      const { token } = details;
      if (token) {
Severity: Minor
Found in src/applications/check-in/utils/analytics/index.js - About 1 hr to fix

    Function CustomPhoneNumberField has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function CustomPhoneNumberField(props) {
      function handleChange(event) {
        if (props?.toeDupContactInfoCall) {
          props?.updateGlobalPhoneNumber(event);
          if (event?.length > 9) {
    Severity: Minor
    Found in src/applications/toe/components/CustomPhoneNumberField.jsx - About 1 hr to fix

      Function updateSchema has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                          updateSchema: (formData, schema, uiSchema) => {
                            const countryUI = uiSchema;
                            const addressFormData = get(
                              ['mailingAddressInput', 'address'],
                              formData,

        Function infoBlockMessage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const infoBlockMessage = () => {
            if (appointment?.kind === 'phone') {
              return (
                <span data-testid="phone-msg-confirmation">
                  {t('your-provider-will-call-you-at-your-appointment-time')}

          Function drawFreeTextOption has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            drawFreeTextOption(option) {
              const { highlightedIndex, value, selectionMade } = this.state;
          
              if ((selectionMade && option === value) || option?.length < 1) {
                return null;

            Function transformForSubmit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function transformForSubmit(formConfig, form) {
              const remarksFormData = form.data.remarks;
              const remarksUiSchema =
                formConfig.chapters.additionalInformationChapter.pages.remarks.uiSchema;
            
            
            Severity: Minor
            Found in src/applications/simple-forms/26-4555/config/submit-transformer.js - About 1 hr to fix

              Function updateSchema has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      updateSchema: (formData, schema, uiSchema) => {
                        const {
                          authorizerType,
                          thirdPartyType,
                          personFullName,
              Severity: Minor
              Found in src/applications/simple-forms/21-0845/pages/infoScope.js - About 1 hr to fix

                Function prefillTransformer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function prefillTransformer(pages, formData, metadata) {
                  // TODO: once backend prefill is implemented, refactor to
                  // remove test-data with incoming prefill data
                  const { preparerType } = formData;
                  const newFormData = {

                  Function isSsnUnique has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const isSsnUnique = formData => {
                    const {
                      veteranSsnOrTin,
                      primarySsnOrTin,
                      secondaryOneSsnOrTin,
                  Severity: Minor
                  Found in src/applications/caregivers/utils/helpers/form-config.js - About 1 hr to fix

                    Function calculateExpenses has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        const calculateExpenses = async () => {
                          if (!otherExpenses?.length || !gmtData?.isEligibleForStreamlined) return;
                    
                          try {
                            const response = await getMonthlyExpensesAPI(data);

                      Function MobileLogoRow has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const MobileLogoRow = () => {
                        return (
                          <nav className="vads-u-display--flex vads-u-flex-direction--column vads-u-margin--0 vads-u-padding--0">
                            <div className="header-logo-row vads-u-background-color--primary-darker vads-u-display--flex vads-u-align-items--center vads-u-justify-content--space-between vads-u-padding-y--1p5 vads-u-padding-left--1p5 vads-u-padding-right--1">
                              <a

                        Function calculateExpenses has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            const calculateExpenses = async () => {
                              if (!gmtData?.isEligibleForStreamlined) return;
                        
                              try {
                                const response = await getMonthlyExpensesAPI(data);

                          Function renameFolder has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const renameFolder = (folderId, newName) => async dispatch => {
                            try {
                              await updateFolderName(folderId, newName);
                              await dispatch(getFolders());
                              await dispatch(retrieveFolder(folderId));
                          Severity: Minor
                          Found in src/applications/mhv-secure-messaging/actions/folders.js - About 1 hr to fix

                            Function enter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                enter(path) {
                                  if (isBlock(path)) {
                                    const parent = stack[stack.length - 1];
                                    const block = {
                                      type: !parent ? 'Feature' : 'Background',
                            Severity: Minor
                            Found in src/applications/vaos/scripts/gherkin.js - About 1 hr to fix

                              Function useGetPatientRelationships has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function useGetPatientRelationships() {
                                const dispatch = useDispatch();
                                const featureOHDirectSchedule = useOHDirectScheduling();
                              
                                const {

                                Function renderErrorMessages has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  renderErrorMessages() {
                                    const {
                                      claimsLoading,
                                      appealsLoading,
                                      stemClaimsLoading,
                                Severity: Minor
                                Found in src/applications/claims-status/containers/YourClaimsPageV2.jsx - About 1 hr to fix

                                  Function transformForSubmit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export default function transformForSubmit(formConfig, form) {
                                    const formCopy = {
                                      ...form,
                                      data: {
                                        ...form.data,
                                  Severity: Minor
                                  Found in src/applications/pre-need-integration/config/transformForSubmit.js - About 1 hr to fix

                                    Function default has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export default function(state = INITIAL_STATE, action) {
                                      switch (action.type) {
                                        case FETCH_CONSTANTS_STARTED:
                                          return {
                                            ...state,
                                    Severity: Minor
                                    Found in src/applications/gi/reducers/constants.js - About 1 hr to fix

                                      Function disclaimerText has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        const disclaimerText = () => {
                                          return (
                                            <>
                                              <div>
                                                <p>

                                        Function deleteConnectedApp has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function deleteConnectedApp(appId) {
                                          return async (dispatch, getState) => {
                                            recordEvent({ event: 'profile-disconnect-connected-app-started' });
                                            dispatch({ type: DELETING_CONNECTED_APP, appId });
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language