Showing 750 of 983 total issues
Function imageFields
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const imageFields = (field: InferField) => {
if (field.type === "image") {
imports.push(["Image", "@chakra-ui/react"]);
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
Function dateFields
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
imports.push(["DateField", "@refinedev/chakra-ui"]);
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
Function useButtonCanAccess
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useButtonCanAccess = (
props: ButtonCanAccessProps,
): ButtonCanAccessValues => {
const translate = useTranslate();
const accessControlContext = React.useContext(AccessControlContext);
Function updateRefineImports
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function updateRefineImports(j: JSCodeshift, root: Collection<any>) {
const refineCoreImports = root.find(j.ImportDeclaration, {
source: {
value: "@pankod/refine-core",
},
- 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 RefineRoutes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const RefineRoutes = ({ children }: RefineRoutesProps) => {
const { resource, action } = useResource();
const { asPath: pathname, isReady } = useRouter();
if (!isReady) {
- 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 useImport
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const useImport = <
TItem = any,
TData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables = any,
- 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 RefineRoutes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const RefineRoutes = ({ children }: RefineRoutesProps) => {
const { resource, action } = useResource();
const pathname = usePathname();
const resourceAction = resource && action ? resource[action] : undefined;
- 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 transformRefineOptions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const transformRefineOptions = (
j: JSCodeshift,
root: Collection<any>,
projectId: string,
) => {
- 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 ForgotPasswordPage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const ForgotPasswordPage: React.FC<ResetPassworProps> = ({
loginLink,
contentProps,
wrapperProps,
renderContent,
- 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 ResizablePane
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const ResizablePane = ({ placement, visible, children }: Props) => {
const [hover, setHover] = React.useState(false);
const [resizing, setResizing] = React.useState<
"lx" | "rx" | "ty" | "by" | null
>(null);
- 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 MonitorDetails
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const MonitorDetails = ({ activity }: { activity?: Activity }) => {
return (
<div className={clsx("re-h-full", "re-text-gray-300", "re-relative")}>
<div
className={clsx(
- 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 normalizeData
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const normalizeData = (data: any): any => {
if (Array.isArray(data)) {
return data.map((item) => normalizeData(item));
}
- 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 RefineRoutes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const RefineRoutes = ({ children }: RefineRoutesProps) => {
const { resource, action } = useResource();
const { pathname } = useLocation();
const resourceAction = resource && action ? resource[action] : undefined;
- 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 useDataProvider
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const useDataProvider = (): ((
/**
* The name of the `data provider` you want to access
*/
dataProviderName?: string,
- 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 useResourceParams
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function useResourceParams(props?: Props): ResourceParams {
const { select, identifier: inferredIdentifier } = useResource();
const resourceToCheck = props?.resource ?? inferredIdentifier;
const { identifier = undefined, resource = undefined } = resourceToCheck
? select(resourceToCheck, true)
- 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 LegacyAuthContextProvider
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
> = ({ children, isProvided, ...authOperations }) => {
const { replace } = useNavigation();
const loginFunc = async (params: any) => {
try {
- 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 useOne
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const useOne = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TData extends BaseRecord = TQueryFnData,
>({
- 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 useLog
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const useLog = <
TLogData,
TLogRenameData extends LogRenameData = LogRenameData,
>({
logMutationOptions,
- 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 emailFields
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emailFields = (field: InferField) => {
if (field.type === "email") {
imports.push(
["TagField", "@refinedev/antd"],
["EmailField", "@refinedev/antd"],
Function useQuerySubscription
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
: (queryClient: QueryClient) => {
const { ws } = useContext(DevToolsContext);
const queryCacheSubscription = React.useRef<() => void>();
const mutationCacheSubscription = React.useRef<() => void>();