Showing 163 of 163 total issues
Function inertiaTick
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
inertiaTick() {
const { interaction } = this
const options = getOptions(interaction)
const lambda = options.resistance
const t = (interaction._now() - this.t0) / 1000
Function constructor
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
constructor(
interaction: Interaction<T>,
event: PointerEventType,
actionName: T,
phase: P,
- 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 simulationResume
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
simulationResume({ pointerType, eventType, eventTarget, scope }: SearchDetails) {
if (!/down|start/i.test(eventType)) {
return null
}
- 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 onInteractionMove
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
onInteractionMove<T extends ActionName>({
interaction,
pointer,
}: {
interaction: Interaction<T>
- 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 move
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function move({ iEvent, interaction }: { iEvent: InteractEvent<any, any>; interaction: Interaction }) {
if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) return
const resizeEvent = iEvent as ResizeEvent
const resizeOptions = interaction.interactable.options.resize
- 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 fire
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function fire<T extends string>(
arg: {
pointer: PointerType | PointerEvent<any>
event: PointerEventType | PointerEvent<any>
eventTarget: Node
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function makeModifier<
Defaults extends { enabled?: boolean },
State extends ModifierState,
Name extends string,
Result,
Function withinInteractionLimit
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function withinInteractionLimit<T extends ActionName>(
interactable: Interactable,
element: Element,
action: ActionProps<T>,
scope: Scope,
Function install
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function install(scope: Scope) {
const { actions, interactStatic: interact, Interactable, defaults } = scope
scope.usePlugin(drag)
Consider simplifying this complex logical expression. Open
if (
// ignore disabled modifiers
!options ||
options.enabled === false ||
// check if we require endOnly option to fire move before end
Function _onOff
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onOff(
method: OnOffMethod,
typeArg: EventTypes,
listenerArg?: ListenersArg | null,
options?: any,
Function start
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start(arg: ModifierArg<SnapState>) {
const { interaction, interactable, element, rect, state, startOffset } = arg
const { options } = state
const origin = options.offsetWithOrigin ? getOrigin(arg) : { x: 0, y: 0 }
Function startReflow
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function startReflow<T extends ActionName>(
scope: Scope,
interactable: Interactable,
element: Element,
action: ActionProps<T>,
Function transformImportsToRelative
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function transformImportsToRelative() {
const fixImportSource = ({ node: { source } }, { opts, filename }) => {
if (!source || (opts.ignore && opts.ignore(filename))) return
const { moduleDirectory = getModuleDirectories() } = opts
Function usePlugin
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
usePlugin(plugin: Plugin, options?: { [key: string]: any }) {
if (!this.isInitialized) {
return this
}
Function getDropEvents
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function getDropEvents(interaction: Interaction, _pointerEvent, dragEvent: DragEvent) {
const dropState = interaction.dropState!
const dropEvents: Record<string, DropEvent | null> = {
enter: null,
leave: null,
- 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 checkAndPreventDefault
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function checkAndPreventDefault(interactable: Interactable, scope: Scope, event: Event) {
const setting = interactable.options.preventDefault
if (setting === 'never') return
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
function set(arg) {
const { interaction, state, coords } = arg
const { options, offsets } = state
const relative = {
x: coords.x - offsets[0].x,
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
function start({ rect, startOffset, state, interaction, pageCoords }: ModifierArg<RestrictState>) {
const { options } = state
const { elementRect } = options
const offset: Rect = extend(
{
- 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 getEsnextBabelOptions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getEsnextBabelOptions(presetEnvOptions) {
return {
babelrc: false,
configFile: false,
sourceMaps: true,