Showing 580 of 800 total issues
Function useNotificationProvider
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useNotificationProvider = (): NotificationProvider => {
const activeNotifications: string[] = [];
const isNotificationActive = (key?: string) => {
return activeNotifications.includes(key as string);
Function checkPackage
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const checkPackage = (code = "") => {
const set = new Set<string>();
const hasAntd =
code.includes("@refinedev/antd") ||
Function fixDeprecatedUseTableProps
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fixDeprecatedUseTableProps = (j: JSCodeshift, source: Collection) => {
const willCheckImports = ["useTable", "useDataGrid"];
willCheckImports.forEach((hook) => {
const useTableHooks = source.find(j.CallExpression, {
Function OnboardingForm
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OnboardingForm = () => {
const [loading, setLoading] = React.useState(false);
const { handleSubmit, control, setValue, setError, formState } =
useForm<MeUpdateVariables>({
defaultValues: {
Function DataProvider
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
export const DataProvider = (
apiUrl: string,
httpClient: AxiosInstance = axiosInstance,
): Required<IDataProvider> => ({
getList: async ({ resource, pagination, filters, sorters, 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 ConfigSuccessPage
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ConfigSuccessPage: React.FC = () => {
const isTablet = useMediaQuery("(max-width: 1010px)");
const isMobile = useMediaQuery("(max-width: 650px)");
const getGridTemplateColumns = () => {
Function renderRelationFields
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = getVariableName(field.key, "Data");
const variableIsLoading = getVariableName(field.key, "IsLoading");
Function useExport
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
export const useExport = <
TData extends BaseRecord = BaseRecord,
TVariables = any,
>({
resourceName,
- 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 transformer
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function transformer(file: FileInfo, api: API) {
const j = api.jscodeshift;
const source = j(file.source);
const hasRefineElement =
Function Header
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Header = () => {
const [connectedApp, setConnectedApp] = React.useState<string | null>(null);
const { ws } = React.useContext(DevToolsContext);
const fetchConnectedApp = React.useCallback(async () => {
Function renderRelationFields
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = getVariableName(field.key, "Data");
const variableIsLoading = getVariableName(field.key, "IsLoading");
Function renderRelationFields
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = getVariableName(field.key, "Data");
const variableIsLoading = getVariableName(field.key, "IsLoading");
Function serveApi
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const serveApi = (app: Express, db: Data) => {
app.use("/api", json());
app.get("/api/connected-app", (_, res) => {
res.json({ url: db.connectedApp });
Function renderRelationFields
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = getVariableName(field.key, "Data");
const variableIsLoading = getVariableName(field.key, "IsLoading");
Function DevtoolsPanel
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
: () => {
const [browser, setBrowser] = React.useState<boolean>(false);
const [visible, setVisible] = React.useState(false);
const [placement] = React.useState<Placement>("bottom");
const { httpUrl, ws } = React.useContext(DevToolsContext);
Function renderRelationFields
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderRelationFields = (field: InferField) => {
if (field.relation && field.resource) {
const variableName = `${getVariableName(field.key, "Data")}?.data`;
if (Array.isArray(field.accessor)) {
Function dataProvider
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const dataProvider = (
apiKey: string,
baseId: string,
airtableClient?: AirtableBase,
): Required<DataProvider> => {
Function transformer
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default async function transformer(file: FileInfo, api: API) {
const j = api.jscodeshift;
const source = j(file.source);
const refineElement = source.find(j.JSXElement, {
Function runTests
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const runTests = async () => {
const examplesToRun = getProjectsWithE2E();
if (examplesToRun.length === 0) {
return { success: true, empty: true };
- 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 convertToLegacy
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function convertToLegacy(segments: KeySegment[]) {
// for `list`, `many` and `one`
if (segments[0] === "data") {
// [data, dpName, resource, action, ...];
const newSegments = segments.slice(1);
- 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"