pankod/refine

View on GitHub

Showing 750 of 983 total issues

Function renderer has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

export const renderer = ({
  resource,
  fields,
  meta,
  isCustomPage,
Severity: Minor
Found in packages/inferencer/src/inferencers/antd/show.tsx - About 1 day to fix

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,
Severity: Minor
Found in packages/inferencer/src/inferencers/mui/show.tsx - About 1 day to fix

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,
Severity: Minor
Found in packages/inferencer/src/inferencers/headless/edit.tsx - About 1 day to fix

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 65 (exceeds 5 allowed). Consider refactoring.
Open

const dataProvider = (client: GraphQLClient): Required<DataProvider> => {
  return {
    getList: async ({ resource, pagination, sorters, filters, meta }) => {
      const operation = camelcase(resource);

Severity: Minor
Found in packages/nestjs-query/src/dataProvider/index.ts - About 1 day to fix

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 Monitor has 250 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const Monitor = () => {
  const { ws } = React.useContext(DevToolsContext);
  const [activities, setActivities] = React.useState<Activity[]>([]);
  const [searchParams] = useSearchParams();

Severity: Major
Found in packages/devtools-ui/src/pages/monitor.tsx - About 1 day to fix

    Function createActionWithResource has 234 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const createActionWithResource = async (resource: IResourceItem) => {
        const {
          name,
          label: deprecatedLabel,
          list,
    Severity: Major
    Found in packages/kbar/src/hooks/useRefineKbar/index.tsx - About 1 day to fix

      Function Edit has 230 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const Edit: React.FC<EditProps> = (props) => {
        const {
          children,
          resource: resourceFromProps,
          recordItemId,
      Severity: Major
      Found in packages/chakra-ui/src/components/crud/edit/index.tsx - About 1 day to fix

        Function ThemedSiderV2 has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
        Open

        export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
          Title: TitleFromProps,
          render,
          meta,
          activeItemDisabled = false,
        Severity: Minor
        Found in packages/mui/src/components/themedLayoutV2/sider/index.tsx - About 1 day to fix

        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 Show has 221 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const Show: React.FC<ShowProps> = (props) => {
          const {
            children,
            resource: resourceFromProps,
            recordItemId,
        Severity: Major
        Found in packages/chakra-ui/src/components/crud/show/index.tsx - About 1 day to fix

          Function Show has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
          Open

          export const Show: React.FC<ShowProps> = (props) => {
            const {
              children,
              resource: resourceFromProps,
              recordItemId,
          Severity: Minor
          Found in packages/chakra-ui/src/components/crud/show/index.tsx - About 1 day to fix

          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 Edit has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
          Open

          export const Edit: React.FC<EditProps> = (props) => {
            const {
              children,
              resource: resourceFromProps,
              recordItemId,
          Severity: Minor
          Found in packages/chakra-ui/src/components/crud/edit/index.tsx - About 1 day to fix

          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 ResourceComponent has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
          Open

          const ResourceComponent: React.FC<{ route: string }> = ({ route }) => {
            const { catchAll } = useRefineContext();
            const { useParams } = useRouterContext();
            const { resources } = useResource();
          
          
          Severity: Minor
          Found in packages/react-router-v6/src/legacy/routeProvider.tsx - About 1 day to fix

          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 ThemedSider has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
          Open

          export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
            Title: TitleFromProps,
            render,
            meta,
            isSiderOpen,
          Severity: Minor
          Found in packages/mui/src/components/themedLayout/sider/index.tsx - About 1 day to fix

          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 ?? {};
          
          
          Severity: Minor
          Found in packages/graphql/src/dataProvider/index.ts - About 1 day to fix

          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> = [];
          Severity: Major
          Found in packages/inferencer/src/use-relation-fetch/index.ts - About 1 day to fix

            Function dataProvider has 202 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 }) => {
            Severity: Major
            Found in packages/supabase/src/dataProvider/index.ts - About 1 day to fix

              Function useSelector has 200 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const useSelector = (active: boolean) => {
                const { devtoolsUrl } = React.useContext(DevToolsContext);
                const [traceItems, setTraceItems] = React.useState<string[]>([]);
              
                React.useEffect(() => {
              Severity: Major
              Found in packages/devtools/src/utilities/use-selector.tsx - About 1 day to fix

                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);
                Severity: Minor
                Found in packages/mantine/src/providers/notificationProvider.tsx - About 7 hrs to fix

                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 ThemedSiderV2 has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                Open

                export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
                  Title: TitleFromProps,
                  render,
                  meta,
                  activeItemDisabled = false,
                Severity: Minor
                Found in packages/chakra-ui/src/components/themedLayoutV2/sider/index.tsx - About 7 hrs to fix

                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 50 (exceeds 5 allowed). Consider refactoring.
                Open

                export const renderer = ({
                  resource,
                  fields,
                  meta,
                  isCustomPage,
                Severity: Minor
                Found in packages/inferencer/src/inferencers/headless/create.tsx - About 7 hrs to fix

                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

                Severity
                Category
                Status
                Source
                Language