department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function LocationSearchResults has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

function LocationSearchResults({
  search,
  filters,
  preview,
  dispatchUpdateEligibilityAndFilters,
Severity: Minor
Found in src/applications/gi/containers/search/LocationSearchResults.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 SchoolLocations has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

export default function SchoolLocations({
  calculator,
  constants,
  eligibility,
  facilityMap,
Severity: Minor
Found in src/applications/gi/components/profile/SchoolLocations.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

File form.js has 412 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// platform imports
import environment from 'platform/utilities/environment';
import { VA_FORM_IDS } from 'platform/forms/constants';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
import ezrSchema from 'vets-json-schema/dist/10-10EZR-schema.json';
Severity: Minor
Found in src/applications/ezr/config/form.js - About 5 hrs to fix

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

    export const renderAdditionalInfo = deductionCode => {
      switch (deductionCode) {
        case '30':
          return (
            <section>

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

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

        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 GrossMonthlyIncomeInput has 146 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

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

                const VaccineDetails = props => {
                  const { runningUnitTest } = props;
                  const record = useSelector(state => state.mr.vaccines.vaccineDetails);
                  const vaccines = useSelector(state => state.mr.vaccines.vaccinesList);
                  const user = useSelector(state => state.user.profile);
                Severity: Major
                Found in src/applications/mhv-medical-records/containers/VaccineDetails.jsx - About 5 hrs to fix

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

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

                    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 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 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

                        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 transformVAOSAppointment has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function transformVAOSAppointment(appt) {
                          const appointmentType = getAppointmentType(appt);
                          const isCC = appt.kind === 'cc';
                          const isVideo = appt.kind === 'telehealth';
                          const isAtlas = !!appt.telehealth?.atlas;
                        Severity: Minor
                        Found in src/applications/vaos/services/appointment/transformers.js - 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

                        File utils.js has 406 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /**
                         * Template utils.
                         */
                        import { unset } from 'lodash';
                        import registerFonts from '../registerFonts';
                        Severity: Minor
                        Found in src/platform/pdf/templates/utils.js - About 5 hrs to fix

                          File index.js has 406 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

                            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
                              Severity
                              Category
                              Status
                              Source
                              Language