Showing 756 of 987 total issues
Function ConfigErrorPage
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ConfigErrorPage = () => {
return (
<div
style={{
position: "fixed",
Function renderRelationFields
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = `${getVariableName(field.key, "Data")}?.data`;
const variableIsLoading = getVariableName(field.key, "IsLoading");
Function renderRelationFields
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = getVariableName(field.key, "Data");
const variableIsLoading = getVariableName(field.key, "IsLoading");
Function LoginForm
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LoginForm = (props: { className?: string }) => {
const { ws } = React.useContext(DevToolsContext);
const [searchParams] = useSearchParams();
const [flowData, setFlowData] = React.useState<LoginFlow | null>(null);
Function useSimpleList
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const useSimpleList = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TSearchVariables = unknown,
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 useModalForm
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const useModalForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables extends FieldValues = FieldValues,
TContext extends object = {},
- 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 renderRelationFields
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = `${getVariableName(field.key, "Data")}?.data`;
if (Array.isArray(field.accessor)) {
Function reorderImports
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const reorderImports = (content: string): string => {
let newContent = content;
// imports can have comments before them, we need to preserve those comments and import statements.
// so we need to filter out the imports with comments before.
const allImports = getImports(content);
Function renderRelationFields
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = `${getVariableName(field.key, "Data")}?.data`;
if (Array.isArray(field.accessor)) {
Function List
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const List: React.FC<ListProps> = (props) => {
const {
canCreate,
children,
createButtonProps: createButtonPropsFromProps,
Function useModalForm
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export const useModalForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables = {},
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 Create
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export const Create: React.FC<CreateProps> = (props) => {
const {
children,
saveButtonProps: saveButtonPropsFromProps,
isLoading,
- 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 checkPackage
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export const checkPackage = (code = "") => {
const set = new Set<string>();
const hasAntd =
code.includes("@refinedev/antd") ||
- 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 useTable
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export function useTable<
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 useForgotPassword
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export function useForgotPassword<TVariables = {}>({
v3LegacyAuthProviderCompatible,
mutationOptions,
}:
| UseForgotPasswordProps<TVariables>
- 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 LoginPage
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const LoginPage: React.FC<LoginPageProps> = () => {
const [form] = Form.useForm<ILoginForm>();
const translate = useTranslate();
const authProvider = useActiveAuthProvider();
Function renderCrud
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderCrud = () => {
switch (action) {
case undefined:
return (
<CanAccess
Function useModalForm
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const useModalForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables = Record<string, unknown>,
TTransformed = TVariables,
- 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 useForm
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const useForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables = {},
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 useDrawerForm
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const useDrawerForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables = {},
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"