Showing 163 of 163 total issues
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 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
Function start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
start(event: PointerEventType) {
const { interaction } = this
const options = getOptions(interaction)
if (!options || !options.enabled) {
- 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
Consider simplifying this complex logical expression. Open
if (
(is.element(accept) && accept !== draggableElement) ||
(is.string(accept) && !domUtils.matchesSelector(draggableElement, accept)) ||
(is.func(accept) && !accept({ dropzone, draggableElement }))
) {
Consider simplifying this complex logical expression. Open
if (
!closest.target ||
(inRange
? // is the closest target in range?
closest.inRange && range !== Infinity
Consider simplifying this complex logical expression. Open
if (
t.isStringLiteral(key) &&
(!include || include.indexOf(key.value) !== -1) &&
(!exclude || exclude.indexOf(key.value) === -1)
) {
Consider simplifying this complex logical expression. Open
if (is.object(resizeOptions.edges)) {
const resizeEdges = {
left: false,
right: false,
top: false,
Consider simplifying this complex logical expression. Open
if (!browser.supportsPointerEvent && /mouse/.test(event.type)) {
// ignore mouse events while touch interactions are active
for (let i = 0; i < interactions.length && !invalidPointer; i++) {
invalidPointer = interactions[i].pointerType !== 'mouse' && interactions[i].pointerIsDown
}
Function _onOff
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Interactable.prototype._onOff = function (method, typeArg, listenerArg, options, filter) {
Function startReflow
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
scope: Scope,
interactable: Interactable,
element: Element,
action: ActionProps<T>,
event: any,
Function addDelegate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
selector: string,
context: Node,
type: string,
listener: ListenerEntry['func'],
optionalArg?: any,
Function validateAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
action: ActionProps<T>,
interactable: Interactable,
element: Element,
eventTarget: Node,
scope: Scope,
Function removeDelegate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
selector: string,
context: Document | Element,
type: string,
listener?: ListenerEntry['func'],
optionalArg?: any,
Function getActionInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
interaction: Interaction,
pointer: PointerType,
event: PointerEventType,
eventTarget: Node,
scope: Scope,
Function getAction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this: Interactable,
pointer: PointerType,
event: PointerEventType,
interaction: Interaction,
element: Element,
Function defaultActionChecker
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
interactable: Interactable,
event: PointerEventType,
interaction: Interaction,
element: Element,
scope: Scope,
Function shallowEqual
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function shallowEqual(left: any, right: any) {
if (left === right) {
return 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 updateGestureProps
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function updateGestureProps({ interaction, iEvent, phase }: GestureSignalArg) {
if (interaction.prepared.name !== 'gesture') return
const pointers = interaction.pointers.map((p) => p.pointer)
const starting = phase === 'start'
- 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 getPointerType
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getPointerType(pointer: { pointerType?: string; identifier?: number; type?: string }) {
return is.string(pointer.pointerType)
? pointer.pointerType
: is.number(pointer.pointerType)
? [undefined, undefined, 'touch', 'pen', 'mouse'][pointer.pointerType]!
- 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 set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
set(options: OptionsArg) {
const defaults = this._defaults
if (!is.object(options)) {
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"