pankod/refine

View on GitHub

Showing 580 of 800 total issues

Function editUrl has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const editUrl = (
    resource: string | IResourceItem,
    id: BaseKey,
    meta: MetaDataQuery = {},
  ) => {
Severity: Minor
Found in packages/core/src/hooks/navigation/index.ts - About 1 hr to fix

    Function cloneUrl has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const cloneUrl = (
        resource: string | IResourceItem,
        id: BaseKey,
        meta: MetaDataQuery = {},
      ) => {
    Severity: Minor
    Found in packages/core/src/hooks/navigation/index.ts - About 1 hr to fix

      Function showUrl has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const showUrl = (
          resource: string | IResourceItem,
          id: BaseKey,
          meta: MetaDataQuery = {},
        ) => {
      Severity: Minor
      Found in packages/core/src/hooks/navigation/index.ts - About 1 hr to fix

        Function useNotificationProvider has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        export const useNotificationProvider = (): NotificationProvider => {
          const toast = useToast({
            position: "top-right",
            isClosable: true,
          });
        Severity: Minor
        Found in packages/chakra-ui/src/providers/notificationProvider.tsx - About 1 hr 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 getOperation has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        export const getOperation = (
          req: CyHttpMessages.IncomingHttpRequest,
        ): Operation | null => {
          const query = req.body.query as string;
        
        
        Severity: Minor
        Found in cypress/support/commands/intercepts/hasura.ts - About 1 hr 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 printSwizzleMessage has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        export const printSwizzleMessage = ({
          label,
          files,
          message = "**`Warning:`** You should use the component where you want to use it.",
        }: Params) => {
        Severity: Minor
        Found in packages/cli/src/components/swizzle-message/index.tsx - About 1 hr 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 useRedirectionAfterSubmission has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

          () => {
            const { show, edit, list, create } = useNavigation();
        
            const handleSubmitWithRedirect = useCallback(
              ({
        Severity: Minor
        Found in packages/core/src/hooks/redirection/index.ts - About 1 hr 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 basicToRelation has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const basicToRelation: FieldTransformer = (
          fields,
          resources,
          resource,
          record,
        Severity: Minor
        Found in packages/inferencer/src/field-transformers/basic-to-relation.ts - About 1 hr to fix

          Function renameUseTableQueryResult has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const renameUseTableQueryResult = (
            j: JSCodeshift,
            source: Collection,
          ) => {
            const renameProperties = (prop) => {

            Function imageFields has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const imageFields = (field: InferField) => {
                if (field.type === "image") {
                  if (field.multiple) {
                    const val = accessor("item", undefined, field.accessor);
                    return jsx`
            Severity: Minor
            Found in packages/inferencer/src/inferencers/headless/show.tsx - About 1 hr to fix

              Function booleanFields has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const booleanFields = (field: InferField) => {
                  if (field.type === "boolean") {
                    imports.push(["BooleanField", "@refinedev/mui"]);
              
                    if (field.multiple) {
              Severity: Minor
              Found in packages/inferencer/src/inferencers/mui/show.tsx - About 1 hr to fix

                Function emailFields has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const emailFields = (field: InferField) => {
                    if (field.type === "email") {
                      imports.push(["EmailField", "@refinedev/mui"]);
                
                      if (field.multiple) {
                Severity: Minor
                Found in packages/inferencer/src/inferencers/mui/show.tsx - About 1 hr to fix

                  Function getInstalledRefinePackagesFromNodeModules has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const getInstalledRefinePackagesFromNodeModules = async () => {
                    const REFINE_PACKAGES = ["core"];
                  
                    try {
                      const packagesFromGlobbySearch = await globby("node_modules/@refinedev/*", {
                  Severity: Minor
                  Found in packages/cli/src/utils/package/index.ts - About 1 hr to fix

                    Function urlFields has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const urlFields = (field: InferField) => {
                        if (field.type === "url") {
                          imports.push(["UrlField", "@refinedev/mui"]);
                    
                          if (field.multiple) {
                    Severity: Minor
                    Found in packages/inferencer/src/inferencers/mui/show.tsx - About 1 hr to fix

                      Function addOrUpdateImports has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const addOrUpdateImports = (
                        j: JSCodeshift,
                        source: Collection,
                        importPath: string,
                        importIdentifierNames: string[],
                      Severity: Minor
                      Found in packages/cli/src/utils/codeshift/index.ts - About 1 hr to fix

                        Function numberFields has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const numberFields = (field: InferField) => {
                            if (field.type === "number") {
                              imports.push(["NumberField", "@refinedev/mui"]);
                        
                              if (field.multiple) {
                        Severity: Minor
                        Found in packages/inferencer/src/inferencers/mui/show.tsx - About 1 hr to fix

                          Function liveProvider has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const liveProvider = (client: Ably.Realtime): LiveProvider => {
                            return {
                              subscribe: ({ channel, types, params, callback }) => {
                                const channelInstance = client.channels.get(channel);
                          
                          
                          Severity: Minor
                          Found in packages/ably/src/index.ts - About 1 hr to fix

                            Function relationHooksCode has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                .map((field) => {
                                  if (field?.relation && !field.fieldable && field.resource) {
                                    imports.push(["useMany", "@refinedev/core"]);
                            
                                    let idsString = "";
                            Severity: Minor
                            Found in packages/inferencer/src/inferencers/antd/list.tsx - About 1 hr to fix

                              Function booleanFields has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const booleanFields = (field: InferField) => {
                                  if (field.type === "boolean") {
                                    imports.push(["BooleanField", "@refinedev/mantine"]);
                              
                                    if (field.multiple) {
                              Severity: Minor
                              Found in packages/inferencer/src/inferencers/mantine/show.tsx - About 1 hr to fix

                                Function urlFields has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  const urlFields = (field: InferField) => {
                                    if (field.type === "url") {
                                      imports.push(["UrlField", "@refinedev/mantine"]);
                                
                                      if (field.multiple) {
                                Severity: Minor
                                Found in packages/inferencer/src/inferencers/mantine/show.tsx - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language