brianwisti/marysplace-rails

View on GitHub
app/assets/javascripts/typeahead.js

Summary

Maintainability
B
6 hrs
Test Coverage

File typeahead.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* =============================================================
 * bootstrap-typeahead.js v2.0.3
 * http://twitter.github.com/bootstrap/javascript.html#typeahead
 * =============================================================
 * Copyright 2012 Twitter, Inc.
Severity: Minor
Found in app/assets/javascripts/typeahead.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

            if (this.options.ajax) {
                var ajax = this.options.ajax;
                if (typeof ajax == "string") {
                    ajax = { url:ajax };
                }
    Severity: Critical
    Found in app/assets/javascripts/typeahead.js - About 1 hr to fix

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

          var Typeahead = function (element, options) {
              this.$element = $(element)
              this.options = $.extend({}, $.fn.typeahead.defaults, options)
              this.matcher = this.options.matcher || this.matcher
              this.sorter = this.options.sorter || this.sorter
      Severity: Minor
      Found in app/assets/javascripts/typeahead.js - About 1 hr to fix

        Function ajaxLookup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                ajaxLookup: function () {
            
                    var query = this.$element.val();
                    
                    if (query == this.query) {
        Severity: Minor
        Found in app/assets/javascripts/typeahead.js - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status