Showing 4,177 of 14,709 total issues
Function ConditionDetails
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ConditionDetails = props => {
const { runningUnitTest } = props;
const record = useSelector(state => state.mr.conditions.conditionDetails);
const conditionList = useSelector(
state => state.mr.conditions.conditionsList,
File ArrayField.jsx
has 463 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import PropTypes from 'prop-types';
import React from 'react';
import set from 'platform/utilities/data/set';
import classNames from 'classnames';
File constants.js
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/** time to wait (in ms) after the user stops typing before initiating draft auto-save */
export const draftAutoSaveTimeout = 10000;
export const Paths = {
MYHEALTH: '/my-health',
Function CompareLayout
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
Open
const CompareLayout = ({
calculated,
estimated,
institutions,
showDifferences,
- Read upRead up
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 PrescriptionDetails
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
Open
const PrescriptionDetails = () => {
const prescription = useSelector(
state => state.rx.prescriptions?.prescriptionDetails,
);
const prescriptionsApiError = useSelector(
- Read upRead up
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 getEventContent
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function getEventContent(event) {
switch (event.type) {
case EVENT_TYPES.claimDecision:
return {
title: 'VA sent you a claim decision',
File ArrayBuilderSummaryPage.jsx
has 461 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable react-hooks/exhaustive-deps */
/* eslint-disable react/sort-prop-types */
import React, { useEffect, useRef, useState } from 'react';
import { connect } from 'react-redux';
import { focusElement, scrollAndFocus } from 'platform/utilities/ui';
File actions.js
has 461 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
selectVAPResidentialAddress,
selectVAPEmailAddress,
selectVAPHomePhoneString,
selectVAPMobilePhoneString,
Function AppointmentListItem
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AppointmentListItem = props => {
const { appointment, goToDetails, router, app, page, count } = props;
const { t } = useTranslation();
const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
const { isMedicationReviewContentEnabled } = useSelector(
File labsAndTests.js
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { parseISO } from 'date-fns';
import { Actions } from '../util/actionTypes';
import {
concatObservationInterpretations,
dateFormatWithoutTimezone,
File index.unit.spec.js
has 459 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import MockDate from 'mockdate';
import { expect } from 'chai';
import moment from 'moment';
import { waitFor, within } from '@testing-library/dom';
Function PreSubmitSection
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function PreSubmitSection(props) {
const {
form,
preSubmit = {},
setPreSubmit,
Function render
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { schema, uiSchema, path, pageTitle, formContext } = this.props;
const uiOptions = uiSchema['ui:options'] || {};
const fieldName = path[path.length - 1];
Function render
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { schema, uiSchema, path, pageTitle, formContext } = this.props;
const uiOptions = uiSchema['ui:options'] || {};
const fieldName = path[path.length - 1];
Function content
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const content = () => {
if (!showRefillContent) {
return <PageNotFound />;
}
if (isLoading) {
File newAppointmentFlow.js
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { recordEvent } from '@department-of-veterans-affairs/platform-monitoring/exports';
import {
selectFeatureBreadcrumbUrlUpdate,
selectFeatureOHDirectSchedule,
selectFeatureOHRequest,
File helpers.jsx
has 457 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import {
CategoryEducation,
CategoryGuardianshipCustodianshipFiduciaryIssues,
File ProviderSortVariant.unit.spec.js
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import { expect } from 'chai';
import userEvent from '@testing-library/user-event';
import { within } from '@testing-library/react';
import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';
Function render
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { route, user } = this.props;
return (
<div className="schemaform-intro">
Function Error
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Error = () => {
const selectError = useMemo(makeSelectError, []);
const { error } = useSelector(selectError);
const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
// appt link will be /my-health/appointments if toggle is on