CodeforLeipzig/stadtratmonitor

View on GitHub

Showing 611 of 611 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          }, u.prototype.actions = {undo: {test: function() {
            return this.editor.canUndo();
          }, perform: function() {
            return this.editor.undo();
          }}, redo: {test: function() {
public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 5094..5098

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 54.

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

Further Reading

Function addMutationEventsListener has a Cognitive Complexity of 9 (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:

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

Method execute_search has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def execute_search
    @response = Paper.search(@search_definition.to_definition)
    @papers = @response.page(params[:page]).results
    @sub = {}
    @papers.each do |paper|
Severity: Minor
Found in app/controllers/search_controller.rb - About 55 mins to fix

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 5 locations. Consider refactoring.
Open

        if (data[config] === void 0 || config.startsWith("_") || config === "constructor") {
          throw new TypeError(`No method named "${config}"`);
        }
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 2764..2766
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 3985..3987
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 4924..4926
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 5128..5130

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 53.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

          if (data[config] === void 0 || config.startsWith("_") || config === "constructor") {
            throw new TypeError(`No method named "${config}"`);
          }
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 2289..2291
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 3985..3987
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 4924..4926
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 5128..5130

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 53.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          }, u.prototype.reparse = function() {
            var t3;
            return (t3 = this.delegate) != null ? t3.reparse() : void 0;
          }, u.prototype.events = {keydown: function(t3) {
public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 2755..2758

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 53.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

          }, c.prototype.uninstallAttachmentEditor = function() {
            var t3;
            return (t3 = this.attachmentEditor) != null ? t3.uninstall() : void 0;
          }, c.prototype.didUninstallAttachmentEditor = function() {
public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 2090..2093

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 53.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

        if (data[config] === void 0 || config.startsWith("_") || config === "constructor") {
          throw new TypeError(`No method named "${config}"`);
        }
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 2289..2291
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 2764..2766
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 3985..3987
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 4924..4926

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 53.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

        if (data[config] === void 0 || config.startsWith("_") || config === "constructor") {
          throw new TypeError(`No method named "${config}"`);
        }
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 2289..2291
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 2764..2766
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 3985..3987
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 5128..5130

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 53.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

        if (data[config] === void 0 || config.startsWith("_") || config === "constructor") {
          throw new TypeError(`No method named "${config}"`);
        }
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 2289..2291
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 2764..2766
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 4924..4926
public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 5128..5130

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 53.

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

Further Reading

Function access has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {

    Function GetExplicitOffsets has 7 arguments (exceeds 4 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}}

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              e.config.css = {attachment: "attachment", attachmentCaption: "attachment__caption", attachmentCaptionEditor: "attachment__caption-editor", attachmentMetadata: "attachment__metadata", attachmentMetadataContainer: "attachment__metadata-container", attachmentName: "attachment__name", attachmentProgress: "attachment__progress", attachmentSize: "attachment__size", attachmentToolbar: "attachment__toolbar", attachmentGallery: "attachment-gallery"};
      public/assets/foundation-sites-ec9e5d7297119b9d170d725de4d511c146a14d23bee7c672baf3fcfd6f1697a5.js on lines 1692..1692

      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 52.

      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

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                }, o.prototype.getFilename = function() {
                  var t3;
                  return (t3 = this.attributes.get("filename")) != null ? t3 : "";
                }, o.prototype.getFilesize = function() {
      public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 3097..3100

      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 52.

      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

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          */},{key:"_setWrapperHeight",value:function _setWrapperHeight(t){var i,n=0,s=0,a=this;this.$slides.each((function(){i=this.getBoundingClientRect().height;e(this).attr("data-slide",s);/mui/g.test(e(this)[0].className)||a.$slides.filter(".is-active")[0]===a.$slides.eq(s)[0]||e(this).css({display:"none"});n=i>n?i:n;s++}));if(s===this.$slides.length){this.$wrapper.css({height:n});t&&t(n)}}},{key:"_setSlideHeight",value:function _setSlideHeight(t){this.$slides.each((function(){e(this).css("max-height",t)}))}},{key:"_events",value:function _events(){var t=this;this.$element.off(".resizeme.zf.trigger").on({"resizeme.zf.trigger":this._prepareForOrbit.bind(this)});if(this.$slides.length>1){this.options.swipe&&this.$slides.off("swipeleft.zf.orbit swiperight.zf.orbit").on("swipeleft.zf.orbit",(function(e){e.preventDefault();t.changeSlide(true)})).on("swiperight.zf.orbit",(function(e){e.preventDefault();t.changeSlide(false)}));if(this.options.autoPlay){this.$slides.on("click.zf.orbit",(function(){t.$element.data("clickedOn",!t.$element.data("clickedOn"));t.timer[t.$element.data("clickedOn")?"pause":"start"]()}));this.options.pauseOnHover&&this.$element.on("mouseenter.zf.orbit",(function(){t.timer.pause()})).on("mouseleave.zf.orbit",(function(){t.$element.data("clickedOn")||t.timer.start()}))}if(this.options.navButtons){var i=this.$element.find(".".concat(this.options.nextClass,", .").concat(this.options.prevClass));i.attr("tabindex",0).on("click.zf.orbit touchend.zf.orbit",(function(i){i.preventDefault();t.changeSlide(e(this).hasClass(t.options.nextClass))}))}this.options.bullets&&this.$bullets.on("click.zf.orbit touchend.zf.orbit",(function(){if(/is-active/g.test(this.className))return false;var i=e(this).data("slide"),n=i>t.$slides.filter(".is-active").data("slide"),s=t.$slides.eq(i);t.changeSlide(n,s,i)}));this.options.accessible&&this.$wrapper.add(this.$bullets).on("keydown.zf.orbit",(function(i){l.handleKey(i,"Orbit",{next:function next(){t.changeSlide(true)},previous:function previous(){t.changeSlide(false)},handled:function handled(){e(i.target).is(t.$bullets)&&t.$bullets.filter(".is-active").focus()}})}))}}},{key:"_reset",value:function _reset(){if("undefined"!==typeof this.$slides&&this.$slides.length>1){this.$element.off(".zf.orbit").find("*").off(".zf.orbit");this.options.autoPlay&&this.timer.restart();this.$slides.each((function(t){e(t).removeClass("is-active is-active is-in").removeAttr("aria-live").hide()}));this.$slides.first().addClass("is-active").show();this.$element.trigger("slidechange.zf.orbit",[this.$slides.first()]);this.options.bullets&&this._updateBullets(0)}}
      public/assets/foundation-sites-ec9e5d7297119b9d170d725de4d511c146a14d23bee7c672baf3fcfd6f1697a5.js on lines 2048..2048

      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 52.

      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

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                }, e2.prototype.offsetFromUCS2Offset = function(t4) {
                  return o(this.ucs2String.slice(0, Math.max(0, t4))).length;
                }, e2.prototype.slice = function() {
      public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 1372..1374

      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 52.

      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

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      function _setup(t,i){this.$element=t;this.options=e.extend({},Slider.defaults,this.$element.data(),i);this.className="Slider";this.initialized=false;f.init(e);k.init(e);this._init();l.register("Slider",{ltr:{ARROW_RIGHT:"increase",ARROW_UP:"increase",ARROW_DOWN:"decrease",ARROW_LEFT:"decrease",SHIFT_ARROW_RIGHT:"increaseFast",SHIFT_ARROW_UP:"increaseFast",SHIFT_ARROW_DOWN:"decreaseFast",SHIFT_ARROW_LEFT:"decreaseFast",HOME:"min",END:"max"},rtl:{ARROW_LEFT:"increase",ARROW_RIGHT:"decrease",SHIFT_ARROW_LEFT:"increaseFast",SHIFT_ARROW_RIGHT:"decreaseFast"}})}},{key:"_init",value:function _init(){this.inputs=this.$element.find("input");this.handles=this.$element.find("[data-slider-handle]");this.$handle=this.handles.eq(0);this.$input=this.inputs.length?this.inputs.eq(0):e("#".concat(this.$handle.attr("aria-controls")));this.$fill=this.$element.find("[data-slider-fill]").css(this.options.vertical?"height":"width",0);if(this.options.disabled||this.$element.hasClass(this.options.disabledClass)){this.options.disabled=true;this.$element.addClass(this.options.disabledClass)}if(!this.inputs.length){this.inputs=e().add(this.$input);this.options.binding=true}this._setInitAttr(0);if(this.handles[1]){this.options.doubleSided=true;this.$handle2=this.handles.eq(1);this.$input2=this.inputs.length>1?this.inputs.eq(1):e("#".concat(this.$handle2.attr("aria-controls")));this.inputs[1]||(this.inputs=this.inputs.add(this.$input2));this._setInitAttr(1)}this.setHandles();this._events();this.initialized=true}},{key:"setHandles",value:function setHandles(){var e=this;this.handles[1]?this._setHandlePos(this.$handle,this.inputs.eq(0).val(),(function(){e._setHandlePos(e.$handle2,e.inputs.eq(1).val())})):this._setHandlePos(this.$handle,this.inputs.eq(0).val())}},{key:"_reflow",value:function _reflow(){this.setHandles()}
      public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 1415..1415

      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 52.

      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

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

                }, e2.prototype.offsetToUCS2Offset = function(t4) {
                  return r(this.codepoints.slice(0, Math.max(0, t4))).length;
                }, e2.prototype.offsetFromUCS2Offset = function(t4) {
      public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 1374..1376

      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 52.

      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

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              e.config.keyNames = {8: "backspace", 9: "tab", 13: "return", 27: "escape", 37: "left", 39: "right", 46: "delete", 68: "d", 72: "h", 79: "o"};
      public/assets/foundation-sites-ec9e5d7297119b9d170d725de4d511c146a14d23bee7c672baf3fcfd6f1697a5.js on lines 191..191

      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 52.

      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

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

       */function onImagesLoaded(t,i){var n=t.length;0===n&&i();t.each((function(){if(this.complete&&"undefined"!==typeof this.naturalWidth)singleImageLoaded();else{var t=new Image;var i="load.zf.images error.zf.images";e(t).one(i,(function me(){e(this).off(i,me);singleImageLoaded()}));t.src=e(this).attr("src")}}));function singleImageLoaded(){n--;0===n&&i()}}var o={9:"TAB",13:"ENTER",27:"ESCAPE",32:"SPACE",35:"END",36:"HOME",37:"ARROW_LEFT",38:"ARROW_UP",39:"ARROW_RIGHT",40:"ARROW_DOWN"};var r={};function findFocusable(t){return!!t&&t.find("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]").filter((function(){return!(!e(this).is(":visible")||e(this).attr("tabindex")<0)})).sort((function(t,i){if(e(t).attr("tabindex")===e(i).attr("tabindex"))return 0;var n=parseInt(e(t).attr("tabindex"),10),s=parseInt(e(i).attr("tabindex"),10);return"undefined"===typeof e(t).attr("tabindex")&&s>0?1:"undefined"===typeof e(i).attr("tabindex")&&n>0?-1:0===n&&s>0?1:0===s&&n>0||n<s?-1:n>s?1:void 0}))}function parseKey(e){var t=o[e.which||e.keyCode]||String.fromCharCode(e.which).toUpperCase();t=t.replace(/\W+/,"");e.shiftKey&&(t="SHIFT_".concat(t));e.ctrlKey&&(t="CTRL_".concat(t));e.altKey&&(t="ALT_".concat(t));t=t.replace(/_$/,"");return t}var l={keys:getKeyCodes(o),
      public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 1515..1515

      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 52.

      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

      Further Reading

      Severity
      Category
      Status
      Source
      Language