pankod/refine

View on GitHub

Showing 580 of 800 total issues

Function generateNestedFilterQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const generateNestedFilterQuery = (
  filter: HasuraCrudFilter,
  namingConvention: NamingConvention = "hasura-default",
): any => {
  const { operator } = filter;
Severity: Minor
Found in packages/hasura/src/utils/generateFilters.ts - About 35 mins 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 ThemedTitleV2 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const ThemedTitleV2: React.FC<RefineLayoutThemedTitleProps> = ({
  collapsed,
  icon: iconFromProps,
  text: textFromProps,
  wrapperStyles = {},
Severity: Minor
Found in packages/mantine/src/components/themedLayoutV2/title/index.tsx - About 35 mins 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 liveProvider has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const liveProvider = (client: Client): LiveProvider => {
  return {
    subscribe: ({ callback, params }) => {
      const {
        resource,
Severity: Minor
Found in packages/hasura/src/liveProvider/index.ts - About 35 mins 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 relationInfer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const relationInfer: FieldInferencer = (key, value) => {
  const isRelation = relationRegexp.test(key);
  const isBasicValue = typeof value === "string" || typeof value === "number";
  const isBasicArray =
    Array.isArray(value) &&
Severity: Minor
Found in packages/inferencer/src/field-inferencers/relation.ts - About 35 mins 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 pickMeta has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const pickMeta = (
  identifier?: string,
  meta?: InferencerComponentProps["meta"],
  actions?: Action[],
) => {
Severity: Minor
Found in packages/inferencer/src/utilities/get-meta-props/index.ts - About 35 mins 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 ThemeProvider has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const ThemeProvider = ({
  children,
  theme,
}: {
  children?: React.ReactNode;
Severity: Minor
Found in packages/live-previews/src/scope/mui.tsx - About 35 mins 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 Auth0Provider has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const Auth0Provider = ({ children }: { children: React.ReactNode }) => {
  const externalNavigator = React.useContext(ExternalNavigationContext);

  const [isAuthenticated, setIsAuthenticated] = React.useState(false);

Severity: Minor
Found in packages/live-previews/src/scope/auth0.tsx - About 35 mins 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 getDevtoolsUrlFromEnv has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const getDevtoolsUrlFromEnv = () => {
  const PORT_FROM_ENV =
    typeof __PROCESS_KEY__ !== "undefined" && "env" in __PROCESS_KEY__
      ? __PROCESS_ENV_REFINE_DEVTOOLS_PORT_KEY__ ||
        __PROCESS_ENV_NEXT_PUBLIC_REFINE_DEVTOOLS_PORT_KEY__ ||
Severity: Minor
Found in packages/devtools/src/utilities/get-devtools-url-from-env.ts - About 35 mins 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 Authenticated has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const Authenticated = ({
  children,
  fallback,
}: {
  children: React.ReactNode;
Severity: Minor
Found in packages/devtools-ui/src/components/authenticated.tsx - About 35 mins 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 MonitorAppliedFilterGroup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const MonitorAppliedFilterGroup = ({ filters, onClear }: Props) => {
  const hasFilters =
    filters.hook.length > 0 ||
    filters.scope.length > 0 ||
    filters.status.length > 0 ||
Severity: Minor
Found in packages/devtools-ui/src/components/monitor-applied-filter-group.tsx - About 35 mins 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 downloadAndExtract has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export async function downloadAndExtract({
  root,
  name,
  branch,
  repo,
Severity: Minor
Found in packages/create-refine-app/src/example/download-and-extract.ts - About 35 mins 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 addOrUpdateImports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const addOrUpdateImports = (
  j: JSCodeshift,
  source: Collection,
  importPath: string,
  importIdentifierNames: string[],
Severity: Minor
Found in packages/cli/src/utils/codeshift/index.ts - About 35 mins 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 Select has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const Select = <TType extends "multiple" | "single">({
  type,
  options,
  placeholder,
  hint,
Severity: Minor
Found in packages/devtools-ui/src/components/select.tsx - About 35 mins 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 Breadcrumb has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const Breadcrumb: React.FC<BreadcrumbProps> = ({
  breadcrumbProps,
  showHome = true,
  hideIcons = false,
  meta,
Severity: Minor
Found in packages/mui/src/components/breadcrumb/index.tsx - About 35 mins 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 generateUpdatedSubscription has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const generateUpdatedSubscription = ({
  id,
  resource,
  filters,
  meta,
Severity: Minor
Found in packages/nestjs-query/src/utils/index.ts - About 35 mins 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 getWantedWithPreferredWildcard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const getWantedWithPreferredWildcard = (
  packageName: RefinePackageInstalledVersionData["name"],
  versionWanted: RefinePackageInstalledVersionData["wanted"],
): string => {
  const dependencies = getDependenciesWithVersion();
Severity: Minor
Found in packages/cli/src/commands/check-updates/index.tsx - About 35 mins 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 createResources has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const createResources = async (
  params: { actions?: string; path?: string },
  resources: string[],
) => {
  const destinationPath =
Severity: Minor
Found in packages/cli/src/commands/add/sub-commands/resource/create-resources.ts - About 35 mins 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 getDefaultActionPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const getDefaultActionPath = (
  resourceName: string,
  action: Action,
  parentPrefix?: string,
): string => {
Severity: Minor
Found in packages/core/src/definitions/helpers/router/get-default-action-path.ts - About 35 mins 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

Avoid too many return statements within this function.
Open

  return null;
Severity: Major
Found in cypress/support/commands/intercepts/hasura.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

              return req.reply({
                data: hasuraCategories.data,
              });
    Severity: Major
    Found in cypress/support/commands/intercepts/hasura.ts - About 30 mins to fix
      Severity
      Category
      Status
      Source
      Language