Function AdminSidebar
has 397 lines of code (exceeds 300 allowed). Consider refactoring.
export const AdminSidebar: FC = () => {
const { data: session } = useSession();
const user = session?.user;
return (
File AdminSidebar.tsx
has 402 lines of code (exceeds 300 allowed). Consider refactoring.
import { useSession } from 'next-auth/react';
import type { FC } from 'react';
import { TextAvatar } from '@/components/avatar/TextAvatar';
export const AdminSidebar: FC = () => {
File PoemSeeds.ts
has 312 lines of code (exceeds 300 allowed). Consider refactoring.
import keywordExtractor from 'keyword-extractor';
import { slugify } from 'transliteration';
import type { PrismaDbMain as Prisma } from '..';
import { AbstractSeed } from '../lib/AbstractSeed';
Function usePromise
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
export function usePromise<
TResult,
TVariables extends Record<string, unknown> = Partial<Record<string, unknown>>,
>(
promise: AsyncFn<TResult, TVariables>,
Function assertIncludes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
export function assertIncludes<T extends string[]>(
v: string | undefined,
stringArray: T,
msgOrErrorFactory?: MsgOrErrorFactory,
insensitive = false
Function getDevSafeInstance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
static getDevSafeInstance(
instanceKey: string,
prismaClientFactory: () => PrismaClient
): PrismaClient {
if (process.env.NODE_ENV === 'production') {
Function stringToFloat
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
export function stringToFloat(value: unknown): number | null {
if (
!isParsableNumeric(
typeof value === 'number' ? value.toString(10) : (value ?? '')
)