department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

export function createMilitaryClaimant(submissionForm) {
  // Access formField and viewComponent sources for userFullName and dateOfBirth
  const formFieldUserFullName =
    submissionForm['view:userFullName']?.userFullName;
  const viewComponentUserFullName = submissionForm?.userFullName;

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

    export const formatReadableDate = rawDate => {
      const months = [
        'January',
        'February',
        'March',
    Severity: Minor
    Found in src/applications/fry-dea/helpers.jsx - About 1 hr to fix

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

      export const buildMarker = (type, values) => {
        if (type === 'location') {
          const { loc, attrs } = values;
          const markerElement = document.createElement('span');
          markerElement.className = 'i-pin-card-map';
      Severity: Minor
      Found in src/applications/facility-locator/utils/helpers.jsx - About 1 hr to fix

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

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

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

          export default function useArticleData() {
            const [articles, setArticles] = useState(null);
            const [errorMessage, setErrorMessage] = useState(null);
          
            useEffect(
          Severity: Minor
          Found in src/applications/resources-and-support/hooks/useArticleData.js - About 1 hr to fix

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

            export function transform(formConfig, form) {
              // https://dev-developer.va.gov/explore/appeals/docs/decision_reviews?version=current
              // https://github.com/department-of-veterans-affairs/vets-api/blob/master/modules/appeals_api/config/schemas/10182.json
              const mainTransform = formData => {
                const result = {
            Severity: Minor
            Found in src/applications/appeals/10182/config/submit-transformer.js - About 1 hr to fix

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

                const formatServiceType = rawServiceType => {
                  if (facilityType === LocationType.URGENT_CARE) {
                    if (!rawServiceType) {
                      return urgentCareServices.AllUrgentCare;
                    }

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

                export const getRep = formData => {
                  if (formData.informalConference !== 'rep') {
                    return null;
                  }
                  const phoneNumber = (formData?.informalConferenceRep?.phone || '').replace(
                Severity: Minor
                Found in src/applications/appeals/996/utils/submit.js - About 1 hr to fix

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

                  export const getForm4142 = formData => {
                    const {
                      evidencePrivacyAgreementAccepted = true,
                      limitedConsent = '',
                    } = formData;
                  Severity: Minor
                  Found in src/applications/appeals/testing/sc/utils/submit.js - About 1 hr to fix

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

                      applicantInformation: formData => {
                        if (_.isEmpty(_.get(formData, 'applicantFullName.first', {}))) {
                          recordEvent({
                            event: 'edu-0994--response-missing',
                            'missing-field-question':
                    Severity: Minor
                    Found in src/applications/edu-benefits/0994/analytics-functions.js - About 1 hr to fix

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

                      function Table() {
                        return (
                          <div className="custom-table">
                            <table className="usa-table">
                              <tbody>
                      Severity: Minor
                      Found in src/applications/edu-benefits/feedback-tool/components/Table.jsx - About 1 hr to fix

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

                        function createMutationObserverCallback() {
                          // Find native header, footer, etc based on page path
                          const DEPRECATED_SELECTOR_CONFIG = [
                            {
                              path: /.*/,
                        Severity: Minor
                        Found in src/applications/proxy-rewrite/proxy-rewrite-entry.jsx - About 1 hr to fix

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

                          const certificateOfEligibility = (state = initialState, action) => {
                            switch (action.type) {
                              case UPDATE_LOGGEDIN_STATUS:
                                return { ...state, profileIsUpdating: false };
                              case SKIP_AUTOMATIC_COE_CHECK:
                          Severity: Minor
                          Found in src/applications/lgy/coe/shared/reducers/index.js - About 1 hr to fix

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

                            const createSaveInProgressUpdateEZR = () => {
                              const now = new Date().toISOString();
                            
                              return {
                                data: {

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

                              const createSaveInProgressUpdate = () => {
                                const now = new Date().toISOString();
                              
                                return {
                                  data: {

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

                                export const handleEditPageDisplayTweaks = location => {
                                  const navHeader = document.querySelector('#nav-form-header');
                                  const chapterProgress = document.querySelector(
                                    '.schemaform-chapter-progress',
                                  );
                                Severity: Minor
                                Found in src/applications/_mock-form-ae-design-patterns/App.jsx - About 1 hr to fix

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

                                  const createSaveInProgressUpdateTaskPurple = () => {
                                    const now = new Date().toISOString();
                                  
                                    return {
                                      data: {

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

                                    const createDuplicateEvents = () => {
                                      const eventA = createEvent(
                                        now
                                          .clone()
                                          .add(5, 'days')
                                    Severity: Minor
                                    Found in src/applications/static-pages/events/helpers/event-generator.js - About 1 hr to fix

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

                                        const fetchNearbyVetCenters = async () => {
                                          const mainAddress = props.mainVetCenterAddress;
                                          if (!mainAddress) {
                                            return;
                                          }

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

                                        export function libraryCurrent() {
                                          let increment = 1;
                                          let numVal;
                                          Array.prototype.slice.call(cards).forEach(element => {
                                            if (
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language