pankod/refine

View on GitHub
packages/codemod/src/transformations/refine2-to-refine3.ts

Summary

Maintainability
D
1 day
Test Coverage

Function updateRefineImports has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function updateRefineImports(j: JSCodeshift, root: Collection<any>) {
  const refineCoreImports = root.find(j.ImportDeclaration, {
    source: {
      value: "@pankod/refine-core",
    },
Severity: Major
Found in packages/codemod/src/transformations/refine2-to-refine3.ts - About 3 hrs to fix

    Function moveConfigProvider has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const moveConfigProvider = (j: JSCodeshift, root: Collection<any>) => {
      const refineElement = root.find(j.JSXElement, {
        openingElement: {
          name: {
            name: "Refine",
    Severity: Major
    Found in packages/codemod/src/transformations/refine2-to-refine3.ts - About 2 hrs to fix

      Function postTransform has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function postTransform(files: any, flags: any) {
        const rootDir = path.join(process.cwd(), files[0]);
        const packageJsonPath = path.join(rootDir, "package.json");
        const useYarn = checkPackageLock(rootDir) === "yarn.lock";
        let packageJsonData;
      Severity: Minor
      Found in packages/codemod/src/transformations/refine2-to-refine3.ts - About 1 hr to fix

        Function defaultLoginPage has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const defaultLoginPage = (j: JSCodeshift, root: Collection<any>) => {
          const refineElement = root.find(j.JSXElement, {
            openingElement: {
              name: {
                name: "Refine",
        Severity: Minor
        Found in packages/codemod/src/transformations/refine2-to-refine3.ts - About 1 hr to fix

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

          const defaultCatchAllPage = (j: JSCodeshift, root: Collection<any>) => {
            const refineElement = root.find(j.JSXElement, {
              openingElement: {
                name: {
                  name: "Refine",
          Severity: Minor
          Found in packages/codemod/src/transformations/refine2-to-refine3.ts - About 1 hr to fix

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

            const defaultLayout = (j: JSCodeshift, root: Collection<any>) => {
              const refineElement = root.find(j.JSXElement, {
                openingElement: {
                  name: {
                    name: "Refine",
            Severity: Minor
            Found in packages/codemod/src/transformations/refine2-to-refine3.ts - About 1 hr to fix

              Function updateRefineImports has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              function updateRefineImports(j: JSCodeshift, root: Collection<any>) {
                const refineCoreImports = root.find(j.ImportDeclaration, {
                  source: {
                    value: "@pankod/refine-core",
                  },
              Severity: Minor
              Found in packages/codemod/src/transformations/refine2-to-refine3.ts - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              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

                There are no issues that match your filters.

                Category
                Status