department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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

export const handleHeader = (folderId, folder) => {
  let folderName;

  switch (folderId) {
    case Folders.INBOX.id: // Inbox
Severity: Minor
Found in src/applications/mhv-secure-messaging/util/helpers.js - About 1 hr to fix

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

    export function getCancelInfo(state) {
      const {
        appointmentToCancel,
        showCancelModal,
        cancelAppointmentStatus,
    Severity: Minor
    Found in src/applications/vaos/appointment-list/redux/selectors.js - About 1 hr to fix

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

      async function vaFacilityNext(state, dispatch) {
        let eligibility = selectEligibility(state);
      
        const location = getChosenFacilityInfo(state);
        const cernerSiteIds = selectRegisteredCernerFacilityIds(state);
      Severity: Minor
      Found in src/applications/vaos/new-appointment/newAppointmentFlow.js - About 1 hr to fix

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

          const generatePhaseItems = () => {
            const {
              currentPhaseBack,
              previousPhases,
            } = claim.attributes.claimPhaseDates;

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

            const addMapMarker = (institution, index, locationBounds, mapMarkers) => {
              const { latitude, longitude, name } = institution;
              const lngLat = new mapboxgl.LngLat(longitude, latitude);
          
              const markerElement = document.createElement('div');
          Severity: Minor
          Found in src/applications/gi/containers/search/LocationSearchResults.jsx - About 1 hr to fix

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

            export function fetchProfile(facilityCode, version) {
              const queryString = version ? `?version=${version}` : '';
              const url = `${api.url}/institutions/${facilityCode}${queryString}`;
            
              return (dispatch, getState) => {
            Severity: Minor
            Found in src/applications/gi/actions/index.js - About 1 hr to fix

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

              export const validateSearchTermSubmit = (
                searchTerm,
                dispatchError,
                error,
                filters,
              Severity: Minor
              Found in src/applications/gi/utils/helpers.js - About 1 hr to fix

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

                  const institutionFieldValue = (
                    field,
                    rowIndex,
                    colIndex,
                    institution,
                Severity: Minor
                Found in src/applications/gi/components/CompareGrid.jsx - About 1 hr to fix

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

                  export function aboutTheSchool(
                    onChangeCheckbox,
                    options,
                    smallScreen,
                    automatedTest = false,
                  Severity: Minor
                  Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 1 hr to fix

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

                    export function fetchCompareDetails(facilityCodes, filters, version) {
                      const params = rubyifyKeys({
                        facilityCodes,
                        ...buildSearchFilters(filters),
                      });
                    Severity: Minor
                    Found in src/applications/gi/actions/index.js - About 1 hr to fix

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

                      export const buildSearchFilters = filters => {
                        const clonedFilters = _.cloneDeep(filters);
                        delete clonedFilters.expanded;
                        delete clonedFilters.search;
                      
                      
                      Severity: Minor
                      Found in src/applications/gi/selectors/filters.js - About 1 hr to fix

                        Function constructor has 29 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)) {

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

                          export default function EightKeysModalContent() {
                            return (
                              <>
                                <p>
                                  The “8 Keys to Veterans’ Success” are steps that postsecondary

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

                            export function fileUploadUi(content) {
                              return {
                                ...fileUiSchema(content.label, {
                                  buttonText: 'Upload file',
                                  addAnotherLabel: 'Upload another file',
                            Severity: Minor
                            Found in src/applications/pre-need-integration/utils/upload.js - About 1 hr to fix

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

                              export default function VeteranSuccessModalContent() {
                                return (
                                  <>
                                    <p>
                                      This program supports service members, Veterans, and qualified

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

                                function validateAddress(errors, address, formData, currentSchema) {
                                  // Adds error message for state if it is blank and one of the following countries:
                                  // USA, Canada
                                  if (
                                    countriesWithStateCodes.has(address.country) &&
                                Severity: Minor
                                Found in src/applications/pre-need-integration/definitions/address.js - About 1 hr to fix

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

                                  function createBasicInitialState(serviceHistory, eligibility) {
                                    return {
                                      user: {
                                        profile: {
                                          veteranStatus: {

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

                                    function createBasicInitialState(serviceHistory, eligibility) {
                                      return {
                                        user: {
                                          profile: {
                                            veteranStatus: {

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

                                        export const prepareAddressData = formData => {
                                          let addressData = {
                                            veteranName: formData.fullName,
                                            addressLine1: formData.addressLine1,
                                            addressLine2: formData.addressLine2,
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language