Showing 812 of 823 total issues
Function buildFilters
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const buildFilters = (filters: LogicalFilter[] | CrudFilter[] = []) => {
const result: { [key: string]: { [key: string]: string | number } } = {};
filters
.filter((f) => {
Function addColumnsToUseDataGrid
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const addColumnsToUseDataGrid = (j: JSCodeshift, root: Collection<any>) => {
const dataGridElement = root.find(j.JSXElement, {
openingElement: {
name: {
name: "DataGrid",
Function getMetaProps
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getMetaProps = (
identifier?: string,
meta?: InferencerComponentProps["meta"],
actions?: Action[],
) => {
Function booleanFields
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(["Checkbox", "antd"]);
if (field.multiple) {
Function richtextFields
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const richtextFields = (field: InferField) => {
if (field?.type === "richtext") {
imports.push(["MarkdownField", "@refinedev/antd"]);
const dataIndex =
Function dateFields
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const dateFields = (field: InferField) => {
if (field.type === "date") {
imports.push(["DatePicker", "antd"], ["dayjs", "dayjs", true]);
if (field.multiple) {
Function mapOperator
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const mapOperator = (operator: CrudOperators) => {
switch (operator) {
case "ne":
return "neq";
case "nin":
Function createResourceRoutes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const createResourceRoutes = (resources: ResourceProps[]) => {
const routes = resources.flatMap((resource) => {
const actions: {
action: Action;
element: React.ComponentType<any>;
Function handleMouseMove
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleMouseMove = (e: MouseEvent) => {
if (resizing?.[1] === "x") {
const diff = e.clientX - (resizePosition?.x ?? e.clientX);
const newWidth =
panelSize.width + (resizing === "lx" ? -diff : diff) * 2;
Function createTreeView
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const createTreeView = (
resources: IResourceItem[] | IMenuItem[],
): ITreeMenu[] | ITreeMenu[] => {
const tree = [];
const resourcesRouteObject: { [key: string]: any } = {};
Function generateFilters
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const generateFilters = (filters: LogicalFilter[]) => {
const result: { [key: string]: { [key: string]: string | number } } = {};
filters
.filter((f) => {
Function promptInteractiveRefineUpdate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const promptInteractiveRefineUpdate = async (
packages: RefinePackageInstalledVersionData[],
) => {
const uiGroup = createUIGroup(packages);
if (!uiGroup) {
Function getRunnerDescription
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getRunnerDescription = (runner: "dev" | "start" | "build") => {
let projectType = getProjectType();
let command: string[] = [];
switch (runner) {
Function Header
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const Header: React.FC<RefineLayoutHeaderProps> = () => {
const authProvider = useActiveAuthProvider();
const { data: user } = useGetIdentity({
v3LegacyAuthProviderCompatible: Boolean(authProvider?.isLegacy),
});
Function asyncDebounce
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const asyncDebounce = <T extends (...args: any[]) => any>(
func: T,
wait = 1000,
cancelReason?: string,
): DebouncedFunction<T> => {
Function flattenObjectKeys
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const flattenObjectKeys = (obj: any, prefix = "") => {
if (!isNested(obj)) {
return {
[prefix]: obj,
};
Function updateSetEditIdToSetId
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const updateSetEditIdToSetId = (j: JSCodeshift, root: Collection<any>) => {
const updatedFormHooks = [
"useEditableTable",
"useModalForm",
"useDrawerForm",
Function getInstalledPackageJSONPath
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const getInstalledPackageJSONPath = async (packageName: string) => {
try {
const filesFromGlobbySearch = await globby(
`node_modules/${packageName}/package.json`,
{
Function updateActionButtonsPropstoHeaderButtons
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const updateActionButtonsPropstoHeaderButtons = (
j: JSCodeshift,
root: Collection<any>,
) => {
const components = ["Show", "Edit", "List", "Create"];
Function checkGitStatus
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function checkGitStatus(force) {
let clean = false;
let errorMessage = "Unable to determine if git directory is clean";
try {
clean = isGitClean.sync(process.cwd());