department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

  const makeLoadedCards = () => {
    setLoadedCards(
      loaded.map((facilityCode, index) => {
        return (
          <li
Severity: Minor
Found in src/applications/gi/containers/CompareDrawer.jsx - 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 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 });
      
      

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

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

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

          function vaProfile(state = initialState, action) {
            switch (action.type) {
              case FETCH_HERO_SUCCESS:
              case FETCH_HERO_FAILED:
                return set('hero', action.hero, state);
          Severity: Minor
          Found in src/applications/personalization/profile/reducers/vaProfile.js - About 1 hr to fix

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

            const ClaimantType = props => {
              const { router, setFormData } = props;
            
              const { data: formData } = useSelector(state => state.form);
              const [localData, setLocalData] = useState({});
            Severity: Minor
            Found in src/applications/representative-appoint/components/ClaimantType.jsx - About 1 hr to fix

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

              const generateTocItem = (doc, parent, data, pageData) => {
                const leftMargin = 100;
                const pages =
                  pageData.startPage === pageData.endPage
                    ? `page ${pageData.startPage}`
              Severity: Minor
              Found in src/platform/pdf/templates/blue_button_report.js - About 1 hr to fix

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

                export function createServiceMap(maintenanceWindows = []) {
                  const serviceMap = new Map();
                
                  // Maintenance windows should be sorted in ascending order
                  // so that when a single externalService has multiple upcoming
                Severity: Minor
                Found in src/platform/monitoring/DowntimeNotification/util/helpers.js - About 1 hr to fix

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

                  export default function sortListByFuzzyMatch(value, list, prop = 'label') {
                    return list
                      .map(option => {
                        const label = option[prop].toUpperCase().replace(/[^a-zA-Z ]/g, '');
                        const val = value.toUpperCase().replace(/[^a-zA-Z ]/g, '');
                  Severity: Minor
                  Found in src/platform/utilities/fuzzy-matching.js - About 1 hr to fix

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

                      render() {
                        const primaryButton = {
                          action: this.handleClose,
                          text: 'Finish applying',
                        };
                    Severity: Minor
                    Found in src/platform/forms/save-in-progress/FormSignInModal.jsx - About 1 hr to fix

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

                      export default function vaDateCommonFieldMapping(props) {
                        const {
                          description,
                          textDescription,
                          DescriptionField,

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

                        const firstNameLastNameNoSuffixUI = (formatTitle, uiOptions = {}) => {
                          return {
                            'ui:validations': [validateEmpty],
                            first: {
                              'ui:title': formatTitle ? formatTitle('first name') : 'First name',

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

                          export function focusElement(selectorOrElement, options, root) {
                            function applyFocus(el) {
                              if (el) {
                                // Use getAttribute to grab the "tabindex" attribute (returns string), not
                                // the "tabIndex" property (returns number). Focusable elements will
                          Severity: Minor
                          Found in src/platform/utilities/ui/focus.js - About 1 hr to fix

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

                              handleAdd() {
                                const numberOfItems = this.props.formData.length;
                                const lastIndex = numberOfItems - 1;
                            
                                if (errorSchemaIsValid(this.props.errorSchema[lastIndex])) {
                            Severity: Minor
                            Found in src/platform/forms-system/src/js/fields/ArrayField.jsx - About 1 hr to fix

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

                              export default function sortListByFuzzyMatch(value, list, prop = 'label') {
                                return list
                                  .map(option => {
                                    const label = option[prop].toUpperCase().replace(/[^a-zA-Z ]/g, '');
                                    const val = value.toUpperCase().replace(/[^a-zA-Z ]/g, '');
                              Severity: Minor
                              Found in src/platform/forms-system/src/js/utilities/fuzzy-matching.js - About 1 hr to fix

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

                                export function updateUiSchema(schema, uiSchema, formData) {
                                  if (!uiSchema) {
                                    return uiSchema;
                                  }
                                
                                
                                Severity: Minor
                                Found in src/platform/forms-system/src/js/state/helpers.js - About 1 hr to fix

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

                                  export default function Pending(props) {
                                    const { formConfig, onBack, onSubmit } = props;
                                    let ariaDescribedBy = null;
                                    // If no ariaDescribedBy is passed down from form.js,
                                    // a null value will properly not render the aria label.
                                  Severity: Minor
                                  Found in src/platform/forms-system/src/js/review/submit-states/Pending.jsx - About 1 hr to fix

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

                                    export const navigateForward = (SHORT_NAME, formResponses, router) => {
                                      const roadmap = makeRoadmap(getServicePeriodResponse(formResponses));
                                    
                                      if (roadmap?.length) {
                                        const CURRENT_INDEX = roadmap?.indexOf(SHORT_NAME);
                                    Severity: Minor
                                    Found in src/applications/pact-act/utilities/page-navigation.js - About 1 hr to fix

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

                                      export const checkResponses = (formResponses, displayConditionsForPath) => {
                                        const questionRequirements = Object.keys(displayConditionsForPath);
                                      
                                        for (const questionShortName of questionRequirements) {
                                          const formResponse = formResponses?.[questionShortName];
                                      Severity: Minor
                                      Found in src/applications/pact-act/utilities/display-logic-questions.js - About 1 hr to fix

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

                                        export const phoneUiSchema = fieldName => {
                                          return {
                                            inputPhoneNumber: {
                                              'ui:title': `${fieldName} (U.S. numbers only)`,
                                              'ui:webComponentField': VaTextInputField,
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language