department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function ConfirmationPage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const ConfirmationPage = ({
  claimStatus,
  getClaimStatus,
  userFullName,
  userEmail,

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

export const IssueCard = ({
  id,
  index,
  item = {},
  options = {},
Severity: Minor
Found in src/applications/appeals/shared/components/IssueCard.jsx - About 1 hr 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 PrimaryPhone has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const PrimaryPhone = ({
  data,
  goBack,
  goForward,
  onReviewPage,
Severity: Minor
Found in src/applications/appeals/testing/sc/components/PrimaryPhone.jsx - About 1 hr 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 focusIssue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const focusIssue = (_index, root, value) => {
  setTimeout(() => {
    const item = value || window.sessionStorage.getItem(LAST_ISSUE);
    window.sessionStorage.removeItem(LAST_ISSUE);
    const [id, type] = (item || '').toString().split(',');
Severity: Minor
Found in src/applications/appeals/testing/sc/utils/focus.js - About 1 hr 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 PrimaryPhone has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const PrimaryPhone = ({
  data,
  goBack,
  goForward,
  onReviewPage,
Severity: Minor
Found in src/applications/appeals/995/components/PrimaryPhone.jsx - About 1 hr 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 focusIssue has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const focusIssue = (_index, root, value) => {
  setTimeout(() => {
    const item = value || window.sessionStorage.getItem(LAST_ISSUE);
    window.sessionStorage.removeItem(LAST_ISSUE);
    const [id, type] = (item || '').toString().split(',');
Severity: Minor
Found in src/applications/appeals/shared/utils/focus.js - About 1 hr 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 UserNav has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const UserNav = ({ isMobile }) => {
  const profile = useSelector(selectUserProfile);
  const isLoading = useSelector(selectIsUserLoading);
  const uniqueId = useRef(generateUniqueId());

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

const CarefulConsiderationStatement = ({ formResponses, router }) => {
  const reasonStatement = () => {
    const reason = formResponses[SHORT_NAME_MAP.REASON];
    const dischargeType = formResponses[SHORT_NAME_MAP.DISCHARGE_TYPE];

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

export const renderMedicalRecordInfo = formResponses => {
  const reason = formResponses[SHORT_NAME_MAP.REASON];
  if (
    [
      RESPONSES.REASON_PTSD,
Severity: Minor
Found in src/applications/discharge-wizard/helpers/index.jsx - About 1 hr 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 data has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  data: (state = initialState, action) => {
    switch (action.type) {
      case FETCH_POST_911_GI_BILL_ELIGIBILITY_SUCCESS:
        return {
          ...state,
Severity: Minor
Found in src/applications/enrollment-verification/reducers/index.js - About 1 hr 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 fieldsMustMatchValidation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const fieldsMustMatchValidation = (
  errors,
  page,
  formData,
  certProp,
Severity: Minor
Found in src/applications/ivc-champva/10-10D/helpers/validations.js - About 1 hr 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 deepEqual has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

function deepEqual(obj1, obj2) {
  if (obj1 === obj2) return true;

  if (
    typeof obj1 !== 'object' ||
Severity: Minor
Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr 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 nameWording has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export function nameWording(
  formData,
  isPosessive = true,
  cap = true,
  firstNameOnly = false,
Severity: Minor
Found in src/applications/ivc-champva/shared/utilities.js - About 1 hr 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 BenefitsProfileWrapper has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

const BenefitsProfileWrapper = ({ children }) => {
  const {
    loading,
    expirationDate,
    updated,

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

const LevelThreeLinks = ({ section, aboutVA = false }) => {
  const buildSeeAllLink = seeAllLink => {
    if (seeAllLink) {
      return (
        <div className="panel-bottom-link">

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

export const verifyEnrollmentAction = verifications => {
  return async (dispatch, getState) => {
    dispatch({ type: VERIFY_ENROLLMENT });
    const {
      checkClaimant: { claimantId },
Severity: Minor
Found in src/applications/verify-your-enrollment/actions/index.js - About 1 hr 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 concatStreets has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export function concatStreets(addr, newLines = false) {
  const updated = { ...addr, streetCombined: '' };
  if (addr) {
    for (const [k, v] of Object.entries(addr)) {
      updated.streetCombined += k.includes('street')
Severity: Minor
Found in src/applications/ivc-champva/shared/utilities.js - About 1 hr 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 useMockedLogin has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

export const useMockedLogin = () => {
  const [
    localHasSession,
    setLocalHasSession,
    clearLocalHasSession,

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

const updateMemDb = (req, res = null) => {
  const key = `${req.method} ${req.url}`;
  const body = req.body || {};

  if (key === 'PUT /v0/profile/telephones') {

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 10 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      activeEditView,
      fieldName,
      isEmpty,

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