department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function validateSponsorDeathDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function validateSponsorDeathDate(
  errors,
  { isDeceased, dateOfBirth, dateOfDeath },
) {
  // dob = date of birth | dod = date of death
Severity: Minor
Found in src/applications/pre-need-integration/validation.js - About 25 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 hasFormChanged has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const hasFormChanged = obj => {
  const keys = Object.keys(obj ?? {});
  for (const key of keys) {
    const value = obj[key];
    // Skip the specific key

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

export const addressLabel = address => {
  // Destructure address object for easier access
  const {
    addressLine1,
    addressLine2,

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

const DisabilityRating = () => {
  const hasError = useSelector(totalDisabilityError);
  const rating = useSelector(state => state.totalRating?.totalDisabilityRating);
  const canAccessRatingInfo = useSelector(canAccess)?.[API_NAMES.RATING_INFO];

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

export const DevToolsLoader = ({ devToolsData, nanoidImp, showIcon }) => {
  const [show, setShow] = useState(false);

  const uuid = useRef(getUuid(nanoidImp));

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

export const fetchFolder = (id, query = {}) => async dispatch => {
  dispatch({
    type: LOADING_FOLDER,
    request: { id, query },
  });
Severity: Minor
Found in src/applications/personalization/dashboard/actions/messaging.js - About 25 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 ContactInfoOnFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ContactInfoOnFile = ({
  emailAddress,
  mobilePhoneNumber,
  showEmailNotificationSettings,
}) => {

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

const formatAppointmentsContentToText = content => {
  const sections = content.results.items;

  // Preface text
  const { preface } = content.results;
Severity: Minor
Found in src/applications/mhv-medical-records/util/txtHelpers/appointments.js - About 25 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 ProfileSubNavItems has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function ProfileSubNavItems({ routes, isLOA3, isInMVI, clickHandler = null }) {
  const isBlocked = useSelector(selectIsBlocked); // incompetent, fiduciary flag, deceased

  // Filter out the routes the user cannot access due to
  // not being in MVI/MPI, not having a high enough LOA,

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

const CTALink = ({
  ariaLabel,
  className,
  href,
  text,
Severity: Minor
Found in src/applications/personalization/dashboard/components/CTALink.jsx - About 25 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 ImageGallery has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ImageGallery = ({ imageList, imagesPerPage, studyId }) => {
  const apiImagingPath = `${
    environment.API_URL
  }/my_health/v1/medical_records/imaging`;

Severity: Minor
Found in src/applications/mhv-medical-records/components/shared/ImageGallery.jsx - About 25 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 VaccineDetails has a Cognitive Complexity of 6 (exceeds 5 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: Minor
Found in src/applications/mhv-medical-records/containers/VaccineDetails.jsx - About 25 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 getStatusContents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function getStatusContents(appeal, name = {}) {
  const { status, aoj, programArea } = appeal.attributes;
  const appealType = appeal.type;
  const statusType = status.type || status;
  const details = status.details || {};
Severity: Minor
Found in src/applications/personalization/dashboard/utils/getStatusContents.jsx - About 25 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 getListWithRetry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const getListWithRetry = async (
  dispatch,
  getList,
  retryInterval = defaultRetryInterval,
  endTimeParam = null,
Severity: Minor
Found in src/applications/mhv-medical-records/actions/common.js - About 25 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 HealthCareContent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const HealthCareContent = ({
  appointments,
  authenticatedWithSSOe,
  shouldFetchUnreadMessages,
  fetchConfirmedFutureAppointments,

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

export const findMatchingCvixReport = (phrResponse, cvixResponseList) => {
  if (phrResponse && Array.isArray(cvixResponseList)) {
    for (const cvixResponse of cvixResponseList) {
      if (radiologyReportsMatch(phrResponse, cvixResponse)) {
        return cvixResponse;
Severity: Minor
Found in src/applications/mhv-medical-records/util/radiologyUtil.js - About 25 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 fetchRefreshStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const fetchRefreshStatus = () => async dispatch => {
  try {
    const response = await getRefreshStatus();
    const statusList = response?.facilityExtractStatusList || [];
    const mostRecentLastRequested =
Severity: Minor
Found in src/applications/mhv-medical-records/actions/refresh.js - About 25 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 getDateSigned has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const getDateSigned = record => {
  if (isArrayAndHasItems(record.authenticator?.extension)) {
    const ext = record.authenticator.extension.find(e => e.valueDateTime);
    if (ext) {
      const formattedDate = formatDateLong(ext.valueDateTime);
Severity: Minor
Found in src/applications/mhv-medical-records/reducers/careSummariesAndNotes.js - About 25 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 areDatesEqualToMinute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const areDatesEqualToMinute = (var1, var2) => {
  const parseDate = input => {
    let date;
    if (/^\d+$/.test(input)) {
      // Input is a numeric string, parse it as a number (timestamp)
Severity: Minor
Found in src/applications/mhv-medical-records/util/radiologyUtil.js - About 25 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 ConditionDetails has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ConditionDetails = props => {
  const { runningUnitTest } = props;
  const record = useSelector(state => state.mr.conditions.conditionDetails);
  const conditionList = useSelector(
    state => state.mr.conditions.conditionsList,
Severity: Minor
Found in src/applications/mhv-medical-records/containers/ConditionDetails.jsx - About 25 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