Showing 35 of 96 total issues
Function _clearMenus
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Dropdown._clearMenus = function _clearMenus(event) {
if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
return;
}
Function hide
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto.hide = function hide() {
var _this2 = this;
if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
return;
Function show
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto.show = function show(relatedTarget) {
var _this = this;
if (this._isShown || this._isTransitioning) {
return;
Function _dataApiKeydownHandler
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
// If not input/textarea:
// - And not a key in REGEXP_KEYDOWN => not a dropdown command
// If input/textarea:
// - If space key => not a dropdown command
Function toggle
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto.toggle = function toggle() {
var triggerChangeEvent = true;
var addAriaPressed = true;
var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];
Function _showElement
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto._showElement = function _showElement(relatedTarget) {
var _this3 = this;
var transition = $(this._element).hasClass(ClassName$5.FADE);
Function hide
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto.hide = function hide(event) {
var _this2 = this;
if (event) {
event.preventDefault();
Function _setListeners
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto._setListeners = function _setListeners() {
var _this3 = this;
var triggers = this.config.trigger.split(' ');
triggers.forEach(function (trigger) {
Function refresh
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto.refresh = function refresh() {
var _this2 = this;
var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
Function _getPopperConfig
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto._getPopperConfig = function _getPopperConfig() {
var _this2 = this;
var offsetConf = {};
Function _transitionComplete
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_proto._transitionComplete = function _transitionComplete(element, active, callback) {
if (active) {
$(active).removeClass(ClassName$9.ACTIVE);
var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
Avoid deeply nested control flow statements. Open
Open
if (activeElement) {
$(activeElement).removeClass(ClassName$1.ACTIVE);
}
Consider simplifying this complex logical expression. Open
Open
if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
continue;
}
Consider simplifying this complex logical expression. Open
Open
if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
}
Avoid too many return
statements within this function. Open
Open
return Util.findShadowRoot(element.parentNode);