pankod/refine

View on GitHub

Showing 750 of 983 total issues

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

          const getProjectInfo = async (path) => {
            // read package.json
            const pkg = await promisify(fs.readFile)(
              pathJoin(path, "package.json"),
              "utf8",
          Severity: Minor
          Found in .github/workflows/e2e-examples.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 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 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 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 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

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

                            export const mapAntdSorterToCrudSorting = (
                              sorter: SorterResult | SorterResult[],
                            ): CrudSorting => {
                              const crudSorting: CrudSorting = [];
                              if (Array.isArray(sorter)) {
                            Severity: Minor
                            Found in packages/antd/src/definitions/table/index.ts - About 1 hr to fix

                              Function itemRender has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      itemRender: (page, type, element) => {
                                        const link = createLinkForSyncWithLocation({
                                          pagination: {
                                            pageSize,
                                            current: page,
                              Severity: Minor
                              Found in packages/antd/src/hooks/table/useTable/useTable.ts - About 1 hr to fix

                                Function itemRender has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        itemRender: (page, type, element) => {
                                          const link = createLinkForSyncWithLocation({
                                            pagination: {
                                              pageSize,
                                              current: page,
                                Severity: Minor
                                Found in packages/antd/src/hooks/list/useSimpleList/useSimpleList.ts - About 1 hr to fix

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

                                        (prop) => {
                                          const property = (
                                            (hasRefineCoreProps as ObjectProperty).value 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 imageFields has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      const imageFields = (field: InferField) => {
                                        if (field.type === "image") {
                                          imports.push(["ImageField", "@refinedev/antd"]);
                                          if (field.multiple) {
                                            const val = accessor("item", undefined, field.accessor);
                                    Severity: Minor
                                    Found in packages/inferencer/src/inferencers/antd/show.tsx - About 1 hr to fix

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

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

                                        Function dateFields has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          const dateFields = (field: InferField) => {
                                            if (field.type === "date") {
                                              imports.push(["DateField", "@refinedev/antd"]);
                                              if (field.multiple) {
                                                const val = accessor("item", undefined, field.accessor);
                                        Severity: Minor
                                        Found in packages/inferencer/src/inferencers/antd/show.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language