department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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

  render() {
    const { form } = this.props;
    const { submission, formId, data } = form;
    const submitDate = submission ? submission.timestamp : null;
    const { fullName } = data;
Severity: Minor
Found in src/applications/travel-pay/containers/ConfirmationPage.jsx - About 1 hr to fix

    Function generateMedicalCentersSchemas has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const generateMedicalCentersSchemas = (
      medicalCentersKey = 'medicalCenters',
      medicalCentersTitle = 'Default Medical Centers Title',
      medicalCenterMessage = 'Default Message',
      medicalCenterFieldLabel = 'Default Field Label',

      Function WizardContainer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const WizardContainer = props => {
        const { setWizardStatus } = props;
        useEffect(() => {
          focusElement('.va-nav-breadcrumbs-list');
        }, []);
      Severity: Minor
      Found in src/applications/vre/25-8832/containers/WizardContainer.jsx - About 1 hr to fix

        Function VeteranInformationViewComponent has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const VeteranInformationViewComponent = props => {
          const { profile } = props;
          const {
            gender,
            dob,

          Function MonetaryInputList has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const MonetaryInputList = props => {
            const { errorSchema, formContext } = props;
            const errorList = errorSchema?.monetaryAssets?.__errors;
            const { submitted } = formContext;
          
          

            Function FormApp has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function FormApp(props) {
              const {
                children,
                hasSavedForm,
                isLoading,
            Severity: Minor
            Found in src/applications/vre/28-1900/containers/FormApp.jsx - About 1 hr to fix

              Function BackendAppointmentServiceAlert has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function BackendAppointmentServiceAlert() {
                const {
                  backendServiceFailures,
                  futureStatus,
                  pastStatus,

                Function threadsReducer has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const threadsReducer = (state = initialState, action) => {
                  switch (action.type) {
                    case Actions.Thread.GET_LIST:
                      return {
                        ...state,
                Severity: Minor
                Found in src/applications/mhv-secure-messaging/reducers/threads.js - About 1 hr to fix

                  Function getGridData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function getGridData(appointment) {
                    const { isCommunityCare, isVideo } = appointment?.vaos || {};
                    const isPhone = isVAPhoneAppointment(appointment);
                    const { serviceType } = appointment?.vaos.apiData || {};
                  
                  

                    Function getBreadcrumbList has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const getBreadcrumbList = () => {
                        const isPast = location.pathname.includes('/past');
                        const isPending = location.pathname.includes('/pending');
                    
                        const BREADCRUMB_BASE = [
                    Severity: Minor
                    Found in src/applications/vaos/components/Breadcrumbs.jsx - About 1 hr to fix

                      Function getICSTokens has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function getICSTokens(buffer) {
                        const map = new Map();
                        let tokens = buffer.split('\r\n');
                      
                        // Split tokens into key/value pairs using lookbehind since it is possible
                      Severity: Minor
                      Found in src/applications/vaos/utils/calendar.js - About 1 hr to fix

                        Function generateTrackedItems has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const generateTrackedItems = () => {
                            const { trackedItems } = claim.attributes;
                            const items = [];
                            const addItems = (date, description, item) => {
                              items.push({

                          Function verifyDependents has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function verifyDependents(state = initialState, action) {
                            switch (action.type) {
                              case DEPENDENCY_VERIFICATION_CALL_SUCCESS:
                                return {
                                  ...state,

                            Function ConfirmationPage has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const ConfirmationPage = () => {
                              // Set focus
                              useEffect(() => {
                                // Wait a moment before setting focus to avoid an issue where focus would otherwise reset to the body element
                                setTimeout(() => {

                              Function fetchSearchResults has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function fetchSearchResults(query, page, options, clearGAData) {
                                return dispatch => {
                                  dispatch({ type: FETCH_SEARCH_RESULTS, query });
                              
                                  let queryString = `/search?query=${encodeURIComponent(query)}`;
                              Severity: Minor
                              Found in src/applications/search/actions/index.js - About 1 hr to fix

                                Function buildMedicationInformationPDF has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const buildMedicationInformationPDF = list => {
                                  const listOfHeaders = ['h2', 'h3'];
                                  const sections = [
                                    ...list
                                      .filter(listItem => listOfHeaders.includes(listItem.type))
                                Severity: Minor
                                Found in src/applications/mhv-medications/util/pdfConfigs.js - About 1 hr to fix

                                  Function sortFunc has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    const sortFunc = (a, b) => {
                                      if (sortField === 'SENT_DATE') {
                                        if (sortOrder === 'DESC') {
                                          return compareDesc(
                                            new Date(a.attributes.sentDate),
                                  Severity: Minor
                                  Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js - About 1 hr to fix

                                    Function ValidationError has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function ValidationError(props) {
                                      const { appType, buttonText, formConfig, onBack, onSubmit, testId } = props;
                                      let ariaDescribedBy = null;
                                      // If no ariaDescribedBy is passed down from form.js,
                                      // a null value will properly not render the aria label.

                                      Function getButton has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        getButton(form) {
                                          let url = '';
                                          switch (form) {
                                            case '0994':
                                              url = `/education/about-gi-bill-benefits/how-to-use-benefits/vettec-high-tech-program/apply-for-vettec-form-22-0994`;
                                      Severity: Minor
                                      Found in src/applications/edu-benefits/components/EducationWizard.jsx - About 1 hr to fix

                                        Function benefitsEligibilityUpdate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const benefitsEligibilityUpdate = benefitsEligibilityBox => {
                                          const uiSchema = {
                                            'ui:description': benefitsEligibilityBox,
                                            'view:selectedBenefits': {
                                              'ui:title': 'Select the benefit that is the best match for you.',
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language