Showing 611 of 611 total issues
File activestorage-3ab61e47dd4ee2d79db525ade1dca2ede0ea2b7371fe587e408ee37b7ade265d.js
has 823 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define([ "exports" ], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self,
factory(global.ActiveStorage = {}));
})(this, (function(exports) {
"use strict";
File activestorage.esm-01f58a45d77495cdfbdfcc872902a430426c4391634ec9c3da5f69fbf8418492.js
has 813 lines of code (exceeds 250 allowed). Consider refactoring. Open
var sparkMd5 = {
exports: {}
};
(function(module, exports) {
File es-module-shims-16719834c9bbcdd75f1f99da713bd0c89de488be94d4c5df594511f39cffe7c1.js
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* ES Module Shims 1.5.9 */
(function () {
const hasWindow = typeof window !== 'undefined';
const hasDocument = typeof document !== 'undefined';
Function U
has a Cognitive Complexity of 79 (exceeds 5 allowed). Consider refactoring. Open
positionValueFunction:"linear"};function percent(e,t){return e/t}function absPosition(e,t,i,n){return Math.abs(e.position()[t]+e[n]()/2-i)}function baseLog(e,t){return Math.log(t)/Math.log(e)}var U=function(t){_inherits(Sticky,t);var n=_createSuper(Sticky);function Sticky(){_classCallCheck(this,Sticky);return n.apply(this,arguments)}_createClass(Sticky,[{key:"_setup",value:
/**
* Creates a new instance of a sticky thing.
* @class
* @name Sticky
- 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 Document
has 310 lines of code (exceeds 25 allowed). Consider refactoring. Open
t2 = e.arraysAreEqual, i = e.normalizeRange, o = e.rangeIsCollapsed, n = e.getBlockConfig, e.Document = function(s2) {
function c(t3) {
t3 == null && (t3 = []), c.__super__.constructor.apply(this, arguments), t3.length === 0 && (t3 = [new e.Block()]), this.blockList = e.SplittableList.box(t3);
}
var l;
Function z
has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring. Open
*/function animate(t,i,n,s){i=e(i).eq(0);if(i.length){var a=t?c[0]:c[1];var o=t?h[0]:h[1];reset();i.addClass(n).css("transition","none");requestAnimationFrame((function(){i.addClass(a);t&&i.show()}));requestAnimationFrame((function(){i[0].offsetWidth;i.css("transition","").addClass(o)}));i.one(transitionend(i),finish)}function finish(){t||i.hide();reset();s&&s.apply(i)}function reset(){i[0].style.transitionDuration=0;i.removeClass("".concat(a," ").concat(o," ").concat(n))}}var u={Feather:function Feather(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zf";t.attr("role","menubar");t.find("a").attr({role:"menuitem"});var n=t.find("li").attr({role:"none"}),s="is-".concat(i,"-submenu"),a="".concat(s,"-item"),o="is-".concat(i,"-submenu-parent"),r="accordion"!==i;n.each((function(){var t=e(this),n=t.children("ul");if(n.length){t.addClass(o);if(r){var l=t.children("a:first");l.attr({"aria-haspopup":true,"aria-label":l.attr("aria-label")||l.text()});"drilldown"===i&&t.attr({"aria-expanded":false})}n.addClass("submenu ".concat(s)).attr({"data-submenu":"",role:"menubar"});"drilldown"===i&&n.attr({"aria-hidden":true})}t.parent("[data-submenu]").length&&t.addClass("is-submenu-item ".concat(a))}))},Burn:function Burn(e,t){var i="is-".concat(t,"-submenu"),n="".concat(i,"-item"),s="is-".concat(t,"-submenu-parent");e.find(">li, > li > ul, .menu, .menu > li, [data-submenu] > li").removeClass("".concat(i," ").concat(n," ").concat(s," is-submenu-item submenu is-active")).removeAttr("data-submenu").css("display","")}};function Timer(e,t,i){var n,s,a=this,o=t.duration,r=Object.keys(e.data())[0]||"timer",l=-1;this.isPaused=false;this.restart=function(){l=-1;clearTimeout(s);this.start()};this.start=function(){this.isPaused=false;clearTimeout(s);l=l<=0?o:l;e.data("paused",false);n=Date.now();s=setTimeout((function(){t.infinite&&a.restart();i&&"function"===typeof i&&i()}),l);e.trigger("timerstart.zf.".concat(r))};this.pause=function(){this.isPaused=true;clearTimeout(s);e.data("paused",true);var t=Date.now();l-=t-n;e.trigger("timerpaused.zf.".concat(r))}}var f={};var p,v,g,m,y=false,_=false;function onTouchEnd(t){this.removeEventListener("touchmove",onTouchMove);this.removeEventListener("touchend",onTouchEnd);if(!_){var i=e.Event("tap",m||t);e(this).trigger(i)}m=null;y=false;_=false}function onTouchMove(t){true===e.spotSwipe.preventDefault&&t.preventDefault();if(y){var i=t.touches[0].pageX;var n=p-i;var s;_=true;g=(new Date).getTime()-v;Math.abs(n)>=e.spotSwipe.moveThreshold&&g<=e.spotSwipe.timeThreshold&&(s=n>0?"left":"right");if(s){t.preventDefault();onTouchEnd.apply(this,arguments);e(this).trigger(e.Event("swipe",Object.assign({},t)),s).trigger(e.Event("swipe".concat(s),Object.assign({},t)))}}}function onTouchStart(t){if(1===t.touches.length){p=t.touches[0].pageX;m=t;y=true;_=false;v=(new Date).getTime();this.addEventListener("touchmove",onTouchMove,{passive:true===e.spotSwipe.preventDefault});this.addEventListener("touchend",onTouchEnd,false)}}function init(){this.addEventListener&&this.addEventListener("touchstart",onTouchStart,{passive:true})}var b=function(){function SpotSwipe(){_classCallCheck(this,SpotSwipe);this.version="1.0.0";this.enabled="ontouchstart"in document.documentElement;this.preventDefault=false;this.moveThreshold=75;this.timeThreshold=200;this._init()}_createClass(SpotSwipe,[{key:"_init",value:function _init(){e.event.special.swipe={setup:init};e.event.special.tap={setup:init};e.each(["left","up","down","right"],(function(){e.event.special["swipe".concat(this)]={setup:function setup(){e(this).on("swipe",e.noop)}}}))}}]);return SpotSwipe}();f.setupSpotSwipe=function(){e.spotSwipe=new b(e)};f.setupTouchHandler=function(){e.fn.addTouch=function(){this.each((function(i,n){e(n).bind("touchstart touchmove touchend touchcancel",(function(e){t(e)}))}));var t=function handleTouch(e){var t,i=e.changedTouches,n=i[0],s={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"},a=s[e.type];if("MouseEvent"in window&&"function"===typeof window.MouseEvent)t=new window.MouseEvent(a,{bubbles:true,cancelable:true,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});else{t=document.createEvent("MouseEvent");t.initMouseEvent(a,true,true,window,1,n.screenX,n.screenY,n.clientX,n.clientY,false,false,false,false,0,null)}n.target.dispatchEvent(t)}}};f.init=function(){if("undefined"===typeof e.spotSwipe){f.setupSpotSwipe(e);f.setupTouchHandler(e)}};var w=function(){var e=["WebKit","Moz","O","Ms",""];for(var t=0;t<e.length;t++)if("".concat(e[t],"MutationObserver")in window)return window["".concat(e[t],"MutationObserver")];return false}();var $=function triggers(t,i){t.data(i).split(" ").forEach((function(n){e("#".concat(n))["close"===i?"trigger":"triggerHandler"]("".concat(i,".zf.trigger"),[t])}))};var k={Listeners:{Basic:{},Global:{}},Initializers:{}};k.Listeners.Basic={openListener:function openListener(){$(e(this),"open")},closeListener:function closeListener(){var t=e(this).data("close");t?$(e(this),"close"):e(this).trigger("close.zf.trigger")},toggleListener:function toggleListener(){var t=e(this).data("toggle");t?$(e(this),"toggle"):e(this).trigger("toggle.zf.trigger")},closeableListener:function closeableListener(t){var i=e(this).data("closable");t.stopPropagation();""!==i?d.animateOut(e(this),i,(function(){e(this).trigger("closed.zf")})):e(this).fadeOut().trigger("closed.zf")},toggleFocusListener:function toggleFocusListener(){var t=e(this).data("toggle-focus");e("#".concat(t)).triggerHandler("toggle.zf.trigger",[e(this)])}};k.Initializers.addOpenListener=function(e){e.off("click.zf.trigger",k.Listeners.Basic.openListener);e.on("click.zf.trigger","[data-open]",k.Listeners.Basic.openListener)};k.Initializers.addCloseListener=function(e){e.off("click.zf.trigger",k.Listeners.Basic.closeListener);e.on("click.zf.trigger","[data-close]",k.Listeners.Basic.closeListener)};k.Initializers.addToggleListener=function(e){e.off("click.zf.trigger",k.Listeners.Basic.toggleListener);e.on("click.zf.trigger","[data-toggle]",k.Listeners.Basic.toggleListener)};k.Initializers.addCloseableListener=function(e){e.off("close.zf.trigger",k.Listeners.Basic.closeableListener);e.on("close.zf.trigger","[data-closeable], [data-closable]",k.Listeners.Basic.closeableListener)};k.Initializers.addToggleFocusListener=function(e){e.off("focus.zf.trigger blur.zf.trigger",k.Listeners.Basic.toggleFocusListener);e.on("focus.zf.trigger blur.zf.trigger","[data-toggle-focus]",k.Listeners.Basic.toggleFocusListener)};k.Listeners.Global={resizeListener:function resizeListener(t){w||t.each((function(){e(this).triggerHandler("resizeme.zf.trigger")}));t.attr("data-events","resize")},scrollListener:function scrollListener(t){w||t.each((function(){e(this).triggerHandler("scrollme.zf.trigger")}));t.attr("data-events","scroll")},closeMeListener:function closeMeListener(t,i){var n=t.namespace.split(".")[0];var s=e("[data-".concat(n,"]")).not('[data-yeti-box="'.concat(i,'"]'));s.each((function(){var t=e(this);t.triggerHandler("close.zf.trigger",[t])}))}};k.Initializers.addClosemeListener=function(t){var i=e("[data-yeti-box]"),n=["dropdown","tooltip","reveal"];t&&("string"===typeof t?n.push(t):"object"===_typeof(t)&&"string"===typeof t[0]?n=n.concat(t):console.error("Plugin names must be strings"));if(i.length){var s=n.map((function(e){return"closeme.zf.".concat(e)})).join(" ");e(window).off(s).on(s,k.Listeners.Global.closeMeListener)}};function debounceGlobalListener(t,i,n){var s,a=Array.prototype.slice.call(arguments,3);e(window).on(i,(function(){s&&clearTimeout(s);s=setTimeout((function(){n.apply(null,a)}),t||10)}))}k.Initializers.addResizeListener=function(t){var i=e("[data-resize]");i.length&&debounceGlobalListener(t,"resize.zf.trigger",k.Listeners.Global.resizeListener,i)};k.Initializers.addScrollListener=function(t){var i=e("[data-scroll]");i.length&&debounceGlobalListener(t,"scroll.zf.trigger",k.Listeners.Global.scrollListener,i)};k.Initializers.addMutationEventsListener=function(t){if(!w)return false;var i=t.find("[data-resize], [data-scroll], [data-mutate]");var n=function listeningElementsMutation(t){var i=e(t[0].target);switch(t[0].type){case"attributes":"scroll"===i.attr("data-events")&&"data-events"===t[0].attributeName&&i.triggerHandler("scrollme.zf.trigger",[i,window.pageYOffset]);"resize"===i.attr("data-events")&&"data-events"===t[0].attributeName&&i.triggerHandler("resizeme.zf.trigger",[i]);if("style"===t[0].attributeName){i.closest("[data-mutate]").attr("data-events","mutate");i.closest("[data-mutate]").triggerHandler("mutateme.zf.trigger",[i.closest("[data-mutate]")])}break;case"childList":i.closest("[data-mutate]").attr("data-events","mutate");i.closest("[data-mutate]").triggerHandler("mutateme.zf.trigger",[i.closest("[data-mutate]")]);break;default:return false}};if(i.length)for(var s=0;s<=i.length-1;s++){var a=new w(n);a.observe(i[s],{attributes:true,childList:true,characterData:false,subtree:true,attributeFilter:["data-events","style"]})}};k.Initializers.addSimpleListeners=function(){var t=e(document);k.Initializers.addOpenListener(t);k.Initializers.addCloseListener(t);k.Initializers.addToggleListener(t);k.Initializers.addCloseableListener(t);k.Initializers.addToggleFocusListener(t)};k.Initializers.addGlobalListeners=function(){var t=e(document);k.Initializers.addMutationEventsListener(t);k.Initializers.addResizeListener(250);k.Initializers.addScrollListener();k.Initializers.addClosemeListener()};k.init=function(t,i){onLoad(e(window),(function(){if(true!==e.triggersInitialized){k.Initializers.addSimpleListeners();k.Initializers.addGlobalListeners();e.triggersInitialized=true}}));if(i){i.Triggers=k;i.IHearYou=k.Initializers.addGlobalListeners}};var C=function(){function Plugin(e,t){_classCallCheck(this,Plugin);this._setup(e,t);var i=getPluginName(this);this.uuid=GetYoDigits(6,i);this.$element.attr("data-".concat(i))||this.$element.attr("data-".concat(i),this.uuid);this.$element.data("zfPlugin")||this.$element.data("zfPlugin",this);this.$element.trigger("init.zf.".concat(i))}_createClass(Plugin,[{key:"destroy",value:function destroy(){this._destroy();var e=getPluginName(this);this.$element.removeAttr("data-".concat(e)).removeData("zfPlugin").trigger("destroyed.zf.".concat(e));for(var t in this)this.hasOwnProperty(t)&&(this[t]=null)}}]);return Plugin}();function hyphenate$1(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function getPluginName(e){return hyphenate$1(e.className)}var z=function(t){_inherits(Abide,t);var i=_createSuper(Abide);function Abide(){_classCallCheck(this,Abide);return i.apply(this,arguments)}_createClass(Abide,[{key:"_setup",value:
/**
* Creates a new instance of Abide.
* @class
* @name Abide
- 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 Y
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
animate:false};var Y=function(t){_inherits(Reveal,t);var n=_createSuper(Reveal);function Reveal(){_classCallCheck(this,Reveal);return n.apply(this,arguments)}_createClass(Reveal,[{key:"_setup",value:
/**
* Creates a new instance of Reveal.
* @class
* @name Reveal
- 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 F
has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring. Open
offset:0};var F=function(t){_inherits(OffCanvas,t);var n=_createSuper(OffCanvas);function OffCanvas(){_classCallCheck(this,OffCanvas);return n.apply(this,arguments)}_createClass(OffCanvas,[{key:"_setup",value:
/**
* Creates a new instance of an off-canvas wrapper.
* @class
* @name OffCanvas
- 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 Level2InputController
has 279 lines of code (exceeds 25 allowed). Consider refactoring. Open
t2 = e.dataTransferIsPlainText, n = e.keyEventIsKeyboardCommand, i = e.objectsAreEqual, e.Level2InputController = function(s2) {
function u() {
return this.render = o(this.render, this), u.__super__.constructor.apply(this, arguments);
}
var c, l, h, p, d, f;
Function Composition
has 279 lines of code (exceeds 25 allowed). Consider refactoring. Open
s = e.normalizeRange, c = e.rangesAreEqual, u = e.rangeIsCollapsed, a = e.objectsAreEqual, t2 = e.arrayStartsWith, l = e.summarizeArrayChange, i = e.getAllAttributeNames, o = e.getBlockConfig, r = e.getTextConfig, n = e.extend, e.Composition = function(p2) {
function d() {
this.document = new e.Document(), this.attachments = [], this.currentAttributes = {}, this.revision = 0;
}
var f;
Function B
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
trapFocus:false};var B=function(t){_inherits(Orbit,t);var i=_createSuper(Orbit);function Orbit(){_classCallCheck(this,Orbit);return i.apply(this,arguments)}_createClass(Orbit,[{key:"_setup",value:
/**
* Creates a new instance of an orbit carousel.
* @class
* @name Orbit
- 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 X
has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring. Open
allowHtml:false};var Z={tabs:{cssClass:"tabs",plugin:K,open:function open(e,t){return e.selectTab(t)},close:null,toggle:null},accordion:{cssClass:"accordion",plugin:T,open:function open(t,i){return t.down(e(i))},close:function close(t,i){return t.up(e(i))},toggle:function toggle(t,i){return t.toggle(e(i))}}};var X=function(t){_inherits(ResponsiveAccordionTabs,t);var n=_createSuper(ResponsiveAccordionTabs);function ResponsiveAccordionTabs(e,t){var i;_classCallCheck(this,ResponsiveAccordionTabs);i=n.call(this,e,t);return _possibleConstructorReturn(i,i.options.reflow&&i.storezfData||_assertThisInitialized(i))}
/**
* Creates a new instance of a responsive accordion tabs.
* @class
* @name ResponsiveAccordionTabs
- 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 ajax
has 248 lines of code (exceeds 25 allowed). Consider refactoring. Open
ajax: function( url, options ) {
// If url is an object, simulate pre-1.5 signature
if ( typeof url === "object" ) {
options = url;
Function setDocument
has 218 lines of code (exceeds 25 allowed). Consider refactoring. Open
setDocument = Sizzle.setDocument = function( node ) {
var hasCompare, parent,
doc = node ? node.ownerDocument || node : preferredDoc;
// Return early if doc is invalid or already selected
Function EditorController
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
i = e.rangeIsCollapsed, o = e.rangesAreEqual, n = e.objectsAreEqual, t2 = e.getBlockConfig, e.EditorController = function(s2) {
function u(t3) {
var n2, i2;
this.editorElement = t3.editorElement, n2 = t3.document, i2 = t3.html, this.selectionManager = new e.SelectionManager(this.editorElement), this.selectionManager.delegate = this, this.composition = new e.Composition(), this.composition.delegate = this, this.attachmentManager = new e.AttachmentManager(this.composition.getAttachments()), this.attachmentManager.delegate = this, this.inputController = new e["Level" + e.config.input.getLevel() + "InputController"](this.editorElement), this.inputController.delegate = this, this.inputController.responder = this.composition, this.compositionController = new e.CompositionController(this.editorElement, this.composition), this.compositionController.delegate = this, this.toolbarController = new e.ToolbarController(this.editorElement.toolbarElement), this.toolbarController.delegate = this, this.editor = new e.Editor(this.composition, this.selectionManager, this.editorElement), n2 != null ? this.editor.loadDocument(n2) : this.editor.loadHTML(i2);
}
Function H
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
forceFollow:true};var H=function(t){_inherits(DropdownMenu,t);var i=_createSuper(DropdownMenu);function DropdownMenu(){_classCallCheck(this,DropdownMenu);return i.apply(this,arguments)}_createClass(DropdownMenu,[{key:"_setup",value:
/**
* Creates a new instance of DropdownMenu.
* @class
* @name DropdownMenu
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
class Consumer {
constructor(url) {
this._url = url;
this.subscriptions = new Subscriptions(this);
this.connection = new Connection(this);
- 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 192.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
class Consumer {
constructor(url) {
this._url = url;
this.subscriptions = new Subscriptions(this);
this.connection = new Connection(this);
- 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 192.
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
File actioncable-5433453f9b6619a9de91aaab2d7fc7ff183e5260c0107cbc9a1aa0c838d9a74e.js
has 484 lines of code (exceeds 250 allowed). Consider refactoring. Open
(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define([ "exports" ], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self,
factory(global.ActionCable = {}));
})(this, (function(exports) {
"use strict";
Similar blocks of code found in 2 locations. 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:
- 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 182.
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