Showing 580 of 800 total issues
Avoid deeply nested control flow statements. Open
if (Array.isArray(field.relationInfer.accessor)) {
console.log(
"@refinedev/inferencer: Inferencer failed to render this field",
{
key: field.key,
Avoid deeply nested control flow statements. Open
if (scopedImportName) {
if (namedImports) {
namedImports = `{ ${scopedImportName} as ${defaultImport}, ${namedImports.slice(
1,
-1,
Avoid deeply nested control flow statements. Open
for (const response of item.response) {
ids.push(response.id);
}
Avoid deeply nested control flow statements. Open
if (Array.isArray(field.relationInfer.accessor)) {
console.log(
"@refinedev/inferencer: Inferencer failed to render this field",
{
key: field.key,
Avoid deeply nested control flow statements. Open
if (namedImports.includes("default as")) {
const scopedImportName = packageName.match(regexMatch[1])?.[1];
namedImports = namedImports.replace(
"default as",
`${scopedImportName} as`,
Function Packages
has a Cognitive Complexity of 8 (exceeds 5 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[]>([]);
- Read upRead up
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 authProvider
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const authProvider = (API_URL: string): AuthProvider => {
const axiosInstance = axios.create();
axiosInstance.interceptors.response.use(
(response) => {
- Read upRead up
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 deeply nested control flow statements. Open
for (const response of item.response) {
ids.push(response.id);
}
Function Status
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const Status = ({ activity }: { activity: Activity }) => {
const status = activity.status;
const dataUpdateCount =
activity.type === "query" ? activity.state.dataUpdateCount : 0;
- Read upRead up
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 ResultItem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
({ action, active, currentRootActionId }, ref) => {
const ancestors = React.useMemo(() => {
if (!currentRootActionId) return action.ancestors;
const index = action.ancestors.findIndex(
(ancestor) => ancestor.id === currentRootActionId,
- Read upRead up
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 FeedItem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const FeedItem = ({ item }: Props) => {
const isNew = dayjs().diff(dayjs(item.date), "day") <= 3;
const isFeatured = item.featured;
return (
- Read upRead up
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 8 (exceeds 5 allowed). Consider refactoring. Open
export const liveProvider = (client: Client): LiveProvider => {
const subscribeToResource = (
client: Client,
callback: Function,
params: any,
- Read upRead up
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 pickMatchedRoute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const pickMatchedRoute = (
routes: ResourceActionRoute[],
): ResourceActionRoute | undefined => {
// these routes are all matched, we should pick the least parametrized one
- Read upRead up
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 useCanWithoutCache
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const useCanWithoutCache = (): IAccessControlContext => {
const { can: canFromContext } = React.useContext(AccessControlContext);
const can = React.useMemo(() => {
if (!canFromContext) {
- Read upRead up
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 LoginPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const LoginPage: React.FC<LoginProps> = ({
providers,
registerLink,
forgotPasswordLink,
rememberMe,
- Read upRead up
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 useButtonCanAccess
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const useButtonCanAccess = (
props: ButtonCanAccessProps,
): ButtonCanAccessValues => {
const translate = useTranslate();
const accessControlContext = React.useContext(AccessControlContext);
- Read upRead up
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 RegisterPage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const RegisterPage: React.FC<RegisterProps> = ({
providers,
loginLink,
wrapperProps,
contentProps,
- Read upRead up
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
Consider simplifying this complex logical expression. Open
if (
!field.relation &&
(field.type === "text" ||
field.type === "richtext" ||
field.type === "number") &&
Function generateDefaultDocumentTitle
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
translate: ReturnType<typeof useTranslate>,
resource?: IResourceItem,
action?: string,
id?: string,
resourceName?: string,
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,
- Read upRead up
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"