Showing 750 of 983 total issues
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 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 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 getProjectInfo
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const getProjectInfo = async (path) => {
// read package.json
const pkg = await promisify(fs.readFile)(
pathJoin(path, "package.json"),
"utf8",
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 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 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 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 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;
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 mapAntdSorterToCrudSorting
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const mapAntdSorterToCrudSorting = (
sorter: SorterResult | SorterResult[],
): CrudSorting => {
const crudSorting: CrudSorting = [];
if (Array.isArray(sorter)) {
Function itemRender
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
itemRender: (page, type, element) => {
const link = createLinkForSyncWithLocation({
pagination: {
pageSize,
current: page,
Function itemRender
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
itemRender: (page, type, element) => {
const link = createLinkForSyncWithLocation({
pagination: {
pageSize,
current: page,
Function paginationProperties
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(prop) => {
const property = (
(hasRefineCoreProps as ObjectProperty).value as ObjectExpression
).properties.find((p: Property) => (p.key as Identifier).name === prop);
Function imageFields
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const imageFields = (field: InferField) => {
if (field.type === "image") {
imports.push(["ImageField", "@refinedev/antd"]);
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
Function numberFields
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const numberFields = (field: InferField) => {
if (field.type === "number") {
imports.push(["NumberField", "@refinedev/antd"]);
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
Function dateFields
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
imports.push(["DateField", "@refinedev/antd"]);
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);