CodeforLeipzig/stadtratmonitor

View on GitHub

Showing 611 of 611 total issues

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 _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 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

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

            if ("ontouchstart" in document.documentElement) {
              for (const element of [].concat(...document.body.children)) {
                EventHandler.off(element, "mouseover", noop);
              }
            }
      public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 4365..4369
      public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 4389..4393

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

      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

                }, d.prototype.canDecreaseBlockAttributeLevel = function() {
                  var t3;
                  return ((t3 = this.getBlock()) != null ? t3.getAttributeLevel() : void 0) > 0;
                }, d.prototype.decreaseBlockAttributeLevel = function() {
      public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 4344..4347

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

      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

                }, d.prototype.canDecreaseNestingLevel = function() {
                  var t3;
                  return ((t3 = this.getBlock()) != null ? t3.getNestingLevel() : void 0) > 0;
                }, d.prototype.canIncreaseNestingLevel = function() {
      public/assets/trix-1563ff9c10f74e143b3ded40a8458497eaf2f87a648a5cbbfebdb7dec3447a5e.js on lines 4359..4362

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

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

            if ("ontouchstart" in document.documentElement) {
              for (const element of [].concat(...document.body.children)) {
                EventHandler.on(element, "mouseover", noop);
              }
            }
      public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 3124..3128
      public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 4389..4393

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

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

            if ("ontouchstart" in document.documentElement) {
              for (const element of [].concat(...document.body.children)) {
                EventHandler.off(element, "mouseover", noop);
              }
            }
      public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 3124..3128
      public/assets/application-83027ab76a0c0e3ffb5bae510e4627be2c66fe2cccf3e0d566ea67ed819ad3e1.js on lines 4365..4369

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

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

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

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

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

                    _addEventListeners() {
                      EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, (event) => {
                        if (event.key !== ESCAPE_KEY$1) {
                          return;
                        }

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

                    async function topLevelLoad (url, fetchOpts, source, nativelyLoaded, lastStaticLoadPromise) {
                      if (!shimMode)
                        acceptingImportMaps = false;
                      await importMapPromise;
                      if (importHook) await importHook(url, typeof fetchOpts !== 'string' ? fetchOpts : {}, '');

                    Function html has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        html: function( value ) {
                            return access( this, function( value ) {
                                var elem = this[ 0 ] || {},
                                    i = 0,
                                    l = this.length;

                      Function computeAutoPlacement has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function computeAutoPlacement(state, options) {
                          if (options === void 0) {
                            options = {};
                          }
                          var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;

                        Function getBoundingClientRect has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function getBoundingClientRect(element, includeScale, isFixedStrategy) {
                            if (includeScale === void 0) {
                              includeScale = false;
                            }
                            if (isFixedStrategy === void 0) {

                          Function addHandler has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function addHandler(element, originalTypeEvent, handler, delegationFunction, oneOff) {
                              if (typeof originalTypeEvent !== "string" || !element) {
                                return;
                              }
                              let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction);
                            Severity
                            Category
                            Status
                            Source
                            Language