CodeforLeipzig/stadtratmonitor

View on GitHub

Showing 611 of 611 total issues

Function addCombinator has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function addCombinator( matcher, combinator, base ) {
    var dir = combinator.dir,
        checkNonElements = base && dir === "parentNode",
        doneName = done++;

    Function showHide has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function showHide( elements, show ) {
        var display, elem, hidden,
            values = [],
            index = 0,
            length = elements.length;

      Function on has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function on( elem, types, selector, data, fn, one ) {
          var origFn, type;
      
          // Types can be a map of types/handlers
          if ( typeof types === "object" ) {

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

        function _setup(t,i){this.$element=t;this.options=e.extend({},Tabs.defaults,this.$element.data(),i);this.className="Tabs";this._init();l.register("Tabs",{ENTER:"open",SPACE:"open",ARROW_RIGHT:"next",ARROW_UP:"previous",ARROW_DOWN:"next",ARROW_LEFT:"previous"})}},{key:"_init",value:function _init(){var t=this;var i=this;this._isInitializing=true;this.$element.attr({role:"tablist"});this.$tabTitles=this.$element.find(".".concat(this.options.linkClass));this.$tabContent=e('[data-tabs-content="'.concat(this.$element[0].id,'"]'));this.$tabTitles.each((function(){var t=e(this),n=t.find("a"),s=t.hasClass("".concat(i.options.linkActiveClass)),a=n.attr("data-tabs-target")||n[0].hash.slice(1),o=n[0].id?n[0].id:"".concat(a,"-label"),r=e("#".concat(a));t.attr({role:"presentation"});n.attr({role:"tab","aria-controls":a,"aria-selected":s,id:o,tabindex:s?"0":"-1"});r.attr({role:"tabpanel","aria-labelledby":o});s&&(i._initialAnchor="#".concat(a));s||r.attr("aria-hidden","true");s&&i.options.autoFocus&&(i.onLoadListener=onLoad(e(window),(function(){e("html, body").animate({scrollTop:t.offset().top},i.options.deepLinkSmudgeDelay,(function(){n.focus()}))})))}));if(this.options.matchHeight){var n=this.$tabContent.find("img");n.length?onImagesLoaded(n,this._setHeight.bind(this)):this._setHeight()}this._checkDeepLink=function(){var i=window.location.hash;if(!i.length){if(t._isInitializing)return;t._initialAnchor&&(i=t._initialAnchor)}var n=i.indexOf("#")>=0?i.slice(1):i;var s=n&&e("#".concat(n));var a=i&&t.$element.find('[href$="'.concat(i,'"],[data-tabs-target="').concat(n,'"]')).first();var o=!!(s.length&&a.length);if(o){s&&s.length&&a&&a.length?t.selectTab(s,true):t._collapse();if(t.options.deepLinkSmudge){var r=t.$element.offset();e("html, body").animate({scrollTop:r.top-t.options.deepLinkSmudgeOffset},t.options.deepLinkSmudgeDelay)}t.$element.trigger("deeplink.zf.tabs",[a,s])}};this.options.deepLink&&this._checkDeepLink();this._events();this._isInitializing=false}},{key:"_events",value:function _events(){this._addKeyHandler();this._addClickHandler();this._setHeightMqHandler=null;if(this.options.matchHeight){this._setHeightMqHandler=this._setHeight.bind(this);e(window).on("changed.zf.mediaquery",this._setHeightMqHandler)}this.options.deepLink&&e(window).on("hashchange",this._checkDeepLink)}},{key:"_addClickHandler",value:function _addClickHandler(){var t=this;this.$element.off("click.zf.tabs").on("click.zf.tabs",".".concat(this.options.linkClass),(function(i){i.preventDefault();t._handleTabChange(e(this))}))}},{key:"_addKeyHandler",value:function _addKeyHandler(){var t=this;this.$tabTitles.off("keydown.zf.tabs").on("keydown.zf.tabs",(function(i){if(9!==i.which){var n,s,a=e(this),o=a.parent("ul").children("li");o.each((function(i){if(e(this).is(a))if(t.options.wrapOnKeys){n=0===i?o.last():o.eq(i-1);s=i===o.length-1?o.first():o.eq(i+1)}else{n=o.eq(Math.max(0,i-1));s=o.eq(Math.min(i+1,o.length-1))}else;}));l.handleKey(i,"Tabs",{open:function open(){a.find('[role="tab"]').focus();t._handleTabChange(a)},previous:function previous(){n.find('[role="tab"]').focus();t._handleTabChange(n)},next:function next(){s.find('[role="tab"]').focus();t._handleTabChange(s)},handled:function handled(){i.preventDefault()}})}}))}
        public/assets/foundation-sites-ec9e5d7297119b9d170d725de4d511c146a14d23bee7c672baf3fcfd6f1697a5.js on lines 435..435

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

        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 handleKey has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

        handleKey:function handleKey(t,i,n){var s,a,o,l=r[i],c=this.parseKey(t);if(!l)return console.warn("Component not defined!");if(true!==t.zfIsKeyHandled){s="undefined"===typeof l.ltr?l:rtl()?e.extend({},l.ltr,l.rtl):e.extend({},l.rtl,l.ltr);a=s[c];o=n[a];if(o&&"function"===typeof o){var h=o.apply();t.zfIsKeyHandled=true;(n.handled||"function"===typeof n.handled)&&n.handled(h)}else(n.unhandled||"function"===typeof n.unhandled)&&n.unhandled()}},

        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 access has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
            var i = 0,
                length = elems.length,
                bulk = key == null;
        
        

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

          var logger = {
            log(...messages) {
              if (this.enabled) {
                messages.push(Date.now());
                adapters.logger.log("[ActionCable]", ...messages);
          public/assets/actioncable-5433453f9b6619a9de91aaab2d7fc7ff183e5260c0107cbc9a1aa0c838d9a74e.js on lines 10..17

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

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

            var logger = {
              log(...messages) {
                if (this.enabled) {
                  messages.push(Date.now());
                  adapters.logger.log("[ActionCable]", ...messages);
          public/assets/actioncable.esm-e01089c3ec4fe7817fa9abcad06cab6bdc387f95f0ca6aab4bf7ba7537f70690.js on lines 6..13

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

          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 = r[t4], o[1] - o[0] > 1 && (o[0] += i2, o[1] += i2, this.document.getCharacterAtPosition(o[1]) !== "\n" && (this.document = this.document.insertBlockBreakAtRange(o[1]), o[1] < this.selectedRange[1] && this.moveSelectedRangeForward(), o[1]++, i2++), o[0] !== 0 && this.document.getCharacterAtPosition(o[0] - 1) !== "\n" && (this.document = this.document.insertBlockBreakAtRange(o[0]), o[0] < this.selectedRange[0] && this.moveSelectedRangeForward(), o[0]++, i2++), s.push(this.document = this.document.applyBlockAttributeAtRange(e2, true, o)));
          public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 4562..4562

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

          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

                    }}, decreaseNestingLevel: {test: function() {
                      return this.editor.canDecreaseNestingLevel();
                    }, perform: function() {
                      return this.editor.decreaseNestingLevel() && this.render();
                    }}, attachFiles: {test: function() {
          public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 5100..5104

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

          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({},Toggler.defaults,t.data(),i);this.className="";this.className="Toggler";k.init(e);this._init();this._events()}},{key:"_init",value:function _init(){var t=this.$element[0].id,i=e('[data-open~="'.concat(t,'"], [data-close~="').concat(t,'"], [data-toggle~="').concat(t,'"]'));var n;if(this.options.animate){n=this.options.animate.split(" ");this.animationIn=n[0];this.animationOut=n[1]||null;i.attr("aria-expanded",!this.$element.is(":hidden"))}else{n=this.options.toggler;if("string"!==typeof n||!n.length)throw new Error("The 'toggler' option containing the target class is required, got \"".concat(n,'"'));this.className="."===n[0]?n.slice(1):n;i.attr("aria-expanded",this.$element.hasClass(this.className))}i.each((function(i,n){var s=e(n);var a=s.attr("aria-controls")||"";var o=new RegExp("\\b".concat(RegExpEscape(t),"\\b")).test(a);o||s.attr("aria-controls",a?"".concat(a," ").concat(t):t)}))}},{key:"_events",value:function _events(){this.$element.off("toggle.zf.trigger").on("toggle.zf.trigger",this.toggle.bind(this))}},{key:"toggle",value:function toggle(){this[this.options.animate?"_toggleAnimate":"_toggleClass"]()}},{key:"_toggleClass",value:function _toggleClass(){this.$element.toggleClass(this.className);var e=this.$element.hasClass(this.className);e?this.$element.trigger("on.zf.toggler"):this.$element.trigger("off.zf.toggler");this._updateARIA(e);this.$element.find("[data-mutate]").trigger("mutateme.zf.trigger")}},{key:"_toggleAnimate",value:function _toggleAnimate(){var e=this;this.$element.is(":hidden")?d.animateIn(this.$element,this.animationIn,(function(){e._updateARIA(true);this.trigger("on.zf.toggler");this.find("[data-mutate]").trigger("mutateme.zf.trigger")})):d.animateOut(this.$element,this.animationOut,(function(){e._updateARIA(false);this.trigger("off.zf.toggler");this.find("[data-mutate]").trigger("mutateme.zf.trigger")}))}},{key:"_updateARIA",value:function _updateARIA(t){var i=this.$element[0].id;e('[data-open="'.concat(i,'"], [data-close="').concat(i,'"], [data-toggle="').concat(i,'"]')).attr({"aria-expanded":!!t})}},{key:"_destroy",value:function _destroy(){this.$element.off(".zf.toggler")}}]);return Toggler}(C);V.defaults={
          public/assets/foundation-sites-ec9e5d7297119b9d170d725de4d511c146a14d23bee7c672baf3fcfd6f1697a5.js on lines 2156..2156

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

          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

                    }}, increaseNestingLevel: {test: function() {
                      return this.editor.canIncreaseNestingLevel();
                    }, perform: function() {
                      return this.editor.increaseNestingLevel() && this.render();
                    }}, decreaseNestingLevel: {test: function() {
          public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 5104..5108

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

          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 when has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              when: function( subordinate /* , ..., subordinateN */ ) {
                  var i = 0,
                      resolveValues = slice.call( arguments ),
                      length = resolveValues.length,
          
          

            Function ajaxHandleResponses has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function ajaxHandleResponses( s, jqXHR, responses ) {
                var firstDataType, ct, finalDataType, type,
                    contents = s.contents,
                    dataTypes = s.dataTypes;
            
            

              Function AttachmentView has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      i = e.makeElement, t2 = e.config.css, e.AttachmentView = function(r2) {
                        function s() {
                          s.__super__.constructor.apply(this, arguments), this.attachment = this.object, this.attachment.uploadProgressDelegate = this, this.attachmentPiece = this.options.piece;
                        }
                        var a;

                Function style has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    style: function( elem, name, value, extra ) {
                
                        // Don't set styles on text and comment nodes
                        if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
                            return;

                  Function toggleClass has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      toggleClass: function( value, stateVal ) {
                          var type = typeof value;
                  
                          if ( typeof stateVal === "boolean" && type === "string" ) {
                              return stateVal ? this.addClass( value ) : this.removeClass( value );

                    Function computeStyles has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function computeStyles(_ref5) {
                        var state = _ref5.state, options = _ref5.options;
                        var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
                        if (true) {
                          var transitionProperty = getComputedStyle2(state.elements.popper).transitionProperty || "";

                      Function show has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          show() {
                            if (this._element.style.display === "none") {
                              throw new Error("Please use show on visible elements");
                            }
                            if (!(this._isWithContent() && this._isEnabled)) {

                        Function clone has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            clone: function( elem, dataAndEvents, deepDataAndEvents ) {
                                var destElements, node, clone, i, srcElements,
                                    inPage = jQuery.contains( elem.ownerDocument, elem );
                        
                                if ( support.html5Clone || jQuery.isXMLDoc( elem ) ||
                          Severity
                          Category
                          Status
                          Source
                          Language