railsadminteam/rails_admin

View on GitHub
src/rails_admin/filtering-select.js

Summary

Maintainability
C
1 day
Test Coverage

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

    _initAutocomplete: function () {
      var self = this;

      return this.input.autocomplete({
        delay: this.options.searchDelay,
Severity: Major
Found in src/rails_admin/filtering-select.js - About 2 hrs to fix

    File filtering-select.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import jQuery from "jquery";
    import "jquery-ui/ui/widget.js";
    import "jquery-ui/ui/widgets/autocomplete.js";
    import I18n from "./i18n";
    
    
    Severity: Minor
    Found in src/rails_admin/filtering-select.js - About 2 hrs to fix

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

          _getResultSet: function (request, data, xhr) {
            var matcher = new RegExp(
              $.ui.autocomplete.escapeRegex(request.term),
              "i"
            );
      Severity: Minor
      Found in src/rails_admin/filtering-select.js - About 1 hr to fix

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

            _getSourceFunction: function (source) {
              var self = this;
              var requestIndex = 0;
        
              if ($.isArray(source)) {
        Severity: Minor
        Found in src/rails_admin/filtering-select.js - About 1 hr to fix

          Function _create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _create: function () {
                this.filtering_select = this.element.siblings(
                  '[data-input-for="' + this.element.attr("id") + '"]'
                );
          
          
          Severity: Minor
          Found in src/rails_admin/filtering-select.js - About 1 hr to fix

            Function change has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    change: function (event, ui) {
                      if (ui.item) {
                        return;
                      }
            
            
            Severity: Minor
            Found in src/rails_admin/filtering-select.js - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status