department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function inquiriesGridView has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const inquiriesGridView = category => {
    const filteredInquiries = filterAndSortInquiries(category);
    const indexOfLastItem = currentPage * itemsPerPage;
    const indexOfFirstItem = indexOfLastItem - itemsPerPage;
    const currentInquiries = filteredInquiries.slice(
Severity: Major
Found in src/applications/ask-va/containers/DashboardCardsMock.jsx - About 2 hrs to fix

    Function ReplyDrafts has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ReplyDrafts = props => {
      const {
        cannotReply,
        drafts,
        isSaving,

      Function getPageFlow has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function getPageFlow(state) {
        const featureBreadcrumbUrlUpdate = selectFeatureBreadcrumbUrlUpdate(state);
      
        return {
          clinicChoice: {
      Severity: Major
      Found in src/applications/vaos/covid-19-vaccine/flow.js - About 2 hrs to fix

        Function BehalfOfSomeoneElseContent has 74 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const BehalfOfSomeoneElseContent = () => {
          return (
            <>
              <p>
                You can upload a copy of their sponsor’s DD214 or other separation

          Function content has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const content = () => {
              return (
                <>
                  {allergies?.length > 0 ? (
                    <>

            Function pdfData has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                (rxList, allergiesList) => {
                  return {
                    subject: 'Full Medications List',
                    headerBanner: [
                      {
            Severity: Major
            Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 2 hrs to fix

              File FolderThreadListView.jsx has 289 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useCallback, useEffect, useMemo } from 'react';
              import { useSelector, useDispatch } from 'react-redux';
              import { useLocation, useParams } from 'react-router-dom';
              import PropTypes from 'prop-types';
              import {

                File helpers.js has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import moment from 'moment-timezone';
                import * as Sentry from '@sentry/browser';
                import { snakeCase } from 'lodash';
                import { generatePdf } from '@department-of-veterans-affairs/platform-pdf/exports';
                import { formatDateLong } from '@department-of-veterans-affairs/platform-utilities/exports';
                Severity: Minor
                Found in src/applications/mhv-medical-records/util/helpers.js - About 2 hrs to fix

                  Function enterData has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function enterData(field) {
                    switch (field.type) {
                      // Select fields register as having type 'select-one'.
                      case 'select-one':
                        cy.wrap(field.element)
                  Severity: Major
                  Found in src/platform/testing/e2e/cypress/support/form-tester/index.js - About 2 hrs to fix

                    Function testForm has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const testForm = testConfig => {
                      const {
                        appName,
                        arrayPages = [],
                        dataPrefix,
                    Severity: Major
                    Found in src/platform/testing/e2e/cypress/support/form-tester/index.js - About 2 hrs to fix

                      Function makeMockApiRouter has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function makeMockApiRouter(opts) {
                        // mockResponses[token][verb][response]
                        const mockResponses = {};
                      
                        const router = express.Router(); // eslint-disable-line new-cap
                      Severity: Major
                      Found in src/platform/testing/e2e/mockapi.js - About 2 hrs to fix

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

                          render() {
                            const { currentLocation, formConfig, children, formData } = this.props;
                            const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
                            const lastPathComponent = currentLocation.pathname.split('/').pop();
                            const isIntroductionPage = trimmedPathname.endsWith('introduction');
                        Severity: Major
                        Found in src/platform/forms-system/src/js/containers/FormApp.jsx - About 2 hrs to fix

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

                            render() {
                              // loading state for terms content is handled by parent component
                              const { terms } = this.props;
                          
                              if (!terms.termsContent) {
                          Severity: Major
                          Found in src/platform/user/authorization/components/AcceptTermsPrompt.jsx - About 2 hrs to fix

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

                              render() {
                                const {
                                  addressValidationType,
                                  suggestedAddresses,
                                  addressFromUser,

                              Function submit has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const submit = form => {
                                const currentAddress = form.data['view:currentAddress'];
                                const itemQuantities = form.data?.order?.length;
                                const { order, permanentAddress, temporaryAddress, vetEmail } = form.data;
                                for (const address of [permanentAddress, temporaryAddress]) {
                              Severity: Major
                              Found in src/applications/health-care-supply-reordering/config/form.js - About 2 hrs to fix

                                Function createDirectDepositPage has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function createDirectDepositPage(schema) {
                                  const { bankAccountChangeUpdate, bankAccount } = schema.definitions;
                                
                                  return {
                                    title: 'Direct deposit',
                                Severity: Major
                                Found in src/applications/edu-benefits/pages/directDepositChangeUpdate.js - About 2 hrs to fix

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

                                    render() {
                                      return (
                                        <div className="schemaform-intro">
                                          <FormTitle title="Apply for a Specially Adapted Housing Grant or Special Home Adaptation Grant" />
                                          <p>
                                  Severity: Major
                                  Found in src/applications/sah/sahg/containers/IntroductionPage.jsx - About 2 hrs to fix

                                    Function activeDutyNote has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      const activeDutyNote = () => {
                                        if (
                                          eighteenOrOver(formData.relativeDateOfBirth) &&
                                          (!hasServed || (hasServed && allServicePeriodsHaveEndDate))
                                        ) {
                                    Severity: Major
                                    Found in src/applications/edu-benefits/5490/containers/PreSubmitInfo.jsx - About 2 hrs to fix

                                      Function facilityReducer has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export function facilityReducer(state = initialState, action) {
                                        switch (action.type) {
                                          case FETCH_FACILITY_STARTED:
                                            return { ...state, data: {}, loading: true, error: false };
                                          case FETCH_FACILITY_SUCCESS:
                                      Severity: Major
                                      Found in src/applications/static-pages/facilities/reducers/index.js - About 2 hrs to fix

                                        Function WiderThanMobileOfficialGovtWebsite has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const WiderThanMobileOfficialGovtWebsite = () => {
                                          const [isExpanded, setIsExpanded] = useState(false);
                                        
                                          const toggleExpansion = () => {
                                            setIsExpanded(!isExpanded);
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language