department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function LabsAndTestsListItem has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const LabsAndTestsListItem = props => {
  const { record } = props;

  return (
    <va-card

    Function ConditionListItem has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ConditionListItem = props => {
      const { record } = props;
    
      return (
        <va-card

      Function allergiesReducer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const allergiesReducer = (state = initialState, action) => {
        switch (action.type) {
          case Actions.Allergies.GET_LIST: {
            return {
              ...state,
      Severity: Minor
      Found in src/applications/mhv-medications/reducers/allergies.js - About 1 hr to fix

        Function dropdownContent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                const dropdownContent = () => {
                  return (
                    <>
                      <p className="vads-u-padding-bottom--1">
                        A VA provider added this medication record in your VA medical

          Consider simplifying this complex logical expression.
          Open

              } else if (prefillEnabled && !verifyRequiredPrefill) {
                const H = `h${this.props.headingLevel}`;
                const {
                  buttonOnly,
                  retentionPeriod,
          Severity: Major
          Found in src/platform/forms/save-in-progress/SaveInProgressIntro.jsx - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  nextProps.reviewMode &&
                  !nextProps.editModeOnReviewPage &&
                  nextProps.reviewMode === this.props.reviewMode &&
                  deepEquals(this.state, nextState) &&
            Severity: Major
            Found in src/platform/forms-system/src/js/components/SchemaForm.jsx - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                    } else if (
                      allowITF &&
                      !isCreating &&
                      !hasActiveITF &&
                      !createITFCalled &&
              Severity: Major
              Found in src/applications/appeals/testing/sc/containers/ITFWrapper.jsx - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                      } else if (
                        allowITF &&
                        !isCreating &&
                        !hasActiveITF &&
                        !createITFCalled &&
                Severity: Major
                Found in src/applications/appeals/995/containers/ITFWrapper.jsx - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (
                        nextProps.reviewMode &&
                        !nextProps.editModeOnReviewPage &&
                        nextProps.reviewMode === this.props.reviewMode &&
                        deepEquals(this.state, nextState) &&

                    Consider simplifying this complex logical expression.
                    Open

                            if (
                              [SENT_DATE_DESCENDING.value, DRAFT_DATE_DESCENDING.value].includes(
                                sortOrder,
                              ) ||
                              (sortOrder === SENDER_ALPHA_ASCENDING.value &&

                      Consider simplifying this complex logical expression.
                      Open

                        if (
                          errorCodes.some(
                            code =>
                              code === 10001 ||
                              code === 10006 ||

                        Consider simplifying this complex logical expression.
                        Open

                            if (!isLoading) {
                              return (
                                <div className="landing-page no-print">
                                  <h1 data-testid="list-page-title" className="vads-u-margin-bottom--2">
                                    Medications
                        Severity: Major
                        Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                if (
                                  ((prescriptionsFullList?.length &&
                                    pdfTxtGenerateStatus.format !== PRINT_FORMAT.PRINT) ||
                                    (pdfTxtGenerateStatus.format === PRINT_FORMAT.PRINT &&
                                      paginatedPrescriptionsList?.length)) &&
                          Severity: Major
                          Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 1 hr to fix

                            Function FormStartControls has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const FormStartControls = props => {
                              const {
                                formId,
                                migrations,
                                startPage,
                            Severity: Minor
                            Found in src/platform/forms/save-in-progress/FormStartControls.jsx - About 55 mins 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 generateResultsContent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export const generateResultsContent = async (doc, parent, data) => {
                              const results = doc.struct('Sect', {
                                title: 'Results',
                              });
                              parent.add(results);
                            Severity: Minor
                            Found in src/platform/pdf/templates/blue_button_report.js - About 55 mins 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 testForm has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const testForm = testConfig => {
                              const {
                                appName,
                                arrayPages = [],
                                dataPrefix,
                            Severity: Minor
                            Found in src/platform/testing/e2e/cypress/support/form-tester/index.js - About 55 mins 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                              render() {
                                const { formConfig, buttonOnly, devOnly } = this.props;
                                const devOnlyForceShowFormControls =
                                  environment.isLocalhost() &&
                                  !window.Cypress &&
                            Severity: Minor
                            Found in src/platform/forms/save-in-progress/SaveInProgressIntro.jsx - About 55 mins 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 generateResultsContent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const generateResultsContent = async (doc, parent, data, config) => {
                              const results = doc.struct('Sect', {
                                title: 'Results',
                              });
                              parent.add(results);
                            Severity: Minor
                            Found in src/platform/pdf/templates/medical_records.js - About 55 mins 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 exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            module.exports = async (on, config) => {
                              if (process.env.CODE_COVERAGE === 'true') {
                                require('@cypress/code-coverage/task')(on, config);
                                on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'));
                              }
                            Severity: Minor
                            Found in src/platform/testing/e2e/cypress/plugins/index.js - About 55 mins 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 titleUI has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                            export const titleUI = (titleOption, descriptionOption) => {
                              const {
                                title,
                                description,
                                headerLevel,
                            Severity: Minor
                            Found in src/platform/forms-system/src/js/web-component-patterns/titlePattern.js - About 55 mins 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

                            Severity
                            Category
                            Status
                            Source
                            Language