rbutrcom/rbutr-browser-extension

View on GitHub
src/vendors/typeahead.js

Summary

Maintainability
F
1 wk
Test Coverage

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

/*!
 * typeahead.js 0.9.3
 * https://github.com/twitter/typeahead
 * Copyright 2013 Twitter, Inc. and other contributors; Licensed MIT
 */
Severity: Major
Found in src/vendors/typeahead.js - About 2 days to fix

    Function TypeaheadView has 215 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var TypeaheadView = function() {
            var html = {
                wrapper: '<span class="twitter-typeahead"></span>',
                hint: '<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',
                dropdown: '<span class="tt-dropdown-menu"></span>'
    Severity: Major
    Found in src/vendors/typeahead.js - About 1 day to fix

      Function Dataset has 192 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var Dataset = function() {
              var keys = {
                  thumbprint: "thumbprint",
                  protocol: "protocol",
                  itemHash: "itemHash",
      Severity: Major
      Found in src/vendors/typeahead.js - About 7 hrs to fix

        Function DropdownView has 167 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var DropdownView = function() {
                var html = {
                    suggestionsList: '<span class="tt-suggestions"></span>'
                }, css = {
                    suggestionsList: {
        Severity: Major
        Found in src/vendors/typeahead.js - About 6 hrs to fix

          Function InputView has 121 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var InputView = function() {
                  function InputView(o) {
                      var that = this;
                      utils.bindAll(this);
                      this.specialKeyCodeMap = {
          Severity: Major
          Found in src/vendors/typeahead.js - About 4 hrs to fix

            Function PersistentStorage has 77 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var PersistentStorage = function() {
                    var ls, methods;
                    try {
                        ls = window.localStorage;
                        ls.setItem("~~~", "!");
            Severity: Major
            Found in src/vendors/typeahead.js - About 3 hrs to fix

              Function Transport has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var Transport = function() {
                      var pendingRequestsCount = 0, pendingRequests = {}, maxPendingRequests, requestCache;
                      function Transport(o) {
                          utils.bindAll(this);
                          o = utils.isString(o) ? {
              Severity: Major
              Found in src/vendors/typeahead.js - About 3 hrs to fix

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

                    var EventTarget = function() {
                        var eventSplitter = /\s+/;
                        return {
                            on: function(events, callback) {
                                var event;
                Severity: Minor
                Found in src/vendors/typeahead.js - About 1 hr to fix

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

                              initialize: function(datasetDefs) {
                                  var datasets;
                                  datasetDefs = utils.isArray(datasetDefs) ? datasetDefs : [ datasetDefs ];
                                  if (datasetDefs.length === 0) {
                                      $.error("no datasets provided");
                  Severity: Minor
                  Found in src/vendors/typeahead.js - About 1 hr to fix

                    Function _loadPrefetchData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                _loadPrefetchData: function(o) {
                                    var that = this, thumbprint = VERSION + (o.thumbprint || ""), storedThumbprint, storedProtocol, storedItemHash, storedAdjacencyList, isExpired, deferred;
                                    if (this.storage) {
                                        storedThumbprint = this.storage.get(keys.thumbprint);
                                        storedProtocol = this.storage.get(keys.protocol);
                    Severity: Minor
                    Found in src/vendors/typeahead.js - About 1 hr to fix

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

                                  _getLocalSuggestions: function(terms) {
                                      var that = this, firstChars = [], lists = [], shortestList, suggestions = [];
                                      utils.each(terms, function(i, term) {
                                          var firstChar = term.charAt(0);
                                          !~utils.indexOf(firstChars, firstChar) && firstChars.push(firstChar);
                      Severity: Minor
                      Found in src/vendors/typeahead.js - About 1 hr to fix

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

                                function buildDomStructure(input) {
                                    var $wrapper = $(html.wrapper), $dropdown = $(html.dropdown), $input = $(input), $hint = $(html.hint);
                                    $wrapper = $wrapper.css(css.wrapper);
                                    $dropdown = $dropdown.css(css.dropdown);
                                    $hint.css(css.hint).css({
                        Severity: Minor
                        Found in src/vendors/typeahead.js - About 1 hr to fix

                          There are no issues that match your filters.

                          Category
                          Status