pankod/refine

View on GitHub

Showing 812 of 823 total issues

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

  const booleanFields = (field: InferField) => {
    if (field.type === "boolean") {
      imports.push(
        ["TagField", "@refinedev/chakra-ui"],
        ["BooleanField", "@refinedev/chakra-ui"],
Severity: Minor
Found in packages/inferencer/src/inferencers/chakra-ui/show.tsx - About 1 hr to fix

    Function urlFields has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const urlFields = (field: InferField) => {
        if (field.type === "url") {
          imports.push(
            ["TagField", "@refinedev/chakra-ui"],
            ["UrlField", "@refinedev/chakra-ui"],
    Severity: Minor
    Found in packages/inferencer/src/inferencers/chakra-ui/show.tsx - About 1 hr to fix

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

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

        Function emailFields has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const emailFields = (field: InferField) => {
            if (field.type === "email") {
              imports.push(
                ["TagField", "@refinedev/chakra-ui"],
                ["EmailField", "@refinedev/chakra-ui"],
        Severity: Minor
        Found in packages/inferencer/src/inferencers/chakra-ui/show.tsx - About 1 hr to fix

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

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

            Function listUrl has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const listUrl = (
                resource: string | IResourceItem,
                meta: MetaDataQuery = {},
              ) => {
                if (routerType === "legacy") {
            Severity: Minor
            Found in packages/core/src/hooks/navigation/index.ts - About 1 hr to fix

              Function transformMuiOperatorToCrudOperator has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const transformMuiOperatorToCrudOperator = (
                operatorValue?: string,
              ): Exclude<CrudOperators, "or" | "and"> => {
                if (!operatorValue) {
                  return "eq";
              Severity: Minor
              Found in packages/mui/src/definitions/dataGrid/index.ts - About 1 hr to fix

                Function createUrl has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const createUrl = (
                    resource: string | IResourceItem,
                    meta: MetaDataQuery = {},
                  ) => {
                    if (routerType === "legacy") {
                Severity: Minor
                Found in packages/core/src/hooks/navigation/index.ts - About 1 hr to fix

                  Function printUpdateWarningTable has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const printUpdateWarningTable = async (
                    params: UpdateWarningTableParams,
                  ) => {
                    const data = params?.data;
                    const tableHead = Object.keys(data?.[0] || {});
                  Severity: Minor
                  Found in packages/cli/src/components/update-warning-table/table.ts - About 1 hr to fix

                    Function createUIGroup has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const createUIGroup = (
                      packages: RefinePackageInstalledVersionData[],
                    ): UIGroup | null => {
                      if (packages.length === 0) {
                        return null;
                    Severity: Minor
                    Found in packages/cli/src/commands/update/interactive/index.ts - About 1 hr to fix

                      Identical blocks of code found in 4 locations. Consider refactoring.
                      Open

                          cy.getAllLocalStorage().then((ls) => {
                            expect(ls[Cypress.config("baseUrl")!]["i18nextLng"]).to.eq("de");
                          });
                      Severity: Major
                      Found in cypress/e2e/inferencer-chakra-ui/all.cy.ts and 3 other locations - About 1 hr to fix
                      cypress/e2e/inferencer-antd/all.cy.ts on lines 233..235
                      cypress/e2e/inferencer-mantine/all.cy.ts on lines 217..219
                      cypress/e2e/inferencer-material-ui/all.cy.ts on lines 282..284

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 65.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 4 locations. Consider refactoring.
                      Open

                          cy.getAllLocalStorage().then((ls) => {
                            expect(ls[Cypress.config("baseUrl")!]["i18nextLng"]).to.eq("de");
                          });
                      Severity: Major
                      Found in cypress/e2e/inferencer-antd/all.cy.ts and 3 other locations - About 1 hr to fix
                      cypress/e2e/inferencer-chakra-ui/all.cy.ts on lines 211..213
                      cypress/e2e/inferencer-mantine/all.cy.ts on lines 217..219
                      cypress/e2e/inferencer-material-ui/all.cy.ts on lines 282..284

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 65.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 4 locations. Consider refactoring.
                      Open

                          cy.getAllLocalStorage().then((ls) => {
                            expect(ls[Cypress.config("baseUrl")!]["i18nextLng"]).to.eq("de");
                          });
                      Severity: Major
                      Found in cypress/e2e/inferencer-mantine/all.cy.ts and 3 other locations - About 1 hr to fix
                      cypress/e2e/inferencer-antd/all.cy.ts on lines 233..235
                      cypress/e2e/inferencer-chakra-ui/all.cy.ts on lines 211..213
                      cypress/e2e/inferencer-material-ui/all.cy.ts on lines 282..284

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 65.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          cy.wait("@getPosts").then((interception) => {
                            const { request } = interception;
                      
                            expect(request.query).not.to.ownProperty("_sort");
                          });
                      Severity: Major
                      Found in cypress/e2e/table-mantine-basic/all.cy.ts and 1 other location - About 1 hr to fix
                      cypress/e2e/table-chakra-ui-basic/all.cy.ts on lines 42..46

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 65.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 4 locations. Consider refactoring.
                      Open

                          cy.getAllLocalStorage().then((ls) => {
                            expect(ls[Cypress.config("baseUrl")!]["i18nextLng"]).to.eq("de");
                          });
                      Severity: Major
                      Found in cypress/e2e/inferencer-material-ui/all.cy.ts and 3 other locations - About 1 hr to fix
                      cypress/e2e/inferencer-antd/all.cy.ts on lines 233..235
                      cypress/e2e/inferencer-chakra-ui/all.cy.ts on lines 211..213
                      cypress/e2e/inferencer-mantine/all.cy.ts on lines 217..219

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 65.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Identical blocks of code found in 2 locations. Consider refactoring.
                      Open

                          cy.wait("@getPosts").then((interception) => {
                            const { request } = interception;
                      
                            expect(request.query).not.to.ownProperty("_sort");
                          });
                      Severity: Major
                      Found in cypress/e2e/table-chakra-ui-basic/all.cy.ts and 1 other location - About 1 hr to fix
                      cypress/e2e/table-mantine-basic/all.cy.ts on lines 61..65

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 65.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Function renameUseSimpleListQueryResult has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const renameUseSimpleListQueryResult = (
                        j: JSCodeshift,
                        source: Collection,
                      ) => {
                        const renameProperties = (prop) => {

                        Function metaDataToMeta has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const metaDataToMeta = (j: JSCodeshift, source: Collection) => {
                          // find all JSX elements
                          source.find(j.JSXElement).forEach((path) => {
                            const attributes = path.node.openingElement.attributes;
                            if (!attributes) return;
                        Severity: Minor
                        Found in packages/codemod/src/transformations/v4/metadata-to-meta.ts - About 1 hr to fix

                          Function textFields has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const textFields = (field: InferField) => {
                              if (field.type === "text") {
                                imports.push(["TextField", "@refinedev/mantine"]);
                          
                                if (field.multiple) {
                          Severity: Minor
                          Found in packages/inferencer/src/inferencers/mantine/show.tsx - About 1 hr to fix

                            Function emailFields has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const emailFields = (field: InferField) => {
                                if (field.type === "email") {
                                  imports.push(
                                    ["TagField", "@refinedev/antd"],
                                    ["EmailField", "@refinedev/antd"],
                            Severity: Minor
                            Found in packages/inferencer/src/inferencers/antd/show.tsx - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language