Showing 750 of 983 total issues
Function MockGoogleButton
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MockGoogleButton = () => {
const { mutate } = useLogin();
return (
<button
Function renderTreeView
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderTreeView = (tree: ITreeMenu[], selectedKey?: string) => {
return tree.map((item: ITreeMenu) => {
const {
icon,
label,
Function moveConfigProvider
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const moveConfigProvider = (j: JSCodeshift, root: Collection<any>) => {
const refineElement = root.find(j.JSXElement, {
openingElement: {
name: {
name: "Refine",
Function booleanFields
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(
["Checkbox", "@mui/material"],
["FormControlLabel", "@mui/material"],
Function booleanFields
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(["Checkbox", "@chakra-ui/react"]);
if (field.multiple) {
Function renderTreeView
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderTreeView = (tree: ITreeMenu[], selectedKey?: string) => {
return tree.map((item: ITreeMenu) => {
const {
icon,
label,
Function RegisterPage
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const RegisterPage: React.FC<RegisterProps> = ({
loginLink,
contentProps,
wrapperProps,
renderContent,
- 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 LoginPage
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const LoginPage: React.FC<LoginProps> = ({
providers,
registerLink,
forgotPasswordLink,
rememberMe,
- 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 run
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const run = async (
example: string | boolean | undefined,
destination?: string,
) => {
const pm = findPM();
- 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 RouteProvider
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
export const RouteProvider = ({
initialRoute,
}: RouteProviderProps): JSX.Element => {
const { resources } = useResource();
const { catchAll, DashboardPage, LoginPage } = useRefineContext();
- 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 assertFormShouldHaveResponseValues
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const assertFormShouldHaveResponseValues = (response: any, ui: UITypes) => {
const body = response?.body;
// assert response values are equal to the form values
switch (ui) {
Function relationHooksCode
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
if (field.multiple) {
imports.push(["useMany", "@refinedev/core"]);
let ids = accessor(recordName, field.key);
Function relationHooksCode
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
if (field.multiple) {
imports.push(["useMany", "@refinedev/core"]);
Function relationHooksCode
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
if (field.multiple) {
imports.push(["useMany", "@refinedev/core"]);
let ids = accessor(recordName, field.key);
Function relationHooksCode
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
if (field.multiple) {
imports.push(["useMany", "@refinedev/core"]);
let ids = accessor(recordName, field.key);
Function basicInputFields
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const basicInputFields = (field: InferField) => {
if (
field.type === "text" ||
field.type === "url" ||
field.type === "email" ||
Function relationHooksCode
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
if (field.multiple) {
imports.push(["useMany", "@refinedev/core"]);
Function clearedFields
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const clearedFields = React.useMemo(() => {
const cleanFields: InferField[] = [];
results.forEach((f, idx, arr) => {
if (f.resource) {
Function replaceImports
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const replaceImports = (content: string): string => {
const matches = content.matchAll(packageRegex);
const imports = new Set();
Consider simplifying this complex logical expression. Open
if (syncWithLocation) {
defaultCurrent =
parsedParams?.params?.current || parsedCurrent || prefferedCurrent || 1;
defaultPageSize =
parsedParams?.params?.pageSize ||