Showing 959 of 983 total issues
Function imageFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const imageFields = (field: InferField) => {
if (field.type === "image") {
imports.push(
["Upload", "antd"],
["getValueFromEvent", "@refinedev/antd"],
Function imageFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const imageFields = (field: InferField) => {
if (field.type === "image") {
imports.push(
["Upload", "antd"],
["getValueFromEvent", "@refinedev/antd"],
Function renderRelationFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
imports.push(["Select", "antd"]);
const variableName = getVariableName(field.key, "SelectProps");
Function renderRelationFields
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
imports.push(["Select", "antd"]);
const variableName = getVariableName(field.key, "SelectProps");
Function go
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
go: () => {
const { push, replace, asPath: pathname } = useRouter();
const fn = React.useCallback(
({
Function go
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
go: () => {
const { push, replace } = useRouter();
const pathname = usePathname();
const searchParamsObj = useSearchParams();
Function dateFields
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
imports.push(["DatePicker", "antd"], ["dayjs", "dayjs", true]);
if (field.multiple) {
Function booleanFields
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(["Checkbox", "antd"]);
if (field.multiple) {
Function generateFilter
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const generateFilter = (filter: CrudFilter, query: any) => {
switch (filter.operator) {
case "eq":
return query.eq(filter.field, filter.value);
case "ne":
Function Feed
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Feed = () => {
const [feed, setFeed] = React.useState<FeedType | null>(null);
const fetchFeed = React.useCallback(async () => {
try {
Function addV3LegacyAuthProviderCompatibleTrueToAuthHooks
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addV3LegacyAuthProviderCompatibleTrueToAuthHooks = (
j: JSCodeshift,
root: Collection<any>,
) => {
const authHooks = root.find(j.CallExpression, {
Function basicFields
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicFields = (field: InferField) => {
if (field && (field.type === "text" || field.type === "number")) {
const id = `id: "${field.key}"`;
const accessorKey = getAccessorKey(field);
const header = `header: ${translatePrettyString({
Function emailFields
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emailFields = (field: InferField) => {
if (field.type === "email") {
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
return jsx`
Function urlFields
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const urlFields = (field: InferField) => {
if (field.type === "url") {
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
return jsx`
Function basicFields
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicFields = (field: InferField) => {
if (field && (field.type === "text" || field.type === "number")) {
const id = `id: "${field.key}"`;
const accessorKey = getAccessorKey(field);
const header = `header: ${translatePrettyString({
Function useTelemetryData
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useTelemetryData = (): ITelemetryData => {
const auth = useIsExistAuthentication();
const auditLogContext = useContext(AuditLogContext);
const { liveProvider } = useContext(LiveContext);
const routerContext = useContext(LegacyRouterContext);
Function parse
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: () => {
const params = useParams();
const { pathname, search } = useLocation();
const { resources } = useContext(ResourceContext);
Function Create
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const Create: React.FC<CreateProps> = ({
title,
saveButtonProps: saveButtonPropsFromProps,
children,
resource: resourceFromProps,
- 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 15 (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
Function LoginPage
has a Cognitive Complexity of 15 (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"