Showing 756 of 987 total issues
Function subscribe
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
subscribe({ callback, params, meta }) {
const { resource, subscriptionType } = params ?? {};
if (!meta || !subscriptionType || !resource) {
throw new Error(
Function paginationProperties
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(prop) => {
const property = (
p.node.arguments[0] as ObjectExpression
).properties.find(
(p: Property) => (p.key as Identifier).name === prop,
Function useStepsForm
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useStepsForm = <
TQueryFnData extends BaseRecord = BaseRecord,
TError extends HttpError = HttpError,
TVariables = {},
TData extends BaseRecord = TQueryFnData,
Function getProjectInfo
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getProjectInfo = (path) => {
// read package.json
const pkg = fs.readFileSync(pathJoin(path, "package.json"), "utf8");
// parse package.json
Function renderTreeView
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderTreeView = (tree: ITreeMenu[], selectedKey?: string) => {
return tree.map((item) => {
const { icon, label, route, name, children } = item;
const isSelected = item.key === selectedKey;
Function textFields
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const textFields = (field: InferField) => {
if (field.type === "text") {
imports.push(
["TagField", "@refinedev/antd"],
["TextField", "@refinedev/antd"],
Function booleanFields
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(["Checkbox", "@chakra-ui/react"]);
if (field.multiple) {
Function gitInit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function gitInit(root: string, message: string) {
let didInit = false;
try {
execa.commandSync("git --version", { stdio: "ignore", cwd: root });
Function mergedImports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
([importPath, importMatches]) => {
// example: A
const defaultImport = importMatches.find(
(importMatch) => importMatch.defaultImport,
);
Function operatorMapper
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const operatorMapper = (
operator: CrudOperators,
value: any,
): { [key: string]: any } => {
if (operator === "contains") {
Function generateDefaultDocumentTitle
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function generateDefaultDocumentTitle(
translate: ReturnType<typeof useTranslate>,
resource?: IResourceItem,
action?: string,
id?: string,
Function useCustomConfigSortToSorters
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useCustomConfigSortToSorters = (j: JSCodeshift, source: Collection) => {
const useCustomHooks = source.find(j.CallExpression, {
callee: {
name: "useCustom",
},
Function transform
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
transform: (content) => {
let newContent = content;
const imports = getImports(content);
imports.map((importItem) => {
Function renderTreeView
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderTreeView = (tree: ITreeMenu[], selectedKey?: string) => {
return tree.map((item) => {
const { icon, label, route, name, children } = item;
const isSelected = item.key === selectedKey;
Function renderProviders
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderProviders = () => {
if (providers && providers.length > 0) {
return (
<>
<Stack spacing={8}>
Function basicInputFields
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const basicInputFields = (field: InferField) => {
if (
field.type === "text" ||
field.type === "url" ||
field.type === "email" ||
Function renderProviders
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderProviders = () => {
if (providers && providers.length > 0) {
return (
<>
<Stack spacing={8}>
Function booleanFields
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(
["Checkbox", "@mui/material"],
["FormControlLabel", "@mui/material"],
Function getProjectType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getProjectType = (platform?: ProjectTypes): ProjectTypes => {
if (platform) {
return platform;
}
// read dependencies from package.json
Function createResourcePathWithAction
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const createResourcePathWithAction = (
resource: ResourceProps,
action: Action,
) => {
const { name, list, create, show, edit } = resource;