Showing 750 of 983 total issues
Function useDrawerForm
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
export const useDrawerForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables = {},
TData extends BaseRecord = TQueryFnData,
- 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 useInferFetch
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useInferFetch = (
type: "list" | "show" | "edit" | "create",
resourceNameOrRouteName?: string,
idFromProps?: string | number,
meta?: InferencerComponentProps["meta"],
Function ReadyPage
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ReadyPage: React.FC<RefineReadyPageProps> = () => {
const renderCode = (text: string) => (
<Typography
sx={{
backgroundColor: (theme) => theme.palette.secondary.contrastText,
Function basicInputFields
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicInputFields = (field: InferField) => {
if (
field.type === "text" ||
field.type === "url" ||
field.type === "email" ||
Function renderTreeView
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderTreeView = (tree: ITreeMenu[]) => {
return tree.map((item) => {
const { label, route, name, icon, children } = item;
const isSelected = item.key === selectedKey;
Function basicInputFields
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicInputFields = (field: InferField) => {
if (
field.type === "text" ||
field.type === "url" ||
field.type === "email" ||
Function FeatureSlide
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FeatureSlide = (props: { className?: string }) => {
const slideTimeout = useRef<NodeJS.Timeout | null | undefined>(undefined);
const [slideIndex, setSlideIndex] = useState(0);
useEffect(() => {
Function OnboardingForm
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OnboardingForm = () => {
const [values, setValues] = React.useState<MeUpdateVariables>({
name: "",
jobTitle: "",
company: "",
Function createResources
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createResources = async (
params: { actions?: string; path?: string },
resources: string[],
) => {
const destinationPath =
Function useInferFetch
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export const useInferFetch = (
type: "list" | "show" | "edit" | "create",
resourceNameOrRouteName?: string,
idFromProps?: string | number,
meta?: InferencerComponentProps["meta"],
- 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 27 (exceeds 5 allowed). Consider refactoring. Open
export const liveProvider = (
supabaseClient: SupabaseClient<any, any, any>,
): LiveProvider => {
return {
subscribe: ({
- 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 action
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const action = async ({
port,
target,
domain,
rewriteUrl,
- 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 useForm
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export const useForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables extends FieldValues = FieldValues,
TContext extends object = {},
- 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 renderRelationFields
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
imports.push(
["Autocomplete", "@mui/material"],
["Controller", "react-hook-form"],
Function renderRelationFields
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
imports.push(
["Autocomplete", "@mui/material"],
["Controller", "react-hook-form"],
Function HeaderAuthStatus
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const HeaderAuthStatus = () => {
const [me, setMe] = React.useState<MeResponse | null>(null);
const [logoutVisible, setLogoutVisible] = React.useState(false);
const buttonRef = React.useRef<HTMLButtonElement>(null);
const navigate = useNavigate();
Function basicInputFields
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicInputFields = (field: InferField) => {
if (
field.type === "text" ||
field.type === "url" ||
field.type === "email" ||
Function Preview
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Preview: NextPage = () => {
const [ready, setReady] = React.useState(false);
const { code, css, hasQuery, isReady, disableScroll, useTailwind } =
useCode();
const [scope, setScope] = React.useState({ ...RefineCommonScope });
Function ConfigSuccessPage
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export const ConfigSuccessPage: React.FC = () => {
const isTablet = useMediaQuery("(max-width: 1010px)");
const isMobile = useMediaQuery("(max-width: 650px)");
const getGridTemplateColumns = () => {
- 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 Authenticated
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
export function Authenticated({
redirectOnFail = true,
appendCurrentPathToQuery = true,
children,
fallback: fallbackContent,
- 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"