pankod/refine

View on GitHub

Showing 580 of 800 total issues

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 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 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 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 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 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 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

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

                      export const addAntDesignImports = (j: JSCodeshift, source: Collection) => {
                        addOrUpdateImports(
                          j,
                          source,
                          "@refinedev/antd",
                      Severity: Minor
                      Found in packages/cli/src/transformers/integrations/ant-design.ts - About 1 hr to fix

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

                        export const getPanelPosition = (placement: Placement) => {
                          switch (placement) {
                            case "left":
                              return {
                                left: `calc(${SIZE}px + ${BUFFER}px)`,
                        Severity: Minor
                        Found in packages/devtools/src/utilities/index.ts - About 1 hr to fix

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

                                const listener = (payload: RealtimePostgresChangesPayload<any>) => {
                                  if (
                                    types.includes("*") ||
                                    types.includes(liveTypes[payload.eventType])
                                  ) {
                          Severity: Minor
                          Found in packages/supabase/src/liveProvider/index.ts - About 1 hr to fix

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

                                  const mostCommonFields = allUniqueKeys.map((key) => {
                                    const fields = inferred.map((fields) =>
                                      fields.find((field) => field.key === key),
                                    );
                            
                            
                            Severity: Minor
                            Found in packages/inferencer/src/create-inferencer/index.tsx - About 1 hr to fix

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

                              export const HamburgerMenu: React.FC = () => {
                                const {
                                  siderCollapsed,
                                  setSiderCollapsed,
                                  mobileSiderOpen,
                              Severity: Minor
                              Found in packages/mui/src/components/themedLayoutV2/hamburgerMenu/index.tsx - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                    if (
                                      field.type === "text" ||
                                      field.type === "url" ||
                                      field.type === "email" ||
                                      field.type === "number" ||
                                Severity: Major
                                Found in packages/inferencer/src/inferencers/headless/create.tsx - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if (
                                        field.type === "text" ||
                                        field.type === "url" ||
                                        field.type === "email" ||
                                        field.type === "number" ||
                                  Severity: Major
                                  Found in packages/inferencer/src/inferencers/headless/edit.tsx - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                        if (
                                          field.type === "text" ||
                                          field.type === "url" ||
                                          field.type === "email" ||
                                          field.type === "number" ||
                                    Severity: Major
                                    Found in packages/inferencer/src/inferencers/chakra-ui/create.tsx - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                          if (
                                            field.type === "text" ||
                                            field.type === "url" ||
                                            field.type === "email" ||
                                            field.type === "number" ||
                                      Severity: Major
                                      Found in packages/inferencer/src/inferencers/chakra-ui/edit.tsx - About 1 hr to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                            if (
                                              field.type === "text" ||
                                              field.type === "url" ||
                                              field.type === "email" ||
                                              field.type === "number" ||
                                        Severity: Major
                                        Found in packages/inferencer/src/inferencers/mui/create.tsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language