CodeforLeipzig/stadtratmonitor

View on GitHub

Showing 321 of 611 total issues

Function load has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jQuery.fn.load = function( url, params, callback ) {
    if ( typeof url !== "string" && _load ) {
        return _load.apply( this, arguments );
    }

    Function adjustCSS has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function adjustCSS( elem, prop, valueParts, tween ) {
        var adjusted,
            scale = 1,
            maxIterations = 20,
            currentValue = tween ?

      Function getCompositeRect has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
          if (isFixed === void 0) {
            isFixed = false;
          }
          var isOffsetParentAnElement = isHTMLElement(offsetParent);

        Function detectOverflow has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function detectOverflow(state, options) {
            if (options === void 0) {
              options = {};
            }
            var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;

          Consider simplifying this complex logical expression.
          Open

              if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
          
                  // Trust units reported by jQuery.css
                  unit = unit || initialInUnit[ 3 ];
          
          

            Consider simplifying this complex logical expression.
            Open

                  if ((!window.CustomEvent || i && typeof window.CustomEvent != "function") && (window.CustomEvent = function(t3, e3) {
                    e3 = e3 || {};
                    var n3 = document.createEvent("CustomEvent");
                    return n3.initCustomEvent(t3, Boolean(e3.bubbles), Boolean(e3.cancelable), e3.detail), n3;
                  }, window.CustomEvent.prototype = window.Event.prototype), !window.Event || i && typeof window.Event != "function") {

              Consider simplifying this complex logical expression.
              Open

                          if ((t3 != null ? t3.nodeType : void 0) === Node.TEXT_NODE && k(t3.data) && (n2 = t3.parentNode, i2 = t3.previousSibling, e2 = t3.nextSibling, (!C(n2.previousSibling) || this.isBlockElement(n2.previousSibling)) && !v(n2)))
                            return !i2 || this.isBlockElement(i2) || !e2 || this.isBlockElement(e2);

                Function SelectionChangeObserver has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        t2 = e.getDOMRange, e.SelectionChangeObserver = function(e2) {
                          function o2() {
                            this.run = n(this.run, this), this.update = n(this.update, this), this.selectionManagers = [];
                          }
                          var s;

                  Function fixCloneNodeIssues has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function fixCloneNodeIssues( src, dest ) {
                      var nodeName, e, data;
                  
                      // We do not need to do anything for non-Elements
                      if ( dest.nodeType !== 1 ) {

                    Function cleanData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        cleanData: function( elems, /* internal */ forceAcceptData ) {
                            var elem, type, id, data,
                                i = 0,
                                internalKey = jQuery.expando,
                                cache = jQuery.cache,

                      Function data has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          data: function( key, value ) {
                              var i, name, data,
                                  elem = this[ 0 ],
                                  attrs = elem && elem.attributes;
                      
                      

                        Function trigger has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            trigger(element, event, args) {
                              if (typeof event !== "string" || !element) {
                                return null;
                              }
                              const $ = getjQuery();

                          Method execute_search has 32 lines of code (exceeds 25 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 1 hr to fix

                            Function O has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                            updateHistory:false};var O=function(t){_inherits(AccordionMenu,t);var i=_createSuper(AccordionMenu);function AccordionMenu(){_classCallCheck(this,AccordionMenu);return i.apply(this,arguments)}_createClass(AccordionMenu,[{key:"_setup",value:
                            /**
                                 * Creates a new instance of an accordion menu.
                                 * @class
                                 * @name AccordionMenu

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

                            import e from"jquery";function _typeof(e){_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};return _typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||false;n.configurable=true;"value"in n&&(n.writable=true);Object.defineProperty(e,n.key,n)}}function _createClass(e,t,i){t&&_defineProperties(e.prototype,t);i&&_defineProperties(e,i);return e}function _inherits(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});t&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)};return _getPrototypeOf(e)}function _setPrototypeOf(e,t){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){e.__proto__=t;return e};return _setPrototypeOf(e,t)}function _isNativeReflectConstruct(){if("undefined"===typeof Reflect||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if("function"===typeof Proxy)return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return true}catch(e){return false}}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _createSuper(e){var t=_isNativeReflectConstruct();return function _createSuperInternal(){var i,n=_getPrototypeOf(e);if(t){var s=_getPrototypeOf(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return _possibleConstructorReturn(this,i)}}function _superPropBase(e,t){while(!Object.prototype.hasOwnProperty.call(e,t)){e=_getPrototypeOf(e);if(null===e)break}return e}function _get(e,t,i){_get="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function _get(e,t,i){var n=_superPropBase(e,t);if(n){var s=Object.getOwnPropertyDescriptor(n,t);return s.get?s.get.call(i):s.value}};return _get(e,t,i||e)}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var i=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n=[];var s=true;var a=false;var o,r;try{for(i=i.call(e);!(s=(o=i.next()).done);s=true){n.push(o.value);if(t&&n.length===t)break}}catch(e){a=true;r=e}finally{try{s||null==i.return||i.return()}finally{if(a)throw r}}return n}}function _unsupportedIterableToArray(e,t){if(e){if("string"===typeof e)return _arrayLikeToArray(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);return"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function rtl(){return"rtl"===e("html").attr("dir")}

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

                                removeClass: function( value ) {
                                    var classes, elem, cur, curValue, clazz, j, finalValue,
                                        i = 0;
                            
                                    if ( jQuery.isFunction( value ) ) {

                              Function promise has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              jQuery.ready.promise = function( obj ) {
                                  if ( !readyList ) {
                              
                                      readyList = jQuery.Deferred();
                              
                              

                                Function handlers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    handlers: function( event, handlers ) {
                                        var i, matches, sel, handleObj,
                                            handlerQueue = [],
                                            delegateCount = handlers.delegateCount,
                                            cur = event.target;

                                  Function AttachmentPiece has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          e.Piece.registerType("attachment", e.AttachmentPiece = function(n2) {
                                            function i(t3) {
                                              this.attachment = t3, i.__super__.constructor.apply(this, arguments), this.length = 1, this.ensureAttachmentExclusivelyHasAttribute("href"), this.attachment.hasContent() || this.removeProhibitedAttributes();
                                            }
                                            return t2(i, n2), i.fromJSON = function(t3) {

                                    Function attr has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        attr: function( elem, name, value ) {
                                            var ret, hooks,
                                                nType = elem.nodeType;
                                    
                                            // Don't get/set attributes on text, comment and attribute nodes
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language