department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function updateSchemaFromUiSchema has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export function updateSchemaFromUiSchema(
  schema,
  uiSchema,
  formData,
  index = null,
Severity: Minor
Found in src/platform/forms-system/src/js/state/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 AreaOfDisagreement has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

const AreaOfDisagreement = ({
  data = {},
  pagePerItemIndex,
  goBack,
  goForward,
Severity: Minor
Found in src/applications/appeals/shared/components/AreaOfDisagreement.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 ApplicantRelationshipPage has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export default function ApplicantRelationshipPage({
  data,
  genOp,
  setFormData,
  goBack,

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

export const SearchResultsHeader = props => {
  const { searchResults, pagination, query } = props;
  const {
    inProgress,
    context,

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

const BDDPage = ({ setPageState, state = '' }) => {
  const [ariaDescribedby, setAriaDescribedby] = useState('');
  const [isDirty, setIsDirty] = useState(false);
  const [errorMessage, setErrorMessage] = useState(null);

Severity: Minor
Found in src/applications/disability-benefits/wizard/pages/bdd.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 transformForSubmit has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export default function transformForSubmit(formConfig, form) {
  const transformedData = JSON.parse(
    sharedTransformForSubmit(formConfig, form),
  );
  const { preparerType, otherReasons } = transformedData;
Severity: Minor
Found in src/applications/simple-forms/20-10207/config/submit-transformer.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 PrimaryAddressWithAutofill has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

const PrimaryAddressWithAutofill = props => {
  const { formContext, formData, idSchema, onChange, schema } = props;
  const { reviewMode, submitted } = formContext;
  const { properties: schemaProps } = schema;
  const { veteranAddress } = useSelector(state => state.form.data);

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

const BankruptcyDetails = ({
  data,
  goBack,
  goForward,
  setFormData,

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

const ContactInfo = ({
  data,
  goBack,
  goForward,
  onReviewPage,

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

const SearchBenefits = ({
  cumulativeService,
  dispatchShowModal,
  eligForPostGiBill,
  enlistmentService,
Severity: Minor
Found in src/applications/gi/components/SearchBenefits.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 KeywordSearch has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

export function KeywordSearch({
  className,
  inputValue,
  label,
  labelAdditional,
Severity: Minor
Found in src/applications/gi/components/search/KeywordSearch.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

File ToeApp.jsx has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { isArray } from 'lodash';
import PropTypes from 'prop-types';
import { VaBreadcrumbs } from '@department-of-veterans-affairs/web-components/react-bindings';
Severity: Minor
Found in src/applications/toe/containers/ToeApp.jsx - About 2 hrs to fix

    File pdfAddress.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // pdf-address.js
    // customized version of src/platform/forms/definitions/address.js,
    // with support added for PDF-specific maxLengths [street, street2, & city].
    import { createSelector } from 'reselect';
    import {
    Severity: Minor
    Found in src/applications/simple-forms/shared/definitions/pdfAddress.js - About 2 hrs to fix

      File householdIncomeChapter.js has 287 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        benefits,
        additionalIncomeValues,
        spouseBenefits,
        spouseBenefitRecords,

        Function expandAllEnrollments has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              const expandAllEnrollments = () => {
                /*
                  make sure the begin date and end date are in the same month,
                  if not then expand the enrollment period for each month
                  between the begin and end dates of the enrollment

          Function DeactivatedMHVIds has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const DeactivatedMHVIds = () => {
            const content = {
              heading: 'Your My HealtheVet account is inactive',
              alertText: (
                <div>

            Function DependencyVerificationModal has 72 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const DependencyVerificationModal = props => {
              const nodeToWatch = document.getElementsByTagName('body')[0];
              const [otherModal, setOtherModal] = useState(null);
            
              const openModal = () => {

              Function Wrapper has 72 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const Wrapper = props => {
                const {
                  children,
                  pageTitle,
                  titleOverride,
              Severity: Major
              Found in src/applications/check-in/components/layout/Wrapper.jsx - About 2 hrs to fix

                Function Appeals has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const Appeals = () => {
                  useEffect(() => {
                    recordEvent({
                      event: 'howToWizard-alert-displayed',
                      'reason-for-alert':
                Severity: Major
                Found in src/applications/financial-status-report/wizard/pages/Appeals.jsx - About 2 hrs to fix

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

                    render() {
                      const crumbs = [
                        {
                          href: `../status`,
                          label: 'Status details',
                  Severity: Major
                  Found in src/applications/claims-status/containers/ClaimEstimationPage.jsx - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language