Showing 163 of 163 total issues
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 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 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 idle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
idle({ pointerType, scope }: SearchDetails) {
for (const interaction of scope.interactions.list) {
// if there's already a pointer held down
if (interaction.pointers.length === 1) {
const target = interaction.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 validateMatches
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
interaction: Interaction,
pointer: PointerType,
event: PointerEventType,
matches: Interactable[],
matchElements: 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 dropCheckMethod
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
interactable: Interactable,
dragEvent: InteractEvent,
event: PointerEventType,
draggable: Interactable,
draggableElement: Element,
Function checkResizeEdge
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
name: string,
value: any,
page: Point,
element: Node,
interactableElement: Element,
Function getQuadraticCurvePoint
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
startX: number,
startY: number,
cpX: number,
cpY: number,
endX: number,
Function dropCheck
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
this: Interactable,
dragEvent,
event,
draggable,
draggableElement,
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
Function setAll
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setAll(arg: MethodArg & Partial<ModifierArg>): ModificationResult {
const { phase, preEnd, skipModifiers, rect: unmodifiedRect, edges: unmodifiedEdges } = arg
arg.coords = extend({}, arg.pageCoords)
arg.rect = extend({}, unmodifiedRect)
- 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 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"
Further reading
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 (optionsMatch(entry.options, options)) {
entry.func(fakeEvent)
}
Function off
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
off(type: string, listener: ListenersArg) {
const listeners = normalize(type, listener)
for (type in listeners) {
const eventList = this.types[type]
- 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"