Showing 3,724 of 12,675 total issues
Function Edit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const Edit = () => {
const dispatch = useDispatch();
const history = useHistory();
const query = useQuery();
- 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 NotificationCheckbox
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const NotificationCheckbox = ({
channelId,
label,
isOptedIn,
onValueChange,
- 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 fetchNotifications
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const fetchNotifications = () => async dispatch => {
const getNotifications = () => {
const options = {
method: 'GET',
credentials: 'include',
- 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 ViewDependentsList
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function ViewDependentsList(props) {
let mainContent;
const manageDependentsToggle = props?.manageDependentsToggle ?? null;
if (props.loading) {
mainContent = (
- 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 mapStateToProps
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const mapStateToProps = state => {
const togglesLoaded = togglesAreLoaded(state);
const profileToggles = selectProfileToggles(state);
const signInServicesEligibleForDD = new Set([
CSP_IDS.ID_ME,
- 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 IconCTALink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const IconCTALink = ({
ariaLabel,
href,
text,
// icon should be a valid Font Awesome 5 icon name
- 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 ConditionDetails
has a Cognitive Complexity of 8 (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,
- 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 DownloadRecordsPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const DownloadRecordsPage = ({ runningUnitTest }) => {
const dispatch = useDispatch();
const user = useSelector(state => state.user.profile);
const name = formatName(user.userFullName);
const dob = formatDateLong(user.dob);
- 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 buildPrescriptionsPDFList
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const buildPrescriptionsPDFList = prescriptions => {
return prescriptions?.map(rx => {
if (rx?.prescriptionSource === 'NV') {
return {
...buildNonVAPrescriptionPDFList(rx)[0],
- 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 FillRefillButton
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const FillRefillButton = rx => {
const dispatch = useDispatch();
const { dispensedDate, error, prescriptionId, success, isRefillable } = rx;
- 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 PrescriptionsPrintOnly
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const PrescriptionsPrintOnly = ({ list, hasError = false }) => {
const { search } = useLocation();
const allergies = useSelector(state => state.rx.allergies.allergiesList);
const selectedSortOption = useSelector(
state => state.rx.prescriptions.selectedSortOption,
- 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 buildVAPrescriptionTXT
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const buildVAPrescriptionTXT = prescription => {
const refillHistory = [...(prescription?.rxRfRecords || [])];
const originalFill = createOriginalFillRecord(prescription);
refillHistory.push(originalFill);
- 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
Consider simplifying this complex logical expression. Open
if (errorEl) {
// document.body.scrollTop doesn’t work with all browsers, so we’ll cover them all like so:
const currentPosition =
window.pageYOffset ||
document.documentElement.scrollTop ||
Consider simplifying this complex logical expression. Open
if (typeof fromOptions === 'object' && typeof toOptions === 'object') {
// Extract custom options
fromLabel = fromOptions.title || fromLabel;
toLabel = toOptions.title || toLabel;
fromCustomOptions = { ...fromOptions };
Consider simplifying this complex logical expression. Open
if (!errorExists(processedErrors, propertyName, index)) {
const { chapterKey = '', pageKey = '' } =
reviewErrors._override?.(property || err?.stack || argument) ||
getPropertyInfo(
// List of all form pages; includes chapterKey, pageKey and
Consider simplifying this complex logical expression. Open
if (
!value ||
isNaN(value) ||
isNaN(string) ||
// ignore fractions
Consider simplifying this complex logical expression. Open
if (
(uiSchema &&
schema?.properties &&
isMaxItemsReached &&
props.data[hasItemsKey] !== false) ||
Consider simplifying this complex logical expression. Open
if (errorEl) {
// document.body.scrollTop doesn’t work with all browsers, so we’ll cover them all like so:
const currentPosition =
window.pageYOffset ||
document.documentElement.scrollTop ||
Consider simplifying this complex logical expression. Open
if (
sanitizedOperatingHours.search(/ByAppointmentOnly/i) === 0 ||
sanitizedOperatingHours.search(/AppointmentsOnly/i) === 0 ||
sanitizedOperatingHours.search(/PleaseCallforHours/i) === 0 ||
sanitizedOperatingHours.search(
Consider simplifying this complex logical expression. Open
if (
(formattedOpeningHour.search(/Invalid date/i) !== 0 &&
formattedClosingHour.search(/Invalid date/i) !== 0) ||
(formattedOpeningHour.search(/Invalid date/i) !== 0 &&
formattedClosingHour.search(/Invalid date/i) === 0) ||