Showing 963 of 987 total issues
Function booleanFields
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field?.type === "boolean") {
imports.push(["BooleanField", "@refinedev/chakra-ui"]);
const id = `id: "${field.key}"`;
Function dateFields
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
imports.push(["DateField", "@refinedev/chakra-ui"]);
const id = `id: "${field.key}"`;
Function ReadyPage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ReadyPage: React.FC<RefineReadyPageProps> = () => {
return (
<Row align="middle" justify="center" style={styles.root}>
<Col style={{ textAlign: "center" }}>
<img
Function postTransform
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function postTransform(files: any, flags: any) {
const rootDir = path.join(process.cwd(), files[0]);
const packageJsonPath = path.join(rootDir, "package.json");
const useYarn = checkPackageLock(rootDir) === "yarn.lock";
let packageJsonData;
Function dateFields
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
imports.push(["DateField", "@refinedev/mui"]);
const fieldProperty = `field: "${field.key}"`;
Function richtextFields
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const richtextFields = (field: InferField) => {
if (field?.type === "richtext") {
imports.push(["MarkdownField", "@refinedev/mantine"]);
const id = `id: "${field.key}"`;
Function richtextFields
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const richtextFields = (field: InferField) => {
if (field?.type === "richtext") {
imports.push(["MarkdownField", "@refinedev/mui"]);
const fieldProperty = `field: "${field.key}"`;
Function richtextFields
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const richtextFields = (field: InferField) => {
if (field?.type === "richtext") {
imports.push(["MarkdownField", "@refinedev/chakra-ui"]);
const id = `id: "${field.key}"`;
Function useCode
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useCode = (): UseCodeReturn => {
const { query, isReady } = useRouter();
const {
code: compressed,
disableScroll,
Function renderSection
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderSection = (key: keyof Filters) => {
const value = filters[key];
const mapValue = typeof value === "string" ? [value] : value;
if (!value || value.length === 0) {
Function addBreadcrumb
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const addBreadcrumb = (parentName: string | IResourceItem) => {
const parentResource =
typeof parentName === "string"
? pickResource(parentName, resources, routerType === "legacy") ?? {
name: parentName,
Function antdPagination
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const antdPagination = (): false | TablePaginationConfig => {
if (isPaginationEnabled) {
return {
itemRender: (page, type, element) => {
const link = createLinkForSyncWithLocation({
Function transformRefineOptions
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const transformRefineOptions = (
j: JSCodeshift,
root: Collection<any>,
projectId: string,
) => {
Function antdPagination
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
const antdPagination = (): false | PaginationConfig => {
if (isPaginationEnabled) {
return {
itemRender: (page, type, element) => {
const link = createLinkForSyncWithLocation({
Function onMutationError
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
onMutationError: async (error, _variables, _context) => {
if (disableServerSideValidation) {
onMutationErrorProp?.(error, _variables, _context);
return;
}
Function useNotificationProvider
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useNotificationProvider = (): NotificationProvider => {
const { notification: notificationFromContext } = App.useApp();
const notification =
"open" in notificationFromContext
? notificationFromContext
Function useQuerySubscription
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
: (queryClient: QueryClient) => {
const { ws } = useContext(DevToolsContext);
const queryCacheSubscription = React.useRef<() => void>();
const mutationCacheSubscription = React.useRef<() => void>();
Function RouteProvider
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const RouteProvider = ({
initialRoute,
}: RouteProviderProps): JSX.Element => {
const { resources } = useResource();
const { catchAll, DashboardPage, LoginPage } = useRefineContext();
- 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 useCode
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const useCode = (): UseCodeReturn => {
const { query, isReady } = useRouter();
const {
code: compressed,
disableScroll,
- 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 ProjectIdFixBanner
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const ProjectIdFixBanner = () => {
const [projectId, setProjectId] = React.useState<string | null>(null);
const [modalVisible, setModalVisible] = React.useState(false);
const [status, setStatus] = React.useState<
"hidden" | "warning" | "fixing" | "success"
- 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"