I'm getting error in sonar for cognitive complexity, find my code and attached screenshot for more reference. Please help me to resolve this
useEffect(() => {
if (isFocused && isLoggedIn) {
getProfileData();
}
if (isFocused) {
dispatch(rewardsLandingScreenTracker());
}
}, [dispatch, getProfileData, isLoggedIn, isFocused]);
Can someone also update me what will be the solution in case of ternary operator like
const savedPrice =
(actualPrice ? getConvertedPrice(actualPrice) : 0) -
(proPrice ? getConvertedPrice(proPrice) : 0);

