Showing 580 of 800 total issues
Function renderer
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
export const renderer = ({
resource,
fields,
meta,
isCustomPage,
- 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 renderer
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
export const renderer = ({
resource,
fields,
meta,
isCustomPage,
- 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 dataProvider
has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring. Open
const dataProvider = (client: GraphQLClient): Required<DataProvider> => {
return {
getList: async ({ resource, pagination, sorters, filters, meta }) => {
const operation = camelcase(resource);
- 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 dataProvider
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
const dataProvider = (client: GraphQLClient): Required<DataProvider> => {
return {
getList: async ({ resource, pagination, sorters, filters, meta }) => {
const { current = 1, pageSize = 10, mode = "server" } = pagination ?? {};
- 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 resolver
has 206 lines of code (exceeds 25 allowed). Consider refactoring. Open
async (allFields: (InferField | false | null)[]) => {
console.groupCollapsed(
"@refinedev/inferencer is trying to detect relations",
);
const attempts: Array<ResourceInferenceAttempt> = [];
Function replaceImports
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
export const replaceImports = (content: string): string => {
const matches = content.matchAll(packageRegex);
const imports = new Set();
- 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 useNotificationProvider
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
export const useNotificationProvider = (): NotificationProvider => {
const activeNotifications: string[] = [];
const isNotificationActive = (key?: string) => {
return activeNotifications.includes(key as 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 dataProvider
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const dataProvider = (
supabaseClient: SupabaseClient<any, any, any>,
): Required<DataProvider> => {
return {
getList: async ({ resource, pagination, filters, sorters, meta }) => {
Function renderer
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
export const renderer = ({
resource,
fields,
meta,
isCustomPage,
- 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 objectInfer
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
export const objectInfer: FieldInferencer = (
key,
value,
record,
infer,
- 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 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables = {},
TData extends BaseRecord = TQueryFnData,
Function renderer
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
export const renderer = ({
resource,
fields,
meta,
isCustomPage,
- 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 46 (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 action
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
const action = async (_options: OptionValues) => {
inquirer.registerPrompt("autocomplete", inquirerAutoCompletePrompt);
const installedPackages = await getInstalledRefinePackagesFromNodeModules();
Function promises
has 175 lines of code (exceeds 25 allowed). Consider refactoring. Open
const promises = allFields.map(async (field) => {
if (field && (field.relation || field.canRelation)) {
if (record) {
if (field.relationInfer) {
return field;
Function fixDeprecatedReactTableProps
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fixDeprecatedReactTableProps = (j: JSCodeshift, source: Collection) => {
const refineReactTableImports = source.find(j.ImportDeclaration, {
source: {
value: "@pankod/refine-react-table",
},
Function Packages
has 169 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Packages = () => {
const ref = React.useRef<FireworksHandlers>(null);
const [packages, setPackages] = React.useState<PackageType[]>([]);
const [visible, setVisible] = React.useState(false);
const [outdatedPackages, setOutdatedPackages] = React.useState<string[]>([]);
Function createInferencer
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
export const createInferencer: CreateInferencer = ({
type,
additionalScope = [],
customElements = [],
fieldTransformers = [],
- 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 run
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
const run = async (
example: string | boolean | undefined,
destination?: string,
) => {
const pm = findPM();
Function renderer
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
export const renderer = ({
resource,
fields,
meta,
isCustomPage,
- 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"