ivaynberg/select2

View on GitHub

Showing 58 of 136 total issues

Function option has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  Results.prototype.option = function (data) {
    var option = document.createElement('li');
    option.classList.add('select2-results__option');
    option.classList.add('select2-results__option--selectable');

Severity: Major
Found in src/js/select2/results.js - About 2 hrs to fix

    File simplesearch.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    namespace Grav\Plugin;
    
    use Grav\Common\Page\Collection;
    use Grav\Common\Plugin;
    Severity: Minor
    Found in docs/plugins/simplesearch/simplesearch.php - About 2 hrs to fix

      File problems.php has 252 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      namespace Grav\Plugin;
      
      use Grav\Common\Cache;
      use Grav\Common\Plugin;
      Severity: Minor
      Found in docs/plugins/problems/problems.php - About 2 hrs to fix

        Function bind has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          Search.prototype.bind = function (decorated, container, $container) {
            var self = this;
        
            var resultsId = container.id + '-results';
        
        
        Severity: Minor
        Found in src/js/select2/dropdown/search.js - About 2 hrs to fix

          Function query has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            AjaxAdapter.prototype.query = function (params, callback) {
              var matches = [];
              var self = this;
          
              if (this._request != null) {
          Severity: Minor
          Found in src/js/select2/data/ajax.js - About 1 hr to fix

            Function Select2 has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var Select2 = function ($element, options) {
                if (Utils.GetData($element[0], 'select2') != null) {
                  Utils.GetData($element[0], 'select2').destroy();
                }
            
            
            Severity: Minor
            Found in src/js/select2/core.js - About 1 hr to fix

              Function query has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                Tags.prototype.query = function (decorated, params, callback) {
                  var self = this;
              
                  this._removeOldTags();
              
              
              Severity: Minor
              Found in src/js/select2/data/tags.js - About 1 hr to fix

                Function bind has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  BaseSelection.prototype.bind = function (container, $container) {
                    var self = this;
                
                    var resultsId = container.id + '-results';
                
                
                Severity: Minor
                Found in src/js/select2/selection/base.js - About 1 hr to fix

                  Function Decorate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    Utils.Decorate = function (SuperClass, DecoratorClass) {
                      var decoratedMethods = getMethods(DecoratorClass);
                      var superMethods = getMethods(SuperClass);
                  
                      function DecoratedClass () {
                  Severity: Minor
                  Found in src/js/select2/utils.js - About 1 hr to fix

                    Method notFound has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function notFound($query, $page, $taxonomies)
                        {
                            $searchable_types = ['title', 'content', 'taxonomy'];
                            $results = true;
                            $search_content = $this->config->get('plugins.simplesearch.search_content');
                    Severity: Minor
                    Found in docs/plugins/simplesearch/simplesearch.php - About 1 hr to fix

                      Method checkForPermissions has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function checkForPermissions($collection)
                          {
                              $user = $this->grav['user'];
                              $returnCollection = new Collection();
                              foreach ($collection as $page) {
                      Severity: Minor
                      Found in docs/plugins/simplesearch/simplesearch.php - About 1 hr to fix

                        Function bind has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          MultipleSelection.prototype.bind = function (container, $container) {
                            var self = this;
                        
                            MultipleSelection.__super__.bind.apply(this, arguments);
                        
                        
                        Severity: Minor
                        Found in src/js/select2/selection/multiple.js - About 1 hr to fix

                          Function _resolveWidth has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            Select2.prototype._resolveWidth = function ($element, method) {
                              var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
                          
                              if (method == 'resolve') {
                                var styleWidth = this._resolveWidth($element, 'style');
                          Severity: Minor
                          Found in src/js/select2/core.js - About 1 hr to fix

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

                              MultipleSelection.prototype.update = function (data) {
                                this.clear();
                            
                                if (data.length === 0) {
                                  return;
                            Severity: Minor
                            Found in src/js/select2/selection/multiple.js - About 1 hr to fix

                              Method renderProblems has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function renderProblems()
                                  {
                                      $theme = 'antimatter';
                              
                                      /** @var Uri $uri */
                              Severity: Minor
                              Found in docs/plugins/problems/problems.php - About 1 hr to fix

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

                                  SelectAdapter.prototype.item = function ($option) {
                                    var data = {};
                                
                                    data = Utils.GetData($option[0], 'data');
                                
                                
                                Severity: Minor
                                Found in src/js/select2/data/select.js - About 1 hr to fix

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

                                      function wrapper (obj, child) {
                                        var data = obj.results;
                                  
                                        for (var i = 0; i < data.length; i++) {
                                          var option = data[i];
                                  Severity: Minor
                                  Found in src/js/select2/data/tags.js - About 1 hr to fix

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

                                      Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
                                        var separators = options.get('tokenSeparators') || [];
                                        var term = params.term;
                                        var i = 0;
                                    
                                    
                                    Severity: Minor
                                    Found in src/js/select2/data/tokenizer.js - About 1 hr to fix

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

                                        AllowClear.prototype._handleClear = function (_, evt) {
                                          // Ignore the event if it is disabled
                                          if (this.isDisabled()) {
                                            return;
                                          }
                                      Severity: Minor
                                      Found in src/js/select2/selection/allowClear.js - About 1 hr to fix

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

                                          ArrayAdapter.prototype.convertToOptions = function (data) {
                                            var self = this;
                                        
                                            var $existing = this.$element.find('option');
                                            var existingIds = $existing.map(function () {
                                        Severity: Minor
                                        Found in src/js/select2/data/array.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language