packages/codemod/src/transformations/v4/fix-v4-deprecations.ts
Function fixDeprecatedReactTableProps
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fixDeprecatedReactTableProps = (j: JSCodeshift, source: Collection) => {
const refineReactTableImports = source.find(j.ImportDeclaration, {
source: {
value: "@pankod/refine-react-table",
},
Function fixDeprecatedUseTableProps
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fixDeprecatedUseTableProps = (j: JSCodeshift, source: Collection) => {
const willCheckImports = ["useTable", "useDataGrid"];
willCheckImports.forEach((hook) => {
const useTableHooks = source.find(j.CallExpression, {
Function fixUseSelectHasPaginationToPaginationMode
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fixUseSelectHasPaginationToPaginationMode = (
j: JSCodeshift,
source: Collection,
) => {
const useSelectHooks = source.find(j.CallExpression, {
Function fixUseListHasPaginationToPaginationMode
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const fixUseListHasPaginationToPaginationMode = (
j: JSCodeshift,
source: Collection,
) => {
const useListHooks = source.find(j.CallExpression, {
Function resourceOptionstoMeta
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const resourceOptionstoMeta = (j: JSCodeshift, source: Collection) => {
const refineElement = source.find(j.JSXElement, {
openingElement: {
name: {
name: "Refine",
Function sortToSorters
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const sortToSorters = (j: JSCodeshift, source: Collection) => {
const willCheckHooks = [
"useCheckboxGroup",
"useRadioGroup",
"useSelect",
Function sorterToSorters
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const sorterToSorters = (j: JSCodeshift, source: Collection) => {
const willCheckHooks = ["useExport"];
willCheckHooks.forEach((hookName) => {
const useListHooks = source.find(j.CallExpression, {
Function resourceNametoResource
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const resourceNametoResource = (j: JSCodeshift, source: Collection) => {
const willCheckHooks = ["useExport", "useImport"];
willCheckHooks.forEach((hookName) => {
const useListHooks = source.find(j.CallExpression, {
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 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 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 filtersProperties
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const filtersProperties = deprecatedUseTableFiltersProps.map((prop) => {
const property = (
(hasRefineCoreProps as ObjectProperty).value as ObjectExpression
).properties.find((p: Property) => (p.key as Identifier).name === prop);
Function filtersProperties
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const filtersProperties = deprecatedUseTableFiltersProps.map((prop) => {
const property = (
p.node.arguments[0] as ObjectExpression
).properties.find((p: Property) => (p.key as Identifier).name === prop);
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return;