Showing 756 of 987 total issues
Function relationHooksCode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
imports.push(["GetManyResponse", "@refinedev/core"]);
imports.push(["useMany", "@refinedev/core"]);
Function mapped
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapped: Array<InferField> = fields.map((field) => {
if (
!field.relation &&
(field.type === "text" ||
field.type === "richtext" ||
Function ThemedHeader
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ThemedHeader: React.FC<RefineThemedLayoutHeaderProps> = () => {
const theme = useMantineTheme();
const authProvider = useActiveAuthProvider();
const { data: user } = useGetIdentity({
Function richtextFields
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const richtextFields = (field: InferField) => {
if (field.type === "richtext") {
imports.push(["Textarea", "@mantine/core"]);
initialValues = {
Function relationHooksCode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
imports.push(["GetManyResponse", "@refinedev/core"]);
imports.push(["useMany", "@refinedev/core"]);
Function relationHooksCode
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
imports.push(["GetManyResponse", "@refinedev/core"]);
imports.push(["useMany", "@refinedev/core"]);
Function booleanFields
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
return jsx`
Function booleanFields
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(["Checkbox", "@mantine/core"]);
initialValues = {
Function textFields
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const textFields = (field: InferField) => {
if (field.type === "text") {
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
return jsx`
Function placement
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
const placement = React.useMemo(() => {
const tooltipBaseSize = { width: 22, height: 22 };
const nameWidth = name.length * 7.5;
const tooltipSize = {
width: tooltipBaseSize.width + nameWidth,
Function CommandBar
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CommandBar: React.FC = () => {
const searchStyle = {
padding: "12px 16px",
fontSize: "16px",
width: "100%",
Function parse
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: () => {
let params = useParams();
const { pathname, search } = useLocation();
const { resources } = useContext(ResourceContext);
Function getOperationFields
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getOperationFields = (documentNode: DocumentNode) => {
const fieldLines: string[] = [];
let isInitialEnter = true;
let depth = 0;
let isNestedField = false;
Function transformCrudFiltersToFilterModel
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const transformCrudFiltersToFilterModel = (
crudFilters: CrudFilters,
columnsType?: Record<string, string>,
): GridFilterModel | undefined => {
const gridFilterItems: GridFilterItem[] = [];
Function useRefineContext
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const useRefineContext = () => {
const {
Footer,
Header,
Layout,
Function serveProxy
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const serveProxy = async (app: Express) => {
let { token, jwt } = await loadAuth();
const authProxy = createProxyMiddleware({
target: REFINE_API_URL,
- 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 List
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const List: React.FC<ListProps> = ({
canCreate,
title,
children,
createButtonProps: createButtonPropsFromProps,
- 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 go
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
go: () => {
const { search: existingSearch, hash: existingHash } = useLocation();
const navigate = useNavigate();
const fn = useCallback(
- 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 List
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const List: React.FC<ListProps> = (props) => {
const {
canCreate,
children,
createButtonProps: createButtonPropsFromProps,
- 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 SelectableElement
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const SelectableElement = ({
element,
name,
onSelect,
}: {
- 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"