Showing 756 of 987 total issues
Function CodeModal
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const CodeModal = ({
visible,
onClose,
code = "",
}: {
- 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 createResourcePathWithAction
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const createResourcePathWithAction = (
resource: ResourceProps,
action: Action,
) => {
const { name, list, create, show, edit } = 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"
Further reading
Function Monitor
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const Monitor = () => {
const { ws } = React.useContext(DevToolsContext);
const [activities, setActivities] = React.useState<Activity[]>([]);
const [searchParams] = useSearchParams();
- 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 go
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
go: () => {
const { search: existingSearch, hash: existingHash } = useLocation();
const navigate = useNavigate();
const fn = useCallback(
- 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 ProjectIdFixModal
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const ProjectIdFixModal = ({ visible, onClose, projectId }: Props) => {
const [copied, setCopied] = React.useState(false);
const onCopy = React.useCallback(() => {
if (projectId) {
- 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 useNavigationButton
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function useNavigationButton(
props: NavigationButtonProps,
): NavigationButtonValues {
const navigation = useNavigation();
const routerType = useRouterType();
- 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 AuthBindingsContextProvider
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
> = ({ children, isProvided, ...authBindings }) => {
const handleLogin = async (params: unknown) => {
try {
const result = await authBindings.login?.(params);
- 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 List
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const List: React.FC<ListProps> = ({
title,
canCreate,
children,
createButtonProps: createButtonPropsFromProps,
- 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 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",
Function booleanFields
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(
["TagField", "@refinedev/antd"],
["BooleanField", "@refinedev/antd"],
Function urlFields
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const urlFields = (field: InferField) => {
if (field.type === "url") {
imports.push(
["TagField", "@refinedev/antd"],
["UrlField", "@refinedev/antd"],
Function dateFields
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
imports.push(["DateField", "@refinedev/mantine"]);
if (field.multiple) {
Function imageFields
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const imageFields = (field: InferField) => {
if (field.type === "image") {
imports.push(["Image", "@mantine/core"]);
if (field.multiple) {
Function relationHooksCode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
imports.push(["useSelect", "@refinedev/core"]);
let val = accessor(recordName, field.key, field.accessor, false);
Function relationHooksCode
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
imports.push(["useSelect", "@refinedev/core"]);
let val = accessor(recordName, field.key, field.accessor, false);
Function onMutationError
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
onMutationError: (error, _variables, _context) => {
if (disableServerSideValidation) {
refineCoreProps?.onMutationError?.(error, _variables, _context);
return;
}
Function Success
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Success = () => {
const { ws } = React.useContext(DevToolsContext);
React.useEffect(() => {
if (ws) {
Function data
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const data = React.useMemo(() => {
let filtered = [...activities];
if (filters.scope && filters.scope.length > 0) {
const allowedHooks: RefineHook[] = [];
Function Onboarding
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Onboarding = () => {
return (
<div
className={clsx(
"re-min-h-screen re-w-full",
Function Login
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Login = () => {
return (
<div
className={clsx(
"re-min-h-screen re-w-full",