pankod/refine

View on GitHub
packages/codemod/src/transformations/v4/fix-v4-deprecations.ts

Summary

Maintainability
F
4 days
Test Coverage

Function fixDeprecatedReactTableProps has 174 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const fixDeprecatedReactTableProps = (j: JSCodeshift, source: Collection) => {
  const refineReactTableImports = source.find(j.ImportDeclaration, {
    source: {
      value: "@pankod/refine-react-table",
    },
Severity: Major
Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 6 hrs to fix

    Function fixDeprecatedUseTableProps has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const fixDeprecatedUseTableProps = (j: JSCodeshift, source: Collection) => {
      const willCheckImports = ["useTable", "useDataGrid"];
    
      willCheckImports.forEach((hook) => {
        const useTableHooks = source.find(j.CallExpression, {
    Severity: Major
    Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 5 hrs to fix

      Function fixUseSelectHasPaginationToPaginationMode has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const fixUseSelectHasPaginationToPaginationMode = (
        j: JSCodeshift,
        source: Collection,
      ) => {
        const useSelectHooks = source.find(j.CallExpression, {
      Severity: Major
      Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 3 hrs to fix

        Function fixUseListHasPaginationToPaginationMode has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const fixUseListHasPaginationToPaginationMode = (
          j: JSCodeshift,
          source: Collection,
        ) => {
          const useListHooks = source.find(j.CallExpression, {
        Severity: Major
        Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 2 hrs to fix

          Function resourceOptionstoMeta has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const resourceOptionstoMeta = (j: JSCodeshift, source: Collection) => {
            const refineElement = source.find(j.JSXElement, {
              openingElement: {
                name: {
                  name: "Refine",
          Severity: Minor
          Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 1 hr to fix

            Function sortToSorters has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const sortToSorters = (j: JSCodeshift, source: Collection) => {
              const willCheckHooks = [
                "useCheckboxGroup",
                "useRadioGroup",
                "useSelect",
            Severity: Minor
            Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 1 hr to fix

              Function sorterToSorters has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const sorterToSorters = (j: JSCodeshift, source: Collection) => {
                const willCheckHooks = ["useExport"];
              
                willCheckHooks.forEach((hookName) => {
                  const useListHooks = source.find(j.CallExpression, {
              Severity: Minor
              Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 1 hr to fix

                Function resourceNametoResource has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const resourceNametoResource = (j: JSCodeshift, source: Collection) => {
                  const willCheckHooks = ["useExport", "useImport"];
                
                  willCheckHooks.forEach((hookName) => {
                    const useListHooks = source.find(j.CallExpression, {
                Severity: Minor
                Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.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 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 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 filtersProperties has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            const filtersProperties = deprecatedUseTableFiltersProps.map((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 filtersProperties has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                const filtersProperties = deprecatedUseTableFiltersProps.map((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

                            Avoid too many return statements within this function.
                            Open

                                  return;
                            Severity: Major
                            Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return;
                              Severity: Major
                              Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return;
                                Severity: Major
                                Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                            return;
                                  Severity: Major
                                  Found in packages/codemod/src/transformations/v4/fix-v4-deprecations.ts - About 30 mins to fix

                                    There are no issues that match your filters.

                                    Category
                                    Status