CodeforLeipzig/stadtratmonitor

View on GitHub

Showing 321 of 611 total issues

Function md5cycle has 133 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function md5cycle(x, k) {
      var a = x[0], b = x[1], c = x[2], d = x[3];
      a += (b & c | ~b & d) + k[0] - 680876936 | 0;
      a = (a << 7 | a >>> 25) + b | 0;
      d += (a & b | ~a & c) + k[1] - 389564586 | 0;

    Consider simplifying this complex logical expression.
    Open

                if ( event.pageX == null && original.clientX != null ) {
                    eventDoc = event.target.ownerDocument || document;
                    doc = eventDoc.documentElement;
                    body = eventDoc.body;
    
    

      Function SplittableList has 124 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              t2 = e.spliceArray, e.SplittableList = function(e2) {
                function i2(t3) {
                  t3 == null && (t3 = []), i2.__super__.constructor.apply(this, arguments), this.objects = t3.slice(0), this.length = this.objects.length;
                }
                var r, s, a;

        Function Callbacks has 121 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jQuery.Callbacks = function( options ) {
        
            // Convert options from String-formatted to Object-formatted if needed
            // (we check in cache first)
            options = typeof options === "string" ?

          Function R has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
          Open

          animationEasing:"swing"};var S=["left","right","top","bottom"];var E=["top","bottom","center"];var x=["left","right","center"];var L={left:E,right:E,top:x,bottom:x};function nextItem(e,t){var i=t.indexOf(e);return i===t.length-1?t[0]:t[i+1]}var R=function(e){_inherits(Positionable,e);var t=_createSuper(Positionable);function Positionable(){_classCallCheck(this,Positionable);return t.apply(this,arguments)}_createClass(Positionable,[{key:"_init",value:function _init(){this.triedPositions={};this.position="auto"===this.options.position?this._getDefaultPosition():this.options.position;this.alignment="auto"===this.options.alignment?this._getDefaultAlignment():this.options.alignment;this.originalPosition=this.position;this.originalAlignment=this.alignment}},{key:"_getDefaultPosition",value:function _getDefaultPosition(){return"bottom"}},{key:"_getDefaultAlignment",value:function _getDefaultAlignment(){switch(this.position){case"bottom":case"top":return rtl()?"right":"left";case"left":case"right":return"bottom"}}},{key:"_reposition",value:function _reposition(){if(this._alignmentsExhausted(this.position)){this.position=nextItem(this.position,S);this.alignment=L[this.position][0]}else this._realign()}},{key:"_realign",value:function _realign(){this._addTriedPosition(this.position,this.alignment);this.alignment=nextItem(this.alignment,L[this.position])}},{key:"_addTriedPosition",value:function _addTriedPosition(e,t){this.triedPositions[e]=this.triedPositions[e]||[];this.triedPositions[e].push(t)}},{key:"_positionsExhausted",value:function _positionsExhausted(){var e=true;for(var t=0;t<S.length;t++)e=e&&this._alignmentsExhausted(S[t]);return e}},{key:"_alignmentsExhausted",value:function _alignmentsExhausted(e){return this.triedPositions[e]&&this.triedPositions[e].length===L[e].length}},{key:"_getVOffset",value:function _getVOffset(){return this.options.vOffset}},{key:"_getHOffset",value:function _getHOffset(){return this.options.hOffset}},{key:"_setPosition",value:function _setPosition(e,t,i){if("false"===e.attr("aria-expanded"))return false;if(!this.options.allowOverlap){this.position=this.originalPosition;this.alignment=this.originalAlignment}t.offset(a.GetExplicitOffsets(t,e,this.position,this.alignment,this._getVOffset(),this._getHOffset()));if(!this.options.allowOverlap){var n=1e8;var s={position:this.position,alignment:this.alignment};while(!this._positionsExhausted()){var o=a.OverlapArea(t,i,false,false,this.options.allowBottomOverlap);if(0===o)return;if(o<n){n=o;s={position:this.position,alignment:this.alignment}}this._reposition();t.offset(a.GetExplicitOffsets(t,e,this.position,this.alignment,this._getVOffset(),this._getHOffset()))}this.position=s.position;this.alignment=s.alignment;t.offset(a.GetExplicitOffsets(t,e,this.position,this.alignment,this._getVOffset(),this._getHOffset()))}}}]);return Positionable}(C);R.defaults={

          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

          Consider simplifying this complex logical expression.
          Open

                if (!t2.JsMutationObserver) {
                  var g, m = new WeakMap();
                  if (/Trident|Edge/.test(navigator.userAgent))
                    g = setTimeout;
                  else if (window.setImmediate)

            Function defaultPrefilter has 105 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function defaultPrefilter( elem, props, opts ) {
                /* jshint validthis: true */
                var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
                    anim = this,
                    orig = {},

              Method definition has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.definition(q, options = {})
                  Elasticsearch::DSL::Search.search do
                    sort do
                      by '_score' if options[:sort_by] == 'score'
                      by :published_at, order: 'desc'
              Severity: Minor
              Found in app/models/paper_search.rb - About 3 hrs 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

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

                  trigger: function( event, data, elem, onlyHandlers ) {
                      var handle, ontype, cur,
                          bubbleType, special, tmp, i,
                          eventPath = [ elem || document ],
                          type = hasOwn.call( event, "type" ) ? event.type : event,

                Function Attachment has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        e.Attachment = function(i2) {
                          function o(n2) {
                            n2 == null && (n2 = {}), this.releaseFile = t2(this.releaseFile, this), o.__super__.constructor.apply(this, arguments), this.attributes = e.Hash.box(n2), this.didChangeAttributes();
                          }
                          return n(o, i2), o.previewablePattern = /^image(\/(gif|png|jpe?g)|$)/, o.attachmentForFile = function(t3) {

                  Function Animation has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function Animation( elem, properties, options ) {
                      var result,
                          stopped,
                          index = 0,
                          length = Animation.prefilters.length,

                    Function Q has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    animate:false};var Q=function(t){_inherits(Tooltip,t);var n=_createSuper(Tooltip);function Tooltip(){_classCallCheck(this,Tooltip);return n.apply(this,arguments)}_createClass(Tooltip,[{key:"_setup",value:
                    /**
                         * Creates a new instance of a Tooltip.
                         * @class
                         * @name Tooltip

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

                            t2 = e.findClosestElementFromNode, i = e.nodeIsEmptyTextNode, n = e.nodeIsBlockStartComment, o = e.normalizeSpaces, r = e.summarizeStringChange, s = e.tagName, e.MutationObserver = function(e2) {
                              function c2(t3) {
                                this.element = t3, this.didMutate = a(this.didMutate, this), this.observer = new window.MutationObserver(this.didMutate), this.start();
                              }
                              var h, p, d, f;

                      Function ToolbarController has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              n = e.handleEvent, i = e.triggerEvent, t2 = e.findClosestElementFromNode, e.ToolbarController = function(e2) {
                                function s2(t3) {
                                  this.element = t3, this.didKeyDownDialogInput = o(this.didKeyDownDialogInput, this), this.didClickDialogButton = o(this.didClickDialogButton, this), this.didClickAttributeButton = o(this.didClickAttributeButton, this), this.didClickActionButton = o(this.didClickActionButton, this), this.attributes = {}, this.actions = {}, this.resetDialogInputs(), n("mousedown", {onElement: this.element, matchingSelector: a, withCallback: this.didClickActionButton}), n("mousedown", {onElement: this.element, matchingSelector: c, withCallback: this.didClickAttributeButton}), n("click", {onElement: this.element, matchingSelector: v, preventDefault: true}), n("click", {onElement: this.element, matchingSelector: l, withCallback: this.didClickDialogButton}), n("keydown", {onElement: this.element, matchingSelector: h, withCallback: this.didKeyDownDialogInput});
                                }
                                var a, u, c, l, h, p, d, f, g, m, v;

                        Function flip has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function flip(_ref) {
                            var state = _ref.state, options = _ref.options, name = _ref.name;
                            if (state.modifiersData[name]._skip) {
                              return;
                            }

                          Function Editor has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  e.Editor = function() {
                                    function n(n2, o, r) {
                                      this.composition = n2, this.selectionManager = o, this.element = r, this.insertFiles = t2(this.insertFiles, this), this.undoManager = new e.UndoManager(this.composition), this.filters = i.slice(0);
                                    }
                                    var i;

                            Function preventOverflow has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function preventOverflow(_ref) {
                                var state = _ref.state, options = _ref.options, name = _ref.name;
                                var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
                                var overflow = detectOverflow(state, {
                                  boundary,

                              Function D has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                              Open

                              hOffset:0};var D=function(t){_inherits(Dropdown,t);var i=_createSuper(Dropdown);function Dropdown(){_classCallCheck(this,Dropdown);return i.apply(this,arguments)}_createClass(Dropdown,[{key:"_setup",value:
                              /**
                                   * Creates a new instance of a dropdown.
                                   * @class
                                   * @name Dropdown

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

                              function Sizzle( selector, context, results, seed ) {
                                  var m, i, elem, nid, nidselect, match, groups, newSelector,
                                      newContext = context && context.ownerDocument,
                              
                                      // nodeType defaults to 9, since context defaults to document

                                Function CHILD has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        "CHILD": function( type, what, argument, first, last ) {
                                            var simple = type.slice( 0, 3 ) !== "nth",
                                                forward = type.slice( -4 ) !== "last",
                                                ofType = what === "of-type";
                                
                                
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language