Showing 16 of 38 total issues
File sortable-item.js
has 511 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable ember/no-computed-properties-in-native-classes */
import Modifier from 'ember-modifier';
import { Promise, defer } from 'rsvp';
import { action, set } from '@ember/object';
import { DRAG_ACTIONS, ELEMENT_CLICK_ACTION, END_ACTIONS } from '../utils/constant';
SortableItemModifier
has 50 functions (exceeds 20 allowed). Consider refactoring. Open
export default class SortableItemModifier extends Modifier {
className = 'sortable-item';
@service('ember-sortable-internal-state') sortableService;
SortableGroupModifier
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
export default class SortableGroupModifier extends Modifier {
/** Primary keyboard utils */
// Tracks the currently selected item
_selectedItem = null;
// Tracks the current move
File sortable-group.js
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable ember/no-computed-properties-in-native-classes */
/* eslint-disable ember/no-incorrect-calls-with-inline-anonymous-functions */
import Modifier from 'ember-modifier';
import { action, computed, set } from '@ember/object';
import {
Function exports
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function () {
return {
usePnpm: true,
scenarios: [
{
Function _scrollOnEdges
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
_scrollOnEdges(drag) {
let groupDirection = this.direction;
let element = this.element;
let scrollContainer = new ScrollContainer(scrollParent(element));
let itemContainer = {
Function _scrollOnEdges
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
_scrollOnEdges(drag) {
let groupDirection = this.direction;
let element = this.element;
let scrollContainer = new ScrollContainer(scrollParent(element));
let itemContainer = {
- 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 drag
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function drag(mode, itemSelector, offsetFn, callbacks = {}) {
let start;
let move;
let end;
let which;
Function exports
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (environment) {
let ENV = {
modulePrefix: 'docs',
environment,
rootURL: '/',
Function _handleKeyboardReorder
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
_handleKeyboardReorder(event) {
const direction = this.direction;
const selectedItem = this._selectedItem;
if (direction === 'y' && isDownArrowKey(event)) {
Function _makeDragHandler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
_makeDragHandler(startEvent) {
const groupDirection = this.direction;
let dragOrigin;
let elementOrigin;
let scrollOrigin;
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (environment) {
let ENV = {
modulePrefix: 'test-app',
environment,
rootURL: '/',
Function drag
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export async function drag(mode, itemSelector, offsetFn, callbacks = {}) {
let start;
let move;
let end;
let which;
- 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 _handleKeyboardReorder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_handleKeyboardReorder(event) {
const direction = this.direction;
const selectedItem = this._selectedItem;
if (direction === 'y' && isDownArrowKey(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 _waitForTransition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_waitForTransition() {
let waiterToken;
if (DEBUG) {
waiterToken = sortableItemWaiter.beginAsync();
- 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 _updateHandleVisualIndicators
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_updateHandleVisualIndicators(item, isUpdate) {
const handleVisualClass = this.handleVisualClass;
if (handleVisualClass === NO_MODEL || !item) {
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"