department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function generateResultItemContent has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const generateResultItemContent = async (
  item,
  doc,
  results,
  hasHorizontalRule,
Severity: Minor
Found in src/platform/pdf/templates/self_entered_info.js - About 2 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 arrayBuilderYesNoUI has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

export const arrayBuilderYesNoUI = (
  arrayBuilderOptions,
  yesNoOptions,
  yesNoOptionsMore,
) => {

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

export function getNonArraySchema(schema, uiSchema = {}) {
  if (
    schema.type === 'array' &&
    !get('ui:options.keepInPageOnReview', uiSchema)
  ) {
Severity: Minor
Found in src/platform/forms-system/src/js/helpers.js - About 2 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 addressUiSchema has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

export default function addressUiSchema(
  path = 'address',
  checkBoxTitle = 'I live on a United States military base outside of the U.S.',
  uiRequiredCallback = () => false,
  newSchemaKeys = {},
Severity: Minor
Found in src/platform/forms-system/src/js/definitions/profileAddress.js - About 2 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 Balances has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const Balances = () => {
  // get balances from redux
  const { debtLetters, mcp } = useSelector(
    ({ combinedPortal }) => combinedPortal,
  );

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

export default function V3BasePage() {
  /** @param {import('react').FormEvent | import('@department-of-veterans-affairs/web-components/dist/types/components').VaSelectCustomEvent } evt */
  function updateValue(evt) {
    const { value, name } = /** @type {HTMLInputElement} */ (evt.target);
    const display = document.getElementById(`${name}Value`);
Severity: Minor
Found in src/applications/ds-v3-playground/pages/V3BasePage.jsx - About 2 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 validateLogin has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const validateLogin = async (
  lastName,
  dob,
  dobError,
  setLastNameError,
Severity: Minor
Found in src/applications/check-in/utils/validateVeteran/index.js - About 2 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 MessageThreadItem has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const MessageThreadItem = props => {
  const dispatch = useDispatch();
  const accordionItemRef = useRef();
  const { message, isDraftThread, open, forPrint } = props;
  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 EditContactList has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const EditContactList = () => {
  const dispatch = useDispatch();
  const location = useLocation();
  const history = useHistory();
  const [allTriageTeams, setAllTriageTeams] = useState(null);
Severity: Minor
Found in src/applications/mhv-secure-messaging/containers/EditContactList.jsx - About 2 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 MoveMessageToFolderBtn has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const MoveMessageToFolderBtn = props => {
  const {
    threadId,
    allFolders,
    isVisible,

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

export function uiSchema(
  label = 'Address',
  useStreet3 = false,
  isRequired = null,
  ignoreRequired = false,
Severity: Minor
Found in src/applications/pre-need-integration/definitions/address.js - About 2 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 SuggestedAddress has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

const SuggestedAddress = ({
  formData,
  address,
  handleAddNewClick,
  setAddressToUI,

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

const ProofOfVeteranStatusNew = ({
  serviceHistory = [],
  vetStatusEligibility = {},
  totalDisabilityRating,
  userFullName = {

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

const RadiologyDetails = props => {
  const { record, fullState, runningUnitTest } = props;
  const phase0p5Flag = useSelector(
    state => state.featureToggles.mhv_integration_medical_records_to_phase_1,
  );

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

const DownloadReportPage = ({ runningUnitTest }) => {
  const dispatch = useDispatch();

  const {
    user: { profile: userProfile },

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 webComponents.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const FORCE_OPTION = { force: true };
const DELAY_OPTION = { force: true, delay: 100 };

Cypress.Commands.add('selectVaButtonPairPrimary', field => {
  const selector = `va-button-pair${field ? `[name="${field}"]` : ''}`;
Severity: Minor
Found in src/platform/testing/e2e/cypress/support/commands/webComponents.js - About 2 hrs to fix

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

    const all = {
      resourceType: 'Bundle',
      id: '27b154d8-18c6-41b3-a988-8474bacd19a8',
      meta: {
        lastUpdated: '2023-09-29T11:04:31.316-04:00',
    Severity: Minor
    Found in src/platform/mhv/api/mocks/medical-records/health-conditions/index.js - About 2 hrs to fix

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

      import environment from '@department-of-veterans-affairs/platform-utilities/environment';
      import { externalServices } from 'platform/monitoring/DowntimeNotification';
      import get from '@department-of-veterans-affairs/platform-forms-system/get';
      import GetFormHelp from '../../shared/components/GetFormHelp';
      import manifest from '../manifest.json';
      Severity: Minor
      Found in src/applications/ivc-champva/10-7959a/config/form.js - About 2 hrs to fix

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

        import React from 'react';
        import PropTypes from 'prop-types';
        import { VaTextInputField } from 'platform/forms-system/src/js/web-component-fields';
        import {
          currentOrPastDateUI,

          File UpcomingAppointmentsPage.unit.spec.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';
          import { expect } from 'chai';
          import MockDate from 'mockdate';
          import moment from 'moment';
          import React from 'react';
            Severity
            Category
            Status
            Source
            Language