Showing 580 of 800 total issues
Function renderRelationFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
imports.push(["Select", "antd"]);
const variableName = getVariableName(field.key, "SelectProps");
Function imageFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const imageFields = (field: InferField) => {
if (field.type === "image") {
imports.push(
["Upload", "antd"],
["getValueFromEvent", "@refinedev/antd"],
Function imageFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const imageFields = (field: InferField) => {
if (field.type === "image") {
imports.push(
["Upload", "antd"],
["getValueFromEvent", "@refinedev/antd"],
Function dateFields
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
imports.push(["DatePicker", "antd"], ["dayjs", "dayjs", true]);
if (field.multiple) {
Function booleanFields
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(["Checkbox", "antd"]);
if (field.multiple) {
Function Feed
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Feed = () => {
const [feed, setFeed] = React.useState<FeedType | null>(null);
const fetchFeed = React.useCallback(async () => {
try {
Function addV3LegacyAuthProviderCompatibleTrueToAuthHooks
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addV3LegacyAuthProviderCompatibleTrueToAuthHooks = (
j: JSCodeshift,
root: Collection<any>,
) => {
const authHooks = root.find(j.CallExpression, {
Function basicFields
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicFields = (field: InferField) => {
if (field && (field.type === "text" || field.type === "number")) {
const id = `id: "${field.key}"`;
const accessorKey = getAccessorKey(field);
const header = `header: ${translatePrettyString({
Function emailFields
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emailFields = (field: InferField) => {
if (field.type === "email") {
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
return jsx`
Function basicFields
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicFields = (field: InferField) => {
if (field && (field.type === "text" || field.type === "number")) {
const id = `id: "${field.key}"`;
const accessorKey = getAccessorKey(field);
const header = `header: ${translatePrettyString({
Function urlFields
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const urlFields = (field: InferField) => {
if (field.type === "url") {
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
return jsx`
Function useTelemetryData
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useTelemetryData = (): ITelemetryData => {
const auth = useIsExistAuthentication();
const auditLogContext = useContext(AuditLogContext);
const { liveProvider } = useContext(LiveContext);
const routerContext = useContext(LegacyRouterContext);
Function replaceImports
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const replaceImports = (
content: string,
modules: Record<string, string> = {},
): string => {
const matches = content.matchAll(packageRegex);
- 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 useCode
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const useCode = (): UseCodeReturn => {
const { query, isReady } = useRouter();
const {
code: encoded,
hash,
- 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 Refine
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const Refine: React.FC<RefineProps> = ({
legacyAuthProvider,
authProvider,
dataProvider,
legacyRouterProvider,
- 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 liveProvider
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const liveProvider = (client: Ably.Realtime): LiveProvider => {
return {
subscribe: ({ channel, types, params, callback }) => {
const channelInstance = client.channels.get(channel);
- 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 urlFields
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const urlFields = (field: InferField) => {
if (field.type === "url") {
imports.push(["UrlField", "@refinedev/mantine"]);
const id = `id: "${field.key}"`;
Function emailFields
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emailFields = (field: InferField) => {
if (field.type === "email") {
imports.push(["EmailField", "@refinedev/mantine"]);
const id = `id: "${field.key}"`;
Function dateFields
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
const id = `id: "${field.key}"`;
const accessorKey = getAccessorKey(field);
const header = `header: ${translatePrettyString({
Function emailFields
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emailFields = (field: InferField) => {
if (field.type === "email") {
imports.push(["EmailField", "@refinedev/chakra-ui"]);
const id = `id: "${field.key}"`;