department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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 convertAccountSummary has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const convertAccountSummary = data => {
      if (!data) return null;
    
      // Extract necessary fields
      const { facilities = [], ipas } = data;
    Severity: Minor
    Found in src/applications/mhv-medical-records/reducers/blueButton.js - About 1 hr to fix

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

      export const SearchResultsHeader = props => {
        const { query, resultCount, inProgress } = props;
      
        const searchWasPerformed = !!query;
      
      

        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 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 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 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 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 vaDateCommonFieldMapping has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      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 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,

                          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 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 handleSubmit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const handleSubmit = event => {
                                  if (!event.target.value) {
                                    setInputError(true);
                                    return;
                                  }
                              Severity: Minor
                              Found in src/applications/resources-and-support/components/SearchBar.jsx - About 1 hr to fix

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

                                const ConfirmCancelModal = props => {
                                  const { activeSection, closeModal, onHide, isVisible } = props;
                                
                                  // return null to avoid even having the web component in dom
                                  // when not needed (this makes testing easier as well)

                                  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 renderMarkers has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        const renderMarkers = locations => {
                                          if (locations.length === 0) return;
                                      
                                          const locationBounds = new mapboxgl.LngLatBounds();
                                      
                                      
                                      Severity: Minor
                                      Found in src/applications/facility-locator/containers/FacilitiesMap.jsx - About 1 hr to fix

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

                                        export const recordSearchResultsEvents = (props, results) => {
                                          const dataPush = { event: 'fl-search-results' };
                                          const { currentQuery, pagination, resultTime } = props;
                                        
                                          if (currentQuery) {
                                        Severity: Minor
                                        Found in src/applications/facility-locator/utils/analytics.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language