Showing 580 of 800 total issues
Function editUrl
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const editUrl = (
resource: string | IResourceItem,
id: BaseKey,
meta: MetaDataQuery = {},
) => {
Function cloneUrl
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const cloneUrl = (
resource: string | IResourceItem,
id: BaseKey,
meta: MetaDataQuery = {},
) => {
Function showUrl
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const showUrl = (
resource: string | IResourceItem,
id: BaseKey,
meta: MetaDataQuery = {},
) => {
Function useNotificationProvider
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const useNotificationProvider = (): NotificationProvider => {
const toast = useToast({
position: "top-right",
isClosable: true,
});
- 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 getOperation
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const getOperation = (
req: CyHttpMessages.IncomingHttpRequest,
): Operation | null => {
const query = req.body.query as string;
- 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 printSwizzleMessage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const printSwizzleMessage = ({
label,
files,
message = "**`Warning:`** You should use the component where you want to use it.",
}: Params) => {
- 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 useRedirectionAfterSubmission
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
() => {
const { show, edit, list, create } = useNavigation();
const handleSubmitWithRedirect = 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 basicToRelation
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const basicToRelation: FieldTransformer = (
fields,
resources,
resource,
record,
Function renameUseTableQueryResult
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const renameUseTableQueryResult = (
j: JSCodeshift,
source: Collection,
) => {
const renameProperties = (prop) => {
Function imageFields
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const imageFields = (field: InferField) => {
if (field.type === "image") {
if (field.multiple) {
const val = accessor("item", undefined, field.accessor);
return jsx`
Function booleanFields
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(["BooleanField", "@refinedev/mui"]);
if (field.multiple) {
Function emailFields
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const emailFields = (field: InferField) => {
if (field.type === "email") {
imports.push(["EmailField", "@refinedev/mui"]);
if (field.multiple) {
Function getInstalledRefinePackagesFromNodeModules
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getInstalledRefinePackagesFromNodeModules = async () => {
const REFINE_PACKAGES = ["core"];
try {
const packagesFromGlobbySearch = await globby("node_modules/@refinedev/*", {
Function urlFields
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const urlFields = (field: InferField) => {
if (field.type === "url") {
imports.push(["UrlField", "@refinedev/mui"]);
if (field.multiple) {
Function addOrUpdateImports
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const addOrUpdateImports = (
j: JSCodeshift,
source: Collection,
importPath: string,
importIdentifierNames: string[],
Function numberFields
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const numberFields = (field: InferField) => {
if (field.type === "number") {
imports.push(["NumberField", "@refinedev/mui"]);
if (field.multiple) {
Function liveProvider
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const liveProvider = (client: Ably.Realtime): LiveProvider => {
return {
subscribe: ({ channel, types, params, callback }) => {
const channelInstance = client.channels.get(channel);
Function relationHooksCode
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
.map((field) => {
if (field?.relation && !field.fieldable && field.resource) {
imports.push(["useMany", "@refinedev/core"]);
let idsString = "";
Function booleanFields
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const booleanFields = (field: InferField) => {
if (field.type === "boolean") {
imports.push(["BooleanField", "@refinedev/mantine"]);
if (field.multiple) {
Function urlFields
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const urlFields = (field: InferField) => {
if (field.type === "url") {
imports.push(["UrlField", "@refinedev/mantine"]);
if (field.multiple) {