department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function prescriptionsReducer has 147 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const prescriptionsReducer = (state = initialState, action) => {
  switch (action.type) {
    case Actions.Prescriptions.SET_DETAILS:
    case Actions.Prescriptions.GET_DETAILS: {
      return {
Severity: Major
Found in src/applications/mhv-medications/reducers/prescriptions.js - About 5 hrs to fix

    Function data has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      data: (state = initialState, action) => {
        switch (action.type) {
          case FETCH_EXCLUSION_PERIODS:
            return {
              ...state,
    Severity: Major
    Found in src/applications/my-education-benefits/reducers/index.js - About 5 hrs to fix

      Function createMockSuccessResponse has 146 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const createMockSuccessResponse = (
        token,
        demographicsNeedsUpdate = false,
        demographicsConfirmedAt = null,
        nextOfKinNeedsUpdate = false,

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

          render() {
            const { submission, data } = this.props.form;
            const { response } = submission;
            const veteranFirstName = data?.veteranInformation?.fullName?.first || '';
            const veteranLastName = data?.veteranInformation?.fullName?.last || '';

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

            render() {
              const downloadStatus = this.props.letterDownloadStatus;
              const letterItems = (this.props.letters || []).map((letter, index) => {
                let content;
                let letterTitle;
          Severity: Major
          Found in src/applications/letters/containers/LetterList.jsx - About 5 hrs to fix

            Function GrossMonthlyIncomeInput has 146 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const GrossMonthlyIncomeInput = props => {
              const { goToPath, goBack, setFormData } = props;
            
              const editIndex = getJobIndex();
            
            

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

                render() {
                  const {
                    uiSchema,
                    errorSchema,
                    idSchema,

                Function renderView has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const renderView = () => {
                    // This block renders the desktop and mobile view. It ensures that the desktop map
                    // gets re-loaded when resizing from mobile to desktop.
                    const {
                      currentQuery,
                Severity: Major
                Found in src/applications/facility-locator/containers/FacilitiesMap.jsx - About 5 hrs to fix

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

                    render() {
                      const { showWizard } = this.props;
                  
                      if (showWizard === undefined) return null;
                  
                  

                    File ContactInfo.jsx has 408 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React, { useEffect, useState, useRef } from 'react';
                    import { useSelector, connect } from 'react-redux';
                    import PropTypes from 'prop-types';
                    import { Link } from 'react-router';
                    
                    

                      File index.js has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import path from 'path';
                      
                      import get from 'platform/utilities/data/get';
                      
                      import disableFTUXModals from 'platform/user/tests/disableFTUXModals';
                      Severity: Minor
                      Found in src/platform/testing/e2e/cypress/support/form-tester/index.js - About 5 hrs to fix

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

                          render() {
                            const { supplies, order, eligibility } = this.props;
                            const currentDate = moment();
                            const apneaSupplies = supplies.filter(
                              supply => supply.productGroup === APNEA,

                          Function IntroductionPage has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const IntroductionPage = props => {
                            useEffect(() => {
                              focusElement('.schemaform-title > h1');
                              scrollToTop();
                              document.title =
                          Severity: Major
                          Found in src/applications/vre/28-1900/containers/IntroductionPage.jsx - About 5 hrs to fix

                            Function mapRecordItems has 144 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const mapRecordItems = (type, record) => {
                              const commonItems = {
                                [seiVitalTypes.BLOOD_PRESSURE]: [
                                  { title: 'Time', value: record.time, inline: true },
                                  { title: 'Systolic', value: record.systolic, inline: true },
                            Severity: Major
                            Found in src/applications/mhv-medical-records/util/pdfHelpers/sei/vitals.js - About 5 hrs to fix

                              Function ChangeOfAddressWrapper has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const ChangeOfAddressWrapper = ({ mailingAddress, loading, applicantName }) => {
                                const { loading: isLoading, error, data: response } = useSelector(
                                  state => state.updateAddress,
                                );
                                const {

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function FacilitySearch has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const FacilitySearch = props => {
                                const { data: formData, goBack, goForward, goToPath } = props;
                                const [query, setQuery] = useState('');
                                const [submittedQuery, setSubmittedQuery] = useState('');
                                const [loading, setLoading] = useState(false);
                              Severity: Minor
                              Found in src/applications/caregivers/components/FormFields/FacilitySearch.jsx - About 5 hrs to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function EmploymentWorkDates has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const EmploymentWorkDates = props => {
                                const { goToPath, setFormData, data } = props;
                              
                                const RETURN_PATH = '/enhanced-employment-records';
                              
                              

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function SpouseEmploymentWorkDates has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const SpouseEmploymentWorkDates = props => {
                                const { goToPath, setFormData, data } = props;
                              
                                const RETURN_PATH = '/enhanced-spouse-employment-records';
                              
                              

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              File touData.jsx has 405 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import React from 'react';
                              import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
                              
                              export default [
                                {
                              Severity: Minor
                              Found in src/applications/terms-of-use/touData.jsx - About 5 hrs to fix

                                Function default has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function() {
                                  if (
                                    // need this environment check for unit tests to work
                                    environment.isProduction() &&
                                    // this will filter production users using the feature flag
                                Severity: Major
                                Found in src/applications/disability-benefits/all-claims/config/8940/index.js - About 5 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language