pankod/refine

View on GitHub

Showing 750 of 983 total issues

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

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

    Function printImports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const printImports = (imports: Array<ImportElement>) => {
      const byModule = imports.reduce(
        (acc, [element, module, isDefault]) => {
          if (!acc[module]) {
            acc[module] = [] as Array<
    Severity: Minor
    Found in packages/inferencer/src/utilities/print-imports/index.ts - About 1 hr to fix

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

        const booleanFields = (field: InferField) => {
          if (field.type === "boolean") {
            if (field.multiple) {
              return undefined;
            }
      Severity: Minor
      Found in packages/inferencer/src/inferencers/headless/create.tsx - About 1 hr to fix

        Function printFiles has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const printFiles = () => {
            const chalks = [];
        
            chalks.push(chalk.dim(`File${files.length > 1 ? "s" : ""} created:`));
            chalks.push(
        Severity: Minor
        Found in packages/cli/src/components/swizzle-message/index.tsx - About 1 hr to fix

          Function useGo has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const useGo = () => {
            const routerContext = useContext(RouterContext);
            const { select: resourceSelect } = useResource();
            const getToPath = useGetToPath();
          
          
          Severity: Minor
          Found in packages/core/src/hooks/router/use-go/index.tsx - About 1 hr to fix

            Function useGetToPath has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const useGetToPath = (): GetToPathFn => {
              const routerType = useRouterType();
              const { resource: resourceFromRoute, resources } = useResource();
              const parsed = useParsed();
            
            
            Severity: Minor
            Found in packages/core/src/hooks/router/use-get-to-path/index.ts - About 1 hr to fix

              Function deletePromise has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      (resolve, reject) => {
                        const doMutation = () => {
                          dataProvider(
                            pickDataProvider(identifier, dataProviderName, resources),
                          )
              Severity: Minor
              Found in packages/core/src/hooks/data/useDelete.ts - About 1 hr to fix

                Function useResourceParams has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function useResourceParams(props?: Props): ResourceParams {
                  const { select, identifier: inferredIdentifier } = useResource();
                  const resourceToCheck = props?.resource ?? inferredIdentifier;
                  const { identifier = undefined, resource = undefined } = resourceToCheck
                    ? select(resourceToCheck, true)
                Severity: Minor
                Found in packages/core/src/hooks/use-resource-params/index.ts - About 1 hr to fix

                  Function updatePromise has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          (resolve, reject) => {
                            const doMutation = () => {
                              dataProvider(
                                pickDataProvider(identifier, dataProviderName, resources),
                              )
                  Severity: Minor
                  Found in packages/core/src/hooks/data/useUpdate.ts - About 1 hr to fix

                    Function queryKeys has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const queryKeys = (
                      resource?: string,
                      dataProviderName?: string,
                      meta?: MetaQuery,
                      /**
                    Severity: Minor
                    Found in packages/core/src/definitions/helpers/queryKeys/index.ts - About 1 hr to fix

                      Function assertDocumentTitle has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const assertDocumentTitle = (resource: string, action?: IAction) => {
                        switch (action) {
                          case "list":
                            cy.document()
                              .its("title")
                      Severity: Minor
                      Found in cypress/support/commands/document-title-handler.ts - About 1 hr to fix

                        Function textFields has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const textFields = (field: InferField) => {
                            if (
                              field.type === "text" ||
                              field.type === "email" ||
                              field.type === "date" ||
                        Severity: Minor
                        Found in packages/inferencer/src/inferencers/mantine/create.tsx - About 1 hr to fix

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

                              .map((field) => {
                                if (field?.relation && !field.fieldable && field.resource) {
                                  imports.push(["useAutocomplete", "@refinedev/mui"]);
                                  let val = accessor(recordName, field.key, field.accessor, false);
                          
                          
                          Severity: Minor
                          Found in packages/inferencer/src/inferencers/mui/edit.tsx - About 1 hr to fix

                            Function generateFilter has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const generateFilter = (filters?: CrudFilters) => {
                              let rawQuery = "";
                            
                              if (filters) {
                                filters.map((filter) => {
                            Severity: Minor
                            Found in packages/strapi/src/dataProvider.ts - About 1 hr to fix

                              Function UnsavedPrompt has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const UnsavedPrompt: React.FC = () => {
                                const { Prompt } = useRouterContext();
                              
                                const translate = useTranslate();
                              
                              
                              Severity: Minor
                              Found in packages/core/src/components/layoutWrapper/index.tsx - About 1 hr to fix

                                Function useRefreshButton has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function useRefreshButton(
                                  props: RefreshButtonProps,
                                ): RefreshButtonValues {
                                  const translate = useTranslate();
                                  const { keys, preferLegacyKeys } = useKeys();
                                Severity: Minor
                                Found in packages/core/src/hooks/button/refresh-button/index.tsx - About 1 hr to fix

                                  Function useRedirectionAfterSubmission has 30 lines of code (exceeds 25 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

                                    Function transform has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        transform: (content) => {
                                          let newContent = content;
                                          const imports = getImports(content);
                                    
                                          imports.map((importItem) => {
                                    Severity: Minor
                                    Found in packages/core/refine.config.js - About 1 hr to fix

                                      Function transform has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          transform: (content) => {
                                            let newContent = content;
                                            const imports = getImports(content);
                                      
                                            imports.map((importItem) => {
                                      Severity: Minor
                                      Found in packages/mantine/refine.config.js - About 1 hr to fix

                                        Function setup has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                              setup: (build) => {
                                                if (build.initialOptions.format === "cjs") {
                                                  return;
                                                }
                                                if (build.initialOptions.format === "esm") {
                                        Severity: Minor
                                        Found in packages/antd/tsup.config.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language