Function useFocusTrap
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
export const useFocusTrap = (
ref: { current: null | HTMLElement },
isOpen: boolean,
) => {
useEffect(() => {
Function resolveElement
has 35 lines of code (exceeds 25 allowed). Consider refactoring.
const resolveElement = () => {
if (element) {
return (
<div
id={elementId}
Function useFocusTrap
has 33 lines of code (exceeds 25 allowed). Consider refactoring.
export const useFocusTrap = (
ref: { current: null | HTMLElement },
isOpen: boolean,
) => {
useEffect(() => {
Function Toast
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
export const Toast = ({ alert, notice, appendDashboardClass }: Props): Node => {
const [showAlert, setShowAlert] = useState<boolean>(
alert !== null
&& alert !== ''
&& !document.documentElement?.hasAttribute('data-turbolinks-preview'),
Method page_title
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
def page_title
t('app_name') +
if sign_in_path?
' | ' + t('account.sign_in')
elsif join_path?