pankod/refine

View on GitHub

Showing 750 of 983 total issues

Function objectInfer has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

export const objectInfer: FieldInferencer = (
  key,
  value,
  record,
  infer,
Severity: Minor
Found in packages/inferencer/src/field-inferencers/object.ts - About 7 hrs 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 useLogin has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

export function useLogin<TVariables = {}>({
  v3LegacyAuthProviderCompatible,
  mutationOptions,
}: UseLoginProps<TVariables> | UseLoginLegacyProps<TVariables> = {}):
  | UseLoginLegacyReturnType<TVariables>
Severity: Minor
Found in packages/core/src/hooks/auth/useLogin/index.ts - About 7 hrs 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 renderer has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

export const renderer = ({
  resource,
  fields,
  meta,
  isCustomPage,
Severity: Minor
Found in packages/inferencer/src/inferencers/chakra-ui/edit.tsx - About 7 hrs 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 useForm has 184 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useForm = <
  TQueryFnData extends BaseRecord = BaseRecord,
  TError extends HttpError = HttpError,
  TVariables = {},
  TData extends BaseRecord = TQueryFnData,
Severity: Major
Found in packages/core/src/hooks/form/index.ts - About 7 hrs to fix

    Function Edit has 183 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const Edit: React.FC<EditProps> = (props) => {
      const {
        children,
        resource: resourceFromProps,
        recordItemId,
    Severity: Major
    Found in packages/mantine/src/components/crud/edit/index.tsx - About 7 hrs to fix

      Function ThemedSiderV2 has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

      export const ThemedSiderV2: React.FC<RefineThemedLayoutV2SiderProps> = ({
        render,
        meta,
        Title: TitleFromProps,
        activeItemDisabled = false,
      Severity: Minor
      Found in packages/mantine/src/components/themedLayoutV2/sider/index.tsx - About 7 hrs 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 ThemedSider has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

      export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
        Title: TitleFromProps,
        render,
        meta,
        isSiderOpen,
      Severity: Minor
      Found in packages/chakra-ui/src/components/themedLayout/sider/index.tsx - About 7 hrs 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 Sider has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

      export const Sider: React.FC<RefineLayoutSiderProps> = ({
        Title: TitleFromProps,
        render,
        meta,
      }) => {
      Severity: Minor
      Found in packages/mui/src/components/layout/sider/index.tsx - About 7 hrs 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 useForm has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
      Open

      export const useForm = <
        TQueryFnData extends BaseRecord = BaseRecord,
        TError extends HttpError = HttpError,
        TVariables = {},
        TData extends BaseRecord = TQueryFnData,
      Severity: Minor
      Found in packages/core/src/hooks/form/index.ts - About 7 hrs 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 action has 177 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const action = async (_options: OptionValues) => {
        inquirer.registerPrompt("autocomplete", inquirerAutoCompletePrompt);
      
        const installedPackages = await getInstalledRefinePackagesFromNodeModules();
      
      
      Severity: Major
      Found in packages/cli/src/commands/swizzle/index.tsx - About 7 hrs to fix

        Function promises has 175 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                const promises = allFields.map(async (field) => {
                  if (field && (field.relation || field.canRelation)) {
                    if (record) {
                      if (field.relationInfer) {
                        return field;
        Severity: Major
        Found in packages/inferencer/src/use-relation-fetch/index.ts - About 7 hrs to fix

          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 Show has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

            export const Show: React.FC<ShowProps> = (props) => {
              const {
                children,
                resource: resourceFromProps,
                recordItemId,
            Severity: Minor
            Found in packages/mantine/src/components/crud/show/index.tsx - About 6 hrs 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 Show has 172 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const Show: React.FC<ShowProps> = (props) => {
              const {
                children,
                resource: resourceFromProps,
                recordItemId,
            Severity: Major
            Found in packages/mantine/src/components/crud/show/index.tsx - About 6 hrs to fix

              Function Packages has 169 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const Packages = () => {
                const ref = React.useRef<FireworksHandlers>(null);
                const [packages, setPackages] = React.useState<PackageType[]>([]);
                const [visible, setVisible] = React.useState(false);
                const [outdatedPackages, setOutdatedPackages] = React.useState<string[]>([]);
              Severity: Major
              Found in packages/devtools-ui/src/components/packages.tsx - About 6 hrs to fix

                Function ThemedSider has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                export const ThemedSider: React.FC<RefineThemedLayoutSiderProps> = ({
                  render,
                  meta,
                  Title: TitleFromProps,
                }) => {
                Severity: Minor
                Found in packages/mantine/src/components/themedLayout/sider/index.tsx - About 6 hrs 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 createInferencer has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                export const createInferencer: CreateInferencer = ({
                  type,
                  additionalScope = [],
                  customElements = [],
                  fieldTransformers = [],
                Severity: Minor
                Found in packages/inferencer/src/create-inferencer/index.tsx - About 6 hrs 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 Show has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                Open

                export const Show: React.FC<ShowProps> = ({
                  title,
                  canEdit,
                  canDelete,
                  isLoading = false,
                Severity: Minor
                Found in packages/mui/src/components/crud/show/index.tsx - About 6 hrs 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 run has 165 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const run = async (
                  example: string | boolean | undefined,
                  destination?: string,
                ) => {
                  const pm = findPM();
                Severity: Major
                Found in packages/create-refine-app/src/example/index.ts - About 6 hrs to fix

                  Function Edit has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const Edit: React.FC<EditProps> = (props) => {
                    const {
                      children,
                      resource: resourceFromProps,
                      recordItemId,
                  Severity: Minor
                  Found in packages/mantine/src/components/crud/edit/index.tsx - About 6 hrs 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

                  Severity
                  Category
                  Status
                  Source
                  Language