Showing 321 of 611 total issues
Function internalRemoveData
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function internalRemoveData( elem, name, pvt ) {
if ( !acceptData( elem ) ) {
return;
}
Function internalData
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !acceptData( elem ) ) {
return;
}
Function DocumentView
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
t2 = e.defer, n = e.makeElement, e.DocumentView = function(o2) {
function r() {
r.__super__.constructor.apply(this, arguments), this.element = this.options.element, this.elementStore = new e.ElementStore(), this.setDocument(this.object);
}
var s, a, u;
Function _iterableToArrayLimit
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
import e from"jquery";function _typeof(e){_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};return _typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||false;n.configurable=true;"value"in n&&(n.writable=true);Object.defineProperty(e,n.key,n)}}function _createClass(e,t,i){t&&_defineProperties(e.prototype,t);i&&_defineProperties(e,i);return e}function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _isNativeReflectConstruct(){if("undefined"===typeof Reflect||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if("function"===typeof Proxy)return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return true}catch(e){return false}}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function _createSuperInternal(){var i,n=_getPrototypeOf(e);if(t){var s=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _superPropBase(e,t){while(!Object.prototype.hasOwnProperty.call(e,t)){e=_getPrototypeOf(e);if(null===e)break}return e}function _get(e,t,i){_get="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function _get(e,t,i){var n=_superPropBase(e,t);if(n){var s=Object.getOwnPropertyDescriptor(n,t);return s.get?s.get.call(i):s.value}};return _get(e,t,i||e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var i=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n=[];var s=true;var a=false;var o,r;try{for(i=i.call(e);!(s=(o=i.next()).done);s=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){a=true;r=e}finally{try{s||null==i.return||i.return()}finally{if(a)throw r}}return n}}function _unsupportedIterableToArray(e,t){if(e){if("string"===typeof e)return _arrayLikeToArray(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);return"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function rtl(){return"rtl"===e("html").attr("dir")}
- 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 PieceView
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
i = e.makeElement, t2 = e.findInnerElement, n = e.getTextConfig, e.PieceView = function(r2) {
function s() {
var t3;
s.__super__.constructor.apply(this, arguments), this.piece = this.object, this.attributes = this.piece.getAttributes(), t3 = this.options, this.textConfig = t3.textConfig, this.context = t3.context, this.piece.attachment ? this.attachment = this.piece.attachment : this.string = this.piece.toString();
}
Function select
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
select = Sizzle.select = function( selector, context, results, seed ) {
var i, tokens, token, type, find,
compiled = typeof selector === "function" && selector,
match = !seed && tokenize( (selector = compiled.selector || selector) );
Function _slide
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_slide(order2, element = null) {
if (this._isSliding) {
return;
}
const activeElement = this._getActive();
Function matcherFromTokens
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[0].type ],
implicitRelative = leadingRelative || Expr.relative[" "],
Function tokenize
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
Function val
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
val: function( value ) {
var hooks, ret, isFunction,
elem = this[ 0 ];
if ( !arguments.length ) {
Function computeStyleTests
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function computeStyleTests() {
var contents, divStyle,
documentElement = document.documentElement;
// Setup
Function forceUpdate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
forceUpdate: function forceUpdate() {
if (isDestroyed) {
return;
}
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
Consider simplifying this complex logical expression. Open
Open
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
Consider simplifying this complex logical expression. Open
Open
function _setup(t,i){this.$element=t;this.options=e.extend({},Tooltip.defaults,this.$element.data(),i);this.className="Tooltip";this.isActive=false;this.isClick=false;k.init(e);this._init()}},{key:"_init",value:function _init(){i._init();var t=this.$element.attr("aria-describedby")||GetYoDigits(6,"tooltip");this.options.tipText=this.options.tipText||this.$element.attr("title");this.template=this.options.template?e(this.options.template):this._buildTemplate(t);this.options.allowHtml?this.template.appendTo(document.body).html(this.options.tipText).hide():this.template.appendTo(document.body).text(this.options.tipText).hide();this.$element.attr({title:"","aria-describedby":t,"data-yeti-box":t,"data-toggle":t,"data-resize":t}).addClass(this.options.triggerClass);_get(_getPrototypeOf(Tooltip.prototype),"_init",this).call(this);this._events()}},{key:"_getDefaultPosition",value:function _getDefaultPosition(){var e=this.$element[0].className;this.$element[0]instanceof SVGElement&&(e=e.baseVal);var t=e.match(/\b(top|left|right|bottom)\b/g);return t?t[0]:"top"}},{key:"_getDefaultAlignment",value:function _getDefaultAlignment(){return"center"}},{key:"_getHOffset",value:function _getHOffset(){return"left"===this.position||"right"===this.position?this.options.hOffset+this.options.tooltipWidth:this.options.hOffset}},{key:"_getVOffset",value:function _getVOffset(){return"top"===this.position||"bottom"===this.position?this.options.vOffset+this.options.tooltipHeight:this.options.vOffset}},{key:"_buildTemplate",value:function _buildTemplate(t){var i="".concat(this.options.tooltipClass," ").concat(this.options.templateClasses).trim();var n=e("<div></div>").addClass(i).attr({role:"tooltip","aria-hidden":true,"data-is-active":false,"data-is-focus":false,id:t});return n}},{key:"_setPosition",value:function _setPosition(){_get(_getPrototypeOf(Tooltip.prototype),"_setPosition",this).call(this,this.$element,this.template)}},{key:"show",value:function show(){if("all"!==this.options.showOn&&!i.is(this.options.showOn))return false;var e=this;this.template.css("visibility","hidden").show();this._setPosition();this.template.removeClass("top bottom left right").addClass(this.position);this.template.removeClass("align-top align-bottom align-left align-right align-center").addClass("align-"+this.alignment);this.$element.trigger("closeme.zf.tooltip",this.template.attr("id"));this.template.attr({"data-is-active":true,"aria-hidden":false});e.isActive=true;this.template.stop().hide().css("visibility","").fadeIn(this.options.fadeInDuration,(function(){}));this.$element.trigger("show.zf.tooltip")}},{key:"hide",value:function hide(){var e=this;this.template.stop().attr({"aria-hidden":true,"data-is-active":false}).fadeOut(this.options.fadeOutDuration,(function(){e.isActive=false;e.isClick=false}));this.$element.trigger("hide.zf.tooltip")}},{key:"_events",value:function _events(){var e=this;var t="ontouchstart"in window||"undefined"!==typeof window.ontouchstart;var i=false;if(!t||!this.options.disableForTouch){this.options.disableHover||this.$element.on("mouseenter.zf.tooltip",(function(){e.isActive||(e.timeout=setTimeout((function(){e.show()}),e.options.hoverDelay))})).on("mouseleave.zf.tooltip",ignoreMousedisappear((function(){clearTimeout(e.timeout);(!i||e.isClick&&!e.options.clickOpen)&&e.hide()})));t&&this.$element.on("tap.zf.tooltip touchend.zf.tooltip",(function(){e.isActive?e.hide():e.show()}));this.options.clickOpen?this.$element.on("mousedown.zf.tooltip",(function(){if(e.isClick);else{e.isClick=true;!e.options.disableHover&&e.$element.attr("tabindex")||e.isActive||e.show()}})):this.$element.on("mousedown.zf.tooltip",(function(){e.isClick=true}));this.$element.on({"close.zf.trigger":this.hide.bind(this)});this.$element.on("focus.zf.tooltip",(function(){i=true;if(e.isClick){e.options.clickOpen||(i=false);return false}e.show()})).on("focusout.zf.tooltip",(function(){i=false;e.isClick=false;e.hide()})).on("resizeme.zf.trigger",(function(){e.isActive&&e._setPosition()}))}}},{key:"toggle",value:function toggle(){this.isActive?this.hide():this.show()}},{key:"_destroy",value:function _destroy(){this.$element.attr("title",this.template.text()).off(".zf.trigger .zf.tooltip").removeClass(this.options.triggerClass).removeClass("top right left bottom").removeAttr("aria-describedby data-disable-hover data-resize data-toggle data-tooltip data-yeti-box");this.template.remove()}}]);return Tooltip}(R);Q.defaults={
Consider simplifying this complex logical expression. Open
Open
else if (relUrl[0] === '.' && (relUrl[1] === '/' || relUrl[1] === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
relUrl.length === 1 && (relUrl += '/')) ||
relUrl[0] === '/') {
const parentProtocol = parentUrl.slice(0, parentUrl.indexOf(':') + 1);
// Disabled, but these cases will give inconsistent results for deep backtracking
Consider simplifying this complex logical expression. Open
Open
*/},{key:"_enableScroll",value:function _enableScroll(t){t=t||parseInt(e("html").css("top"),10);if(e(document).height()>e(window).height()){e("html").css("top","");e(window).scrollTop(-t)}}},{key:"open",value:function open(){var t=this;var i="#".concat(this.id);this.options.deepLink&&window.location.hash!==i&&(window.history.pushState?this.options.updateHistory?window.history.pushState({},"",i):window.history.replaceState({},"",i):window.location.hash=i);this.$activeAnchor=e(document.activeElement).is(this.$anchor)?e(document.activeElement):this.$anchor;this.isActive=true;this.$element.css({visibility:"hidden"}).show().scrollTop(0);this.options.overlay&&this.$overlay.css({visibility:"hidden"}).show();this._updatePosition();this.$element.hide().css({visibility:""});if(this.$overlay){this.$overlay.css({visibility:""}).hide();this.$element.hasClass("fast")?this.$overlay.addClass("fast"):this.$element.hasClass("slow")&&this.$overlay.addClass("slow")}this.options.multipleOpened||this.$element.trigger("closeme.zf.reveal",this.id);0===e(".reveal:visible").length&&this._disableScroll();var n=this;if(this.options.animationIn){var s=function afterAnimation(){n.$element.attr({"aria-hidden":false,tabindex:-1}).focus();n._addGlobalClasses();l.trapFocus(n.$element)};this.options.overlay&&d.animateIn(this.$overlay,"fade-in");d.animateIn(this.$element,this.options.animationIn,(function(){if(t.$element){t.focusableElements=l.findFocusable(t.$element);s()}}))}else{this.options.overlay&&this.$overlay.show(0);this.$element.show(this.options.showDelay)}this.$element.attr({"aria-hidden":false,tabindex:-1}).focus();l.trapFocus(this.$element);this._addGlobalClasses();this._addGlobalListeners();this.$element.trigger("open.zf.reveal")}},{key:"_addGlobalClasses",value:function _addGlobalClasses(){var t=function updateScrollbarClass(){e("html").toggleClass("zf-has-scroll",!!(e(document).height()>e(window).height()))};this.$element.on("resizeme.zf.trigger.revealScrollbarListener",(function(){return t()}));t();e("html").addClass("is-reveal-open")}},{key:"_removeGlobalClasses",value:function _removeGlobalClasses(){this.$element.off("resizeme.zf.trigger.revealScrollbarListener");e("html").removeClass("is-reveal-open");e("html").removeClass("zf-has-scroll")}},{key:"_addGlobalListeners",value:function _addGlobalListeners(){var t=this;if(this.$element){this.focusableElements=l.findFocusable(this.$element);this.options.overlay||!this.options.closeOnClick||this.options.fullScreen||e("body").on("click.zf.dropdown tap.zf.dropdown",(function(i){i.target!==t.$element[0]&&!e.contains(t.$element[0],i.target)&&e.contains(document,i.target)&&t.close()}));this.options.closeOnEsc&&e(window).on("keydown.zf.reveal",(function(e){l.handleKey(e,"Reveal",{close:function close(){t.options.closeOnEsc&&t.close()}})}))}}},{key:"close",value:function close(){if(!this.isActive||!this.$element.is(":visible"))return false;var t=this;if(this.options.animationOut){this.options.overlay&&d.animateOut(this.$overlay,"fade-out");d.animateOut(this.$element,this.options.animationOut,finishUp)}else{this.$element.hide(this.options.hideDelay);this.options.overlay?this.$overlay.hide(0,finishUp):finishUp()}this.options.closeOnEsc&&e(window).off("keydown.zf.reveal");!this.options.overlay&&this.options.closeOnClick&&e("body").off("click.zf.dropdown tap.zf.dropdown");this.$element.off("keydown.zf.reveal");function finishUp(){var i=parseInt(e("html").css("top"),10);0===e(".reveal:visible").length&&t._removeGlobalClasses();l.releaseFocus(t.$element);t.$element.attr("aria-hidden",true);0===e(".reveal:visible").length&&t._enableScroll(i);t.$element.trigger("closed.zf.reveal")}this.options.resetOnClose&&this.$element.html(this.$element.html());this.isActive=false;if(t.options.deepLink&&window.location.hash==="#".concat(this.id))if(window.history.replaceState){var i=window.location.pathname+window.location.search;this.options.updateHistory?window.history.pushState({},"",i):window.history.replaceState("",document.title,i)}else window.location.hash="";this.$activeAnchor.focus()}},{key:"toggle",value:function toggle(){this.isActive?this.close():this.open()}},{key:"_destroy",value:function _destroy(){if(this.options.overlay){this.$element.appendTo(e(this.options.appendTo));this.$overlay.hide().off().remove()}this.$element.hide().off();this.$anchor.off(".zf");e(window).off(".zf.reveal:".concat(this.id));this.onLoadListener&&e(window).off(this.onLoadListener);0===e(".reveal:visible").length&&this._removeGlobalClasses()}}]);return Reveal}(C);Y.defaults={
Consider simplifying this complex logical expression. Open
Open
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
return currentNode;
} else {
currentNode = currentNode.parentNode;
}
Function extend
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.extend = jQuery.fn.extend = function() {
var src, copyIsArray, copy, name, options, clone,
target = arguments[ 0 ] || {},
i = 1,
length = arguments.length,
Function stop
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
stop: function( type, clearQueue, gotoEnd ) {
var stopQueue = function( hooks ) {
var stop = hooks.stop;
delete hooks.stop;
stop( gotoEnd );
Function initPromise
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const initPromise = featureDetectionPromise.then(() => {
baselinePassthrough = esmsInitOptions.polyfillEnable !== true && supportsDynamicImport && supportsImportMeta && supportsImportMaps && (!jsonModulesEnabled || supportsJsonAssertions) && (!cssModulesEnabled || supportsCssAssertions) && !importMapSrcOrLazy && !false;
if (hasDocument) {
if (!supportsImportMaps) {
const supports = HTMLScriptElement.supports || (type => type === 'classic' || type === 'module');