Showing 163 of 163 total issues
Function resizable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function resizable(interactable: Interactable, options: OrBoolean<ResizableOptions> | boolean, scope: Scope) {
if (is.object(options)) {
interactable.options.resize.enabled = options.enabled !== false
interactable.setPerAction('resize', options)
interactable.setOnEvents('resize', options)
- 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 updateEventAxes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function updateEventAxes({
iEvent,
interaction,
}: {
iEvent: InteractEvent<any, any>
- 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 getTouchPair
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function getTouchPair(event: TouchEvent | PointerType[]) {
const touches: PointerType[] = []
// array of touches is supplied
if (is.array(event)) {
- 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 beforeEnd
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
beforeEnd(arg: Omit<DoAnyPhaseArg, 'iEvent'> & { state?: ModifierState }): void | false {
const { interaction, event } = arg
const states = this.states
if (!states || !states.length) {
- 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 dropCheckMethod
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function dropCheckMethod(
interactable: Interactable,
dragEvent: InteractEvent,
event: PointerEventType,
draggable: Interactable,
- 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 forEachMatch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
forEachMatch<T>(node: Node, callback: (interactable: Interactable) => T): T | void {
for (const interactable of this.list) {
let ret: T
if (
- 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 checkResizeEdge
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
name: string,
value: any,
page: Point,
element: Node,
interactableElement: Element,
Function dropCheck
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
this: Interactable,
dragEvent,
event,
draggable,
draggableElement,
Function validateMatches
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
interaction: Interaction,
pointer: PointerType,
event: PointerEventType,
matches: Interactable[],
matchElements: Element[],
Function dropCheckMethod
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
interactable: Interactable,
dragEvent: InteractEvent,
event: PointerEventType,
draggable: Interactable,
draggableElement: Element,
Function checker
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
_dragEvent: Interact.Element, // related dragmove or dragend
_event: Event, // Touch, Pointer or Mouse Event
dropped: boolean, // bool default checker result
_dropzone: Interact.Interactable, // dropzone Interactable
dropElement: Interact.Element, // dropzone elemnt
Function getQuadraticCurvePoint
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
startX: number,
startY: number,
cpX: number,
cpY: number,
endX: number,
Function setInteractionCursor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function setInteractionCursor<T extends ActionName>(interaction: Interaction<T>, scope: Scope) {
const { interactable, element, prepared } = interaction
if (!(interaction.pointerType === 'mouse' && interactable && interactable.options.styleCursor)) {
// clear previous target element cursor
- 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
Avoid deeply nested control flow statements. Open
if (optionsMatch(entry.options, options)) {
entry.func(fakeEvent)
}
Function pointerMove
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
pointerMove(pointer: PointerType, event: PointerEventType, eventTarget: Node) {
if (!this.simulation && !(this.modification && this.modification.endResult)) {
this.updatePointer(pointer, event, eventTarget, false)
}
- 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
Avoid deeply nested control flow statements. Open
if (deps[name] === previousVersion) {
deps[name] = currentVersion
} else {
console.warn(`${file}: not updating "${name}" from "${deps[name]}"`)
}
Function startOnMove
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function startOnMove(arg: SignalArgs['interactions:move'], scope: Scope) {
const { interaction } = arg
if (
!interaction.pointerIsDown ||
- 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
Avoid deeply nested control flow statements. Open
if (!listeners.length) {
delegates.splice(index, 1)
// remove delegate function from context
remove(context, type, delegateListener)
Avoid deeply nested control flow statements. Open
if (typeListeners.length === 0) {
delete target.events[type]
typeIsEmpty = true
}
Function makeModifier
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function makeModifier<
Defaults extends { enabled?: boolean },
State extends ModifierState,
Name extends string,
Result,
- 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"