Showing 611 of 611 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
}, u.prototype.toolbarDidRemoveAttribute = function(t3) {
return this.recordFormattingUndoEntry(t3), this.composition.removeCurrentAttribute(t3), this.render(), this.selectionFrozen ? void 0 : this.editorElement.focus();
}, u.prototype.toolbarWillShowDialog = function() {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 11 locations. Consider refactoring. Open
}, d = {}.hasOwnProperty, f = [].indexOf || function(t3) {
for (var e2 = 0, n2 = this.length; n2 > e2; e2++)
if (e2 in this && this[e2] === t3)
return e2;
return -1;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 11 locations. Consider refactoring. Open
}, g = {}.hasOwnProperty, m = [].indexOf || function(t3) {
for (var e2 = 0, n2 = this.length; n2 > e2; e2++)
if (e2 in this && this[e2] === t3)
return e2;
return -1;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 11 locations. Consider refactoring. Open
}, a = {}.hasOwnProperty, u = [].indexOf || function(t3) {
for (var e2 = 0, n2 = this.length; n2 > e2; e2++)
if (e2 in this && this[e2] === t3)
return e2;
return -1;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
}, u.prototype.toolbarDidToggleAttribute = function(t3) {
return this.recordFormattingUndoEntry(t3), this.composition.toggleCurrentAttribute(t3), this.render(), this.selectionFrozen ? void 0 : this.editorElement.focus();
}, u.prototype.toolbarDidUpdateAttribute = function(t3, e2) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 11 locations. Consider refactoring. Open
var t2, n, i, o, r, s, a, u = [].indexOf || function(t3) {
for (var e2 = 0, n2 = this.length; n2 > e2; e2++)
if (e2 in this && this[e2] === t3)
return e2;
return -1;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 77.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function A
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
multiOpen:true};var A=function(t){_inherits(Drilldown,t);var i=_createSuper(Drilldown);function Drilldown(){_classCallCheck(this,Drilldown);return i.apply(this,arguments)}_createClass(Drilldown,[{key:"_setup",value:
/**
* Creates a new instance of a drilldown menu.
* @class
* @name Drilldown
- 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 V
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
panelActiveClass:"is-active"};var V=function(t){_inherits(Toggler,t);var i=_createSuper(Toggler);function Toggler(){_classCallCheck(this,Toggler);return i.apply(this,arguments)}_createClass(Toggler,[{key:"_setup",value:
/**
* Creates a new instance of Toggler.
* @class
* @name Toggler
- 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 ignoreMousedisappear
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
*/function ignoreMousedisappear(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.ignoreLeaveWindow,s=void 0!==n&&n,a=i.ignoreReappear,o=void 0!==a&&a;return function leaveEventHandler(i){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];var l=t.bind.apply(t,[this,i].concat(a));if(null!==i.relatedTarget)return l();setTimeout((function leaveEventDebouncer(){if(!s&&document.hasFocus&&!document.hasFocus())return l();o||e(document).one("mouseenter",(function reenterEventHandler(t){if(!e(i.currentTarget).has(t.target).length){i.relatedTarget=t.target;l()}}))}),0)}}var t=Object.freeze({__proto__:null,rtl:rtl,GetYoDigits:GetYoDigits,RegExpEscape:RegExpEscape,transitionend:transitionend,onLoad:onLoad,ignoreMousedisappear:ignoreMousedisappear});window.matchMedia||(window.matchMedia=function(){var e=window.styleMedia||window.media;if(!e){var t=document.createElement("style"),i=document.getElementsByTagName("script")[0],n=null;t.type="text/css";t.id="matchmediajs-test";i?i.parentNode.insertBefore(t,i):document.head.appendChild(t);n="getComputedStyle"in window&&window.getComputedStyle(t,null)||t.currentStyle;e={matchMedium:function matchMedium(e){var i="@media "+e+"{ #matchmediajs-test { width: 1px; } }";t.styleSheet?t.styleSheet.cssText=i:t.textContent=i;return"1px"===n.width}}}return function(t){return{matches:e.matchMedium(t||"all"),media:t||"all"}}}());var i={queries:[],current:"",_init:function _init(){if(true===this.isInitialized)return this;this.isInitialized=true;var t=this;var i=e("meta.foundation-mq");i.length||e('<meta class="foundation-mq" name="foundation-mq" content>').appendTo(document.head);var n=e(".foundation-mq").css("font-family");var s;s=parseStyleToObject(n);t.queries=[];for(var a in s)s.hasOwnProperty(a)&&t.queries.push({name:a,value:"only screen and (min-width: ".concat(s[a],")")});this.current=this._getCurrentSize();this._watcher()},_reInit:function _reInit(){this.isInitialized=false;this._init()},
- 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 W
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function _setup(t){this.$element=e(t);this.rules=this.$element.data("responsive-menu");this.currentMq=null;this.currentPlugin=null;this.className="ResponsiveMenu";this._init();this._events()}},{key:"_init",value:function _init(){i._init();if("string"===typeof this.rules){var t={};var n=this.rules.split(" ");for(var s=0;s<n.length;s++){var a=n[s].split("-");var o=a.length>1?a[0]:"small";var r=a.length>1?a[1]:a[0];null!==N[r]&&(t[o]=N[r])}this.rules=t}e.isEmptyObject(this.rules)||this._checkMediaQueries();this.$element.attr("data-mutate",this.$element.attr("data-mutate")||GetYoDigits(6,"responsive-menu"))}},{key:"_events",value:function _events(){var t=this;e(window).on("changed.zf.mediaquery",(function(){t._checkMediaQueries()}))}},{key:"_checkMediaQueries",value:function _checkMediaQueries(){var t,n=this;e.each(this.rules,(function(e){i.atLeast(e)&&(t=e)}));if(t&&!(this.currentPlugin instanceof this.rules[t].plugin)){e.each(N,(function(e,t){n.$element.removeClass(t.cssClass)}));this.$element.addClass(this.rules[t].cssClass);this.currentPlugin&&this.currentPlugin.destroy();this.currentPlugin=new this.rules[t].plugin(this.$element,{})}}},{key:"_destroy",value:function _destroy(){this.currentPlugin.destroy();e(window).off(".zf.ResponsiveMenu")}}]);return ResponsiveMenu}(C);G.defaults={};var W=function(t){_inherits(ResponsiveToggle,t);var n=_createSuper(ResponsiveToggle);function ResponsiveToggle(){_classCallCheck(this,ResponsiveToggle);return n.apply(this,arguments)}_createClass(ResponsiveToggle,[{key:"_setup",value:
/**
* Creates a new instance of Tab Bar.
* @class
* @name ResponsiveToggle
- 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 GetExplicitOffsets
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
*/function GetExplicitOffsets(e,t,i,n,s,a,o){var r=GetDimensions(e),l=t?GetDimensions(t):null;var c,h;if(null!==l){switch(i){case"top":c=l.offset.top-(r.height+s);break;case"bottom":c=l.offset.top+l.height+s;break;case"left":h=l.offset.left-(r.width+a);break;case"right":h=l.offset.left+l.width+a;break}switch(i){case"top":case"bottom":switch(n){case"left":h=l.offset.left+a;break;case"right":h=l.offset.left-r.width+l.width-a;break;case"center":h=o?a:l.offset.left+l.width/2-r.width/2+a;break}break;case"right":case"left":switch(n){case"bottom":c=l.offset.top-s+l.height-r.height;break;case"top":c=l.offset.top+s;break;case"center":c=l.offset.top+s+l.height/2-r.height/2;break}break}}return{top:c,left:h}}
- 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
Similar blocks of code found in 2 locations. Consider refactoring. 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={
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 76.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function InputController
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
t2 = e.handleEvent, n = e.innerElementIsActive, e.InputController = function(o2) {
function r(n2) {
var i2;
this.element = n2, this.mutationObserver = new e.MutationObserver(this.element), this.mutationObserver.delegate = this;
for (i2 in this.events)
Function computeOffsets
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function computeOffsets(_ref) {
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
var basePlacement = placement ? getBasePlacement(placement) : null;
var variation = placement ? getVariation(placement) : null;
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
Function HTMLSanitizer
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
n = e.tagName, i = e.walkTree, t2 = e.nodeIsAttachmentElement, e.HTMLSanitizer = function(r2) {
function u(t3, e2) {
var n2;
n2 = e2 != null ? e2 : {}, this.allowedAttributes = n2.allowedAttributes, this.forbiddenProtocols = n2.forbiddenProtocols, this.forbiddenElements = n2.forbiddenElements, this.allowedAttributes == null && (this.allowedAttributes = c), this.forbiddenProtocols == null && (this.forbiddenProtocols = h), this.forbiddenElements == null && (this.forbiddenElements = l), this.body = p(t3);
}
Consider simplifying this complex logical expression. Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector ||
selector === "**" && handleObj.selector ) ) {
Consider simplifying this complex logical expression. Open
if (t3 = n2(t3), !e3.childList && !e3.attributes && !e3.characterData || e3.attributeOldValue && !e3.attributes || e3.attributeFilter && e3.attributeFilter.length && !e3.attributes || e3.characterDataOldValue && !e3.characterData)
throw new SyntaxError();
Similar blocks of code found in 2 locations. Consider refactoring. Open
function _setup(t,i){this.$element=t;this.options=e.extend({},DropdownMenu.defaults,this.$element.data(),i);this.className="DropdownMenu";f.init(e);this._init();l.register("DropdownMenu",{ENTER:"open",SPACE:"open",ARROW_RIGHT:"next",ARROW_UP:"up",ARROW_DOWN:"down",ARROW_LEFT:"previous",ESCAPE:"close"})}},{key:"_init",value:function _init(){u.Feather(this.$element,"dropdown");var e=this.$element.find("li.is-dropdown-submenu-parent");this.$element.children(".is-dropdown-submenu-parent").children(".is-dropdown-submenu").addClass("first-sub");this.$menuItems=this.$element.find('li[role="none"]');this.$tabs=this.$element.children('li[role="none"]');this.$tabs.find("ul.is-dropdown-submenu").addClass(this.options.verticalClass);if("auto"===this.options.alignment)if(this.$element.hasClass(this.options.rightClass)||rtl()||this.$element.parents(".top-bar-right").is("*")){this.options.alignment="right";e.addClass("opens-left")}else{this.options.alignment="left";e.addClass("opens-right")}else"right"===this.options.alignment?e.addClass("opens-left"):e.addClass("opens-right");this.changed=false;this._events()}},{key:"_isVertical",value:function _isVertical(){return"block"===this.$tabs.css("display")||"column"===this.$element.css("flex-direction")}},{key:"_isRtl",value:function _isRtl(){return this.$element.hasClass("align-right")||rtl()&&!this.$element.hasClass("align-left")}},{key:"_events",value:function _events(){var t=this,i="ontouchstart"in window||"undefined"!==typeof window.ontouchstart,n="is-dropdown-submenu-parent";var s=function handleClickFn(s){var a=e(s.target).parentsUntil("ul",".".concat(n)),o=a.hasClass(n),r="true"===a.attr("data-is-click"),l=a.children(".is-dropdown-submenu");if(o)if(r){if(!t.options.closeOnClick||!t.options.clickOpen&&!i||t.options.forceFollow&&i)return;s.stopImmediatePropagation();s.preventDefault();t._hide(a)}else{s.stopImmediatePropagation();s.preventDefault();t._show(l);a.add(a.parentsUntil(t.$element,".".concat(n))).attr("data-is-click",true)}};(this.options.clickOpen||i)&&this.$menuItems.on("click.zf.dropdownMenu touchstart.zf.dropdownMenu",s);t.options.closeOnClickInside&&this.$menuItems.on("click.zf.dropdownMenu",(function(){var i=e(this),s=i.hasClass(n);s||t._hide()}));i&&this.options.disableHoverOnTouch&&(this.options.disableHover=true);this.options.disableHover||this.$menuItems.on("mouseenter.zf.dropdownMenu",(function(){var i=e(this),s=i.hasClass(n);if(s){clearTimeout(i.data("_delay"));i.data("_delay",setTimeout((function(){t._show(i.children(".is-dropdown-submenu"))}),t.options.hoverDelay))}})).on("mouseleave.zf.dropdownMenu",ignoreMousedisappear((function(){var i=e(this),s=i.hasClass(n);if(s&&t.options.autoclose){if("true"===i.attr("data-is-click")&&t.options.clickOpen)return false;clearTimeout(i.data("_delay"));i.data("_delay",setTimeout((function(){t._hide(i)}),t.options.closingTime))}})));this.$menuItems.on("keydown.zf.dropdownMenu",(function(i){var n,s,a=e(i.target).parentsUntil("ul",'[role="none"]'),o=t.$tabs.index(a)>-1,r=o?t.$tabs:a.siblings("li").add(a);r.each((function(t){if(e(this).is(a)){n=r.eq(t-1);s=r.eq(t+1)}else;}));var c=function nextSibling(){s.children("a:first").focus();i.preventDefault()},h=function prevSibling(){n.children("a:first").focus();i.preventDefault()},d=function openSub(){var e=a.children("ul.is-dropdown-submenu");if(e.length){t._show(e);a.find("li > a:first").focus();i.preventDefault()}},u=function closeSub(){var e=a.parent("ul").parent("li");e.children("a:first").focus();t._hide(e);i.preventDefault()};var f={open:d,close:function close(){t._hide(t.$element);t.$menuItems.eq(0).children("a").focus();i.preventDefault()}};o?t._isVertical()?t._isRtl()?e.extend(f,{down:c,up:h,next:u,previous:d}):e.extend(f,{down:c,up:h,next:d,previous:u}):t._isRtl()?e.extend(f,{next:h,previous:c,down:d,up:u}):e.extend(f,{next:c,previous:h,down:d,up:u}):t._isRtl()?e.extend(f,{next:u,previous:d,down:c,up:h}):e.extend(f,{next:d,previous:u,down:c,up:h});l.handleKey(i,"DropdownMenu",f)}))}},{key:"_addBodyHandler",value:function _addBodyHandler(){var t=this;var i=e(document.body);this._removeBodyHandler();i.on("click.zf.dropdownMenu tap.zf.dropdownMenu",(function(i){var n=!!e(i.target).closest(t.$element).length;if(!n){t._hide();t._removeBodyHandler()}}))}},{key:"_removeBodyHandler",value:function _removeBodyHandler(){e(document.body).off("click.zf.dropdownMenu tap.zf.dropdownMenu")}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 75.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for (t3 == null && (t3 = []), this.elements = {}, n = 0, i = t3.length; i > n; n++)
e3 = t3[n], this.add(e3);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 75.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
for (t3 == null && (t3 = []), this.managedAttachments = {}, n3 = 0, i2 = t3.length; i2 > n3; n3++)
e2 = t3[n3], this.manageAttachment(e2);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 75.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76