department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function updateFacilitySortMethod has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function updateFacilitySortMethod(sortMethod, uiSchema) {
  return async (dispatch, getState) => {
    let location = null;
    const facilities = getTypeOfCareFacilities(getState());
    const cernerSiteIds = selectRegisteredCernerFacilityIds(getState());
Severity: Major
Found in src/applications/vaos/new-appointment/redux/actions.js - About 2 hrs to fix

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

      render() {
        const { claim, loading } = this.props;
        let content;
        if (loading) {
          content = (
    Severity: Major
    Found in src/applications/claims-status/containers/StemClaimStatusPage.jsx - About 2 hrs to fix

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

      export function transform(formConfig, form) {
        // Copy over sponsor data if the claimant is the veteran.
        const populateSponsorData = application =>
          isVeteran({ application })
            ? merge({}, application, {
      Severity: Major
      Found in src/applications/pre-need-integration/utils/helpers.js - About 2 hrs to fix

        Function App has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function App() {
          const isLoading = useSelector(state => state?.user?.profile?.loading);
          const isLoggedIn = useSelector(state => state?.user.login.currentlyLoggedIn);
          const pageContent = isLoggedIn ? (
            <AuthenticatedPageContent />
        Severity: Major
        Found in src/applications/dhp-connected-devices/containers/App.jsx - About 2 hrs to fix

          File EnhancedVehicleRecord.jsx has 251 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { useState } from 'react';
          import PropTypes from 'prop-types';
          import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
          import { isValidCurrency } from '../../utils/validations';
          import ButtonGroup from '../shared/ButtonGroup';

            Function exports has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function(chai, utils) {
              const axe = require('axe-core');
              const { Assertion } = chai;
            
              utils.addMethod(chai.Assertion.prototype, 'accessible', function(
            Severity: Minor
            Found in src/platform/testing/unit/axe-plugin.js - About 2 hrs to fix

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

                render() {
                  if (!this.props.user.login.currentlyLoggedIn) return null;
                  const { savedStatus } = this.props.form;
                  const { formConfig } = this.props;
                  const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
              Severity: Minor
              Found in src/platform/forms/save-in-progress/SaveFormLink.jsx - About 2 hrs to fix

                Function VAPServiceTransaction has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function VAPServiceTransaction(props) {
                  const {
                    id,
                    isModalOpen,
                    children,

                  Function returnAllCare has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const returnAllCare = async params => {
                    const { address, bounds, locationType, page, center, radius } = params;
                    const isUrgentCare = locationType === LocationType.URGENT_CARE;
                    const vaData = await LocatorApi.searchWithBounds(
                      address,
                  Severity: Minor
                  Found in src/applications/facility-locator/actions/locations/fetchLocations.js - About 2 hrs to fix

                    Function DecisionReviewPage has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const DecisionReviewPage = () => {
                      useEffect(() => {
                        setTimeout(() => {
                          focusElement('#main h2');
                        });
                    Severity: Minor
                    Found in src/applications/appeals/testing/hlr/subtask/pages/other.jsx - About 2 hrs to fix

                      Function DecisionReviewPage has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const DecisionReviewPage = () => {
                        useEffect(() => {
                          setTimeout(() => {
                            focusElement('#main h2');
                          });
                      Severity: Minor
                      Found in src/applications/appeals/testing/sc/subtask/pages/other.jsx - About 2 hrs to fix

                        Consider simplifying this complex logical expression.
                        Open

                          if (results) {
                            const {
                              gmt_threshold: gmt,
                              national_threshold: national,
                              pension_threshold: pension,
                        Severity: Critical
                        Found in src/applications/income-limits/containers/ResultsPage.jsx - About 2 hrs to fix

                          Function DecisionReviewPage has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const DecisionReviewPage = () => {
                            useEffect(() => {
                              setTimeout(() => {
                                focusElement('#main h2');
                              });
                          Severity: Minor
                          Found in src/applications/appeals/995/subtask/pages/other.jsx - About 2 hrs to fix

                            Function applicantInsuranceCardSchema has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function applicantInsuranceCardSchema(isPrimary) {
                              const keyname = isPrimary ? 'primaryInsuranceCard' : 'secondaryInsuranceCard';
                              return {
                                uiSchema: {
                                  ...titleUI(

                              Function getPeriodsToVerifyDGIB has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const getPeriodsToVerifyDGIB = (
                                pendingEnrollments,
                                shouldReverse = false,
                              ) => {
                                // Sort the enrollments by verificationBeginDate
                              Severity: Minor
                              Found in src/applications/verify-your-enrollment/helpers.jsx - About 2 hrs to fix

                                Function conditionalDataLayerPush has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    const conditionalDataLayerPush = () => {
                                      return (
                                        currentLocationInputString,
                                        currentSortType,
                                        currentRepresentativeType,
                                Severity: Minor
                                Found in src/applications/representative-search/containers/SearchPage.jsx - About 2 hrs to fix

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

                                    render() {
                                      const {
                                        data,
                                        schema,
                                        uiSchema,

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

                                      render() {
                                        const {
                                          data,
                                          schema,
                                          uiSchema,

                                      Function submitToAPI has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const submitToAPI = (state, setState) => {
                                        // if no file has been added, show an error message
                                        if (state.files.length === 0) {
                                          setState({
                                            ...state,
                                      Severity: Minor
                                      Found in src/applications/lgy/coe/status/components/DocumentUploader/submit.js - About 2 hrs to fix

                                        Function submitToAPI has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const submitToAPI = (state, setState) => {
                                          // if no file has been added, show an error message
                                          if (state.files.length === 0) {
                                            setState({
                                              ...state,
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language