rosa-abf/rosa-build

View on GitHub
app/assets/javascripts/lib/bootstrap-typeahead.js

Summary

Maintainability
C
1 day
Test Coverage

Showing 6 of 6 total issues

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

/*!
* bootstrap-typeahead.js v0.0.3 (http://www.upbootstrap.com)
* Copyright 2012-2014 Twitter Inc.
* Licensed under MIT (https://github.com/biggora/bootstrap-ajax-typeahead/blob/master/LICENSE)
* See Demo: http://plugins.upbootstrap.com/bootstrap-ajax-typeahead
Severity: Minor
Found in app/assets/javascripts/lib/bootstrap-typeahead.js - About 5 hrs to fix

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

    var Typeahead = function(element, options) {
    //deal with scrollBar
    var defaultOptions=$.fn.typeahead.defaults;
    if(options.scrollBar){
    Severity: Minor
    Found in app/assets/javascripts/lib/bootstrap-typeahead.js - About 1 hr to fix

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

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

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

        keyup: function(e) {
        switch (e.keyCode) {
        case 40: // down arrow
        case 38: // up arrow
        case 16: // shift
        Severity: Minor
        Found in app/assets/javascripts/lib/bootstrap-typeahead.js - About 1 hr to fix

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

          mouseleave: function(e) {
          this.mousedover = false
          if (!this.focused && this.shown)
          this.hide()
          }
          Severity: Minor
          Found in app/assets/javascripts/lib/bootstrap-typeahead.js and 1 other location - About 45 mins to fix
          app/assets/javascripts/lib/bootstrap-typeahead.js on lines 425..429

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

          blur: function(e) {
          this.focused = false
          if (!this.mousedover && this.shown)
          this.hide()
          },
          Severity: Minor
          Found in app/assets/javascripts/lib/bootstrap-typeahead.js and 1 other location - About 45 mins to fix
          app/assets/javascripts/lib/bootstrap-typeahead.js on lines 441..445
          Category
          Status