pankod/refine

View on GitHub

Showing 756 of 987 total issues

Function subscribe has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    subscribe({ callback, params, meta }) {
      const { resource, subscriptionType } = params ?? {};

      if (!meta || !subscriptionType || !resource) {
        throw new Error(
Severity: Minor
Found in packages/nestjs-query/src/liveProvider/index.ts - About 1 hr to fix

    Function paginationProperties has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            (prop) => {
              const property = (
                p.node.arguments[0] as ObjectExpression
              ).properties.find(
                (p: Property) => (p.key as Identifier).name === prop,
    Severity: Minor
    Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 1 hr to fix

      Function useStepsForm has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const useStepsForm = <
        TQueryFnData extends BaseRecord = BaseRecord,
        TError extends HttpError = HttpError,
        TVariables = {},
        TData extends BaseRecord = TQueryFnData,
      Severity: Minor
      Found in packages/antd/src/hooks/form/useStepsForm/useStepsForm.ts - About 1 hr to fix

        Function getProjectInfo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const getProjectInfo = (path) => {
          // read package.json
          const pkg = fs.readFileSync(pathJoin(path, "package.json"), "utf8");
        
          // parse package.json
        Severity: Minor
        Found in .github/workflows/e2e-examples.js - About 1 hr to fix

          Function renderTreeView has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const renderTreeView = (tree: ITreeMenu[], selectedKey?: string) => {
              return tree.map((item) => {
                const { icon, label, route, name, children } = item;
          
                const isSelected = item.key === selectedKey;
          Severity: Minor
          Found in packages/mantine/src/components/themedLayout/sider/index.tsx - About 1 hr to fix

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

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

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

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

                Function gitInit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function gitInit(root: string, message: string) {
                  let didInit = false;
                
                  try {
                    execa.commandSync("git --version", { stdio: "ignore", cwd: root });
                Severity: Minor
                Found in packages/create-refine-app/src/example/git-init.ts - About 1 hr to fix

                  Function mergedImports has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      ([importPath, importMatches]) => {
                        // example: A
                        const defaultImport = importMatches.find(
                          (importMatch) => importMatch.defaultImport,
                        );
                  Severity: Minor
                  Found in packages/cli/src/utils/swizzle/import.ts - About 1 hr to fix

                    Function operatorMapper has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const operatorMapper = (
                      operator: CrudOperators,
                      value: any,
                    ): { [key: string]: any } => {
                      if (operator === "contains") {
                    Severity: Minor
                    Found in packages/nestjs-query/src/utils/index.ts - About 1 hr to fix

                      Function generateDefaultDocumentTitle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function generateDefaultDocumentTitle(
                        translate: ReturnType<typeof useTranslate>,
                        resource?: IResourceItem,
                        action?: string,
                        id?: string,

                        Function useCustomConfigSortToSorters has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const useCustomConfigSortToSorters = (j: JSCodeshift, source: Collection) => {
                          const useCustomHooks = source.find(j.CallExpression, {
                            callee: {
                              name: "useCustom",
                            },
                        Severity: Minor
                        Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 1 hr to fix

                          Function transform has 33 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/antd/refine.config.js - About 1 hr to fix

                            Function renderTreeView has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const renderTreeView = (tree: ITreeMenu[], selectedKey?: string) => {
                                return tree.map((item) => {
                                  const { icon, label, route, name, children } = item;
                            
                                  const isSelected = item.key === selectedKey;
                            Severity: Minor
                            Found in packages/mantine/src/components/layout/sider/index.tsx - About 1 hr to fix

                              Function renderProviders has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const renderProviders = () => {
                                  if (providers && providers.length > 0) {
                                    return (
                                      <>
                                        <Stack spacing={8}>

                                Function basicInputFields has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

                                  Function renderProviders has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    const renderProviders = () => {
                                      if (providers && providers.length > 0) {
                                        return (
                                          <>
                                            <Stack spacing={8}>

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

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

                                      Function getProjectType has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const getProjectType = (platform?: ProjectTypes): ProjectTypes => {
                                        if (platform) {
                                          return platform;
                                        }
                                        // read dependencies from package.json
                                      Severity: Minor
                                      Found in packages/cli/src/utils/project/index.ts - About 1 hr to fix

                                        Function createResourcePathWithAction has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export const createResourcePathWithAction = (
                                          resource: ResourceProps,
                                          action: Action,
                                        ) => {
                                          const { name, list, create, show, edit } = resource;
                                        Severity: Minor
                                        Found in packages/react-router-v6/src/create-resource-routes.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language