pankod/refine

View on GitHub

Showing 812 of 823 total issues

Function buildFilters has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const buildFilters = (filters: LogicalFilter[] | CrudFilter[] = []) => {
  const result: { [key: string]: { [key: string]: string | number } } = {};

  filters
    .filter((f) => {
Severity: Minor
Found in packages/graphql/src/utils/getListHelpers.ts - About 1 hr to fix

    Function addColumnsToUseDataGrid has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const addColumnsToUseDataGrid = (j: JSCodeshift, root: Collection<any>) => {
      const dataGridElement = root.find(j.JSXElement, {
        openingElement: {
          name: {
            name: "DataGrid",
    Severity: Minor
    Found in packages/codemod/src/transformations/use-data-grid-columns.ts - About 1 hr to fix

      Function getMetaProps has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const getMetaProps = (
        identifier?: string,
        meta?: InferencerComponentProps["meta"],
        actions?: Action[],
      ) => {
      Severity: Minor
      Found in packages/inferencer/src/utilities/get-meta-props/index.ts - About 1 hr to fix

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

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

          Function richtextFields has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const richtextFields = (field: InferField) => {
              if (field?.type === "richtext") {
                imports.push(["MarkdownField", "@refinedev/antd"]);
          
                const dataIndex =
          Severity: Minor
          Found in packages/inferencer/src/inferencers/antd/list.tsx - About 1 hr to fix

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

              const dateFields = (field: InferField) => {
                if (field.type === "date") {
                  imports.push(["DatePicker", "antd"], ["dayjs", "dayjs", true]);
            
                  if (field.multiple) {
            Severity: Minor
            Found in packages/inferencer/src/inferencers/antd/create.tsx - About 1 hr to fix

              Function mapOperator has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const mapOperator = (operator: CrudOperators) => {
                switch (operator) {
                  case "ne":
                    return "neq";
                  case "nin":
              Severity: Minor
              Found in packages/supabase/src/utils/mapOperator.ts - About 1 hr to fix

                Function createResourceRoutes has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const createResourceRoutes = (resources: ResourceProps[]) => {
                  const routes = resources.flatMap((resource) => {
                    const actions: {
                      action: Action;
                      element: React.ComponentType<any>;
                Severity: Minor
                Found in packages/react-router-v6/src/create-resource-routes.tsx - About 1 hr to fix

                  Function handleMouseMove has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      const handleMouseMove = (e: MouseEvent) => {
                        if (resizing?.[1] === "x") {
                          const diff = e.clientX - (resizePosition?.x ?? e.clientX);
                          const newWidth =
                            panelSize.width + (resizing === "lx" ? -diff : diff) * 2;
                  Severity: Minor
                  Found in packages/devtools/src/components/resizable-pane.tsx - About 1 hr to fix

                    Function createTreeView has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const createTreeView = (
                      resources: IResourceItem[] | IMenuItem[],
                    ): ITreeMenu[] | ITreeMenu[] => {
                      const tree = [];
                      const resourcesRouteObject: { [key: string]: any } = {};

                      Function generateFilters has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const generateFilters = (filters: LogicalFilter[]) => {
                        const result: { [key: string]: { [key: string]: string | number } } = {};
                      
                        filters
                          .filter((f) => {
                      Severity: Minor
                      Found in packages/nestjs-query/src/utils/index.ts - About 1 hr to fix

                        Function promptInteractiveRefineUpdate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const promptInteractiveRefineUpdate = async (
                          packages: RefinePackageInstalledVersionData[],
                        ) => {
                          const uiGroup = createUIGroup(packages);
                          if (!uiGroup) {
                        Severity: Minor
                        Found in packages/cli/src/commands/update/interactive/index.ts - About 1 hr to fix

                          Function getRunnerDescription has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const getRunnerDescription = (runner: "dev" | "start" | "build") => {
                            let projectType = getProjectType();
                          
                            let command: string[] = [];
                            switch (runner) {
                          Severity: Minor
                          Found in packages/cli/src/commands/runner/utils/index.ts - About 1 hr to fix

                            Function Header has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const Header: React.FC<RefineLayoutHeaderProps> = () => {
                              const authProvider = useActiveAuthProvider();
                              const { data: user } = useGetIdentity({
                                v3LegacyAuthProviderCompatible: Boolean(authProvider?.isLegacy),
                              });
                            Severity: Minor
                            Found in packages/mui/src/components/layout/header/index.tsx - About 1 hr to fix

                              Function asyncDebounce has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const asyncDebounce = <T extends (...args: any[]) => any>(
                                func: T,
                                wait = 1000,
                                cancelReason?: string,
                              ): DebouncedFunction<T> => {
                              Severity: Minor
                              Found in packages/core/src/definitions/helpers/async-debounce/index.ts - About 1 hr to fix

                                Function flattenObjectKeys has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export const flattenObjectKeys = (obj: any, prefix = "") => {
                                  if (!isNested(obj)) {
                                    return {
                                      [prefix]: obj,
                                    };
                                Severity: Minor
                                Found in packages/core/src/definitions/helpers/flatten-object-keys/index.ts - About 1 hr to fix

                                  Function updateSetEditIdToSetId has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const updateSetEditIdToSetId = (j: JSCodeshift, root: Collection<any>) => {
                                    const updatedFormHooks = [
                                      "useEditableTable",
                                      "useModalForm",
                                      "useDrawerForm",
                                  Severity: Minor
                                  Found in packages/codemod/src/transformations/refine2-to-refine3.ts - About 1 hr to fix

                                    Function getInstalledPackageJSONPath has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const getInstalledPackageJSONPath = async (packageName: string) => {
                                      try {
                                        const filesFromGlobbySearch = await globby(
                                          `node_modules/${packageName}/package.json`,
                                          {

                                      Function updateActionButtonsPropstoHeaderButtons has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const updateActionButtonsPropstoHeaderButtons = (
                                        j: JSCodeshift,
                                        root: Collection<any>,
                                      ) => {
                                        const components = ["Show", "Edit", "List", "Create"];
                                      Severity: Minor
                                      Found in packages/codemod/src/transformations/antd4-to-antd5.ts - About 1 hr to fix

                                        Function checkGitStatus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        export function checkGitStatus(force) {
                                          let clean = false;
                                          let errorMessage = "Unable to determine if git directory is clean";
                                          try {
                                            clean = isGitClean.sync(process.cwd());
                                        Severity: Minor
                                        Found in packages/codemod/src/index.ts - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language