Javascript – How to refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed?
when I add this check: card.targetUrl !== "/test" I get this error and I cannot commit, how do I reduce this complexity? const link = useMemo(() => { if (!card?.targetUrl || card.targetUrl === "/test") { return "/account"; } else {…