thiagofm/memcached-manager

View on GitHub
lib/public/javascripts/jquery-terminal.js

Summary

Maintainability
F
1 mo
Test Coverage

File jquery-terminal.js has 3622 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**@license
 *       __ _____                     ________                              __
 *      / // _  /__ __ _____ ___ __ _/__  ___/__ ___ ______ __ __  __ ___  / /
 *  __ / // // // // // _  // _// // / / // _  // _//     // //  \/ // _ \/ /
 * /  / // // // // // ___// / / // / / // ___// / / / / // // /\  // // / /__
Severity: Major
Found in lib/public/javascripts/jquery-terminal.js - About 1 wk to fix

    Function terminal has 1464 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        $.fn.terminal = function(init_interpreter, options) {
            // -----------------------------------------------------------------------
            // :: helper function
            // -----------------------------------------------------------------------
            function get_processed_command(command) {
    Severity: Major
    Found in lib/public/javascripts/jquery-terminal.js - About 1 wk to fix

      Function cmd has 721 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.fn.cmd = function(options) {
              var self = this;
              var maybe_data = self.data('cmd');
              if (maybe_data) {
                  return maybe_data;
      Severity: Major
      Found in lib/public/javascripts/jquery-terminal.js - About 3 days to fix

        Function keydown_event has 242 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function keydown_event(e) {
                    var result, pos, len;
                    if (typeof options.keydown == 'function') {
                        result = options.keydown(e);
                        if (result !== undefined) {
        Severity: Major
        Found in lib/public/javascripts/jquery-terminal.js - About 1 day to fix

          Function from_ansi has 164 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  from_ansi: (function() {
                      var color = {
                          30: 'black',
                          31: 'red',
                          32: 'green',
          Severity: Major
          Found in lib/public/javascripts/jquery-terminal.js - About 6 hrs to fix

            Function redraw has 151 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    var redraw = (function(self) {
                        var before = cursor.prev();
                        var after = cursor.next();
                        // -----------------------------------------------------------------------
                        // :: Draw line with the cursor
            Severity: Major
            Found in lib/public/javascripts/jquery-terminal.js - About 6 hrs to fix

              Function key_down has 108 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function key_down(e) {
                          // Prevent to be executed by cmd: CTRL+D, TAB, CTRL+TAB (if more then
                          // one terminal)
                          var result, i, top = interpreters.top();
                          if ($.type(top.keydown) === 'function') {
              Severity: Major
              Found in lib/public/javascripts/jquery-terminal.js - About 4 hrs to fix

                Function make_interpreter has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function make_interpreter(user_interpreter, auth, finalize) {
                            finalize = finalize || $.noop;
                            var type = $.type(user_interpreter);
                            var result = {};
                            var commands;
                Severity: Major
                Found in lib/public/javascripts/jquery-terminal.js - About 3 hrs to fix

                  Function format has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          format: function(str, options) {
                              var settings = $.extend({}, {
                                  linksNoReferrer: false
                              }, options || {});
                              if (typeof str === 'string') {
                  Severity: Major
                  Found in lib/public/javascripts/jquery-terminal.js - About 3 hrs to fix

                    Function split_equal has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            split_equal: function(str, length) {
                                var formatting = false;
                                var in_text = false;
                                var braket = 0;
                                var prev_format = '';
                    Severity: Major
                    Found in lib/public/javascripts/jquery-terminal.js - About 3 hrs to fix

                      Function format_ansi has 80 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  function format_ansi(code) {
                                      var controls = code.split(';');
                                      var num;
                                      var faited = false;
                                      var reverse = false;
                      Severity: Major
                      Found in lib/public/javascripts/jquery-terminal.js - About 3 hrs to fix

                        Function History has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function History(name, size) {
                                var enabled = true;
                                var storage_key = '';
                                if (typeof name === 'string' && name !== '') {
                                    storage_key = name + '_';
                        Severity: Major
                        Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

                          Function login has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                          login: function(auth, infinite, success, error) {
                                              if (in_login) {
                                                  throw new Error(strings.notWhileLogin);
                                              }
                                              if (typeof auth !== 'function') {
                          Severity: Major
                          Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

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

                                $.json_stringify = function(object, level) {
                                    var result = '', i;
                                    level = level === undefined ? 1 : level;
                                    var type = typeof object;
                                    switch (type) {
                            Severity: Major
                            Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

                              Function test has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      test: function() {
                                          var term = $.terminal.active();
                                          if (!term) {
                                              term = $('body').terminal($.noop).css('margin', 0);
                                              var margin = term.outerHeight() - term.height();
                              Severity: Major
                              Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

                                Function commands has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function commands(command, silent, exec) {
                                            try {
                                                if (!ghost()) {
                                                    prev_command = $.terminal.splitCommand(command).name;
                                                    if (exec && typeof settings.historyFilter == 'function' &&
                                Severity: Major
                                Found in lib/public/javascripts/jquery-terminal.js - About 2 hrs to fix

                                  Function format has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      sprintf.format = function(parse_tree, argv) {
                                          var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length;
                                          for (i = 0; i < tree_length; i++) {
                                              node_type = get_type(parse_tree[i]);
                                              if (node_type === 'string') {
                                  Severity: Minor
                                  Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                    Function add has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                                add: function(element, interval, label, fn, times, belay) {
                                                    var counter = 0;
                                    
                                                    if (jQuery.isFunction(label)) {
                                                        if (!times) {
                                    Severity: Minor
                                    Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                          sprintf.parse = function(fmt) {
                                              var _fmt = fmt, match = [], parse_tree = [], arg_names = 0;
                                              while (_fmt) {
                                                  if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
                                                      parse_tree.push(match[0]);
                                      Severity: Minor
                                      Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                        Function draw_line has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                function draw_line(string, options) {
                                                    // prevent exception in display exception
                                                    try {
                                                        var line_settings = $.extend({
                                                            raw: false,
                                        Severity: Minor
                                        Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                          Function focus has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                                          focus: function(toggle, silent) {
                                                              self.oneTime(1, function() {
                                                                  if (terminals.length() === 1) {
                                                                      if (toggle === false) {
                                                                          try {
                                          Severity: Minor
                                          Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                            Consider simplifying this complex logical expression.
                                            Open

                                                            if (reverse_search && (e.which === 35 || e.which === 36 ||
                                                                                   e.which === 37 || e.which === 38 ||
                                                                                   e.which === 39 || e.which === 40 ||
                                                                                   e.which === 13 || e.which === 27)) {
                                                                clear_reverse_state();
                                            Severity: Critical
                                            Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                          remove: function(element, label, fn) {
                                                              var timers = element.$timers, ret;
                                              
                                                              if (timers) {
                                              
                                              
                                              Severity: Minor
                                              Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                                Function flush has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                                flush: function() {
                                                                    try {
                                                                        var wrapper;
                                                                        // print all lines
                                                                        $.each(output_buffer, function(i, line) {
                                                Severity: Minor
                                                Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                                  Function make_object_interpreter has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                          function make_object_interpreter(object, arity, fallback) {
                                                              // function that maps commands to object methods
                                                              // it keeps terminal context
                                                              return function(user_command, terminal) {
                                                                  if (user_command === '') {
                                                  Severity: Minor
                                                  Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                            function make_json_rpc_object(url, auth, success) {
                                                                $.jrpc(url, 'system.describe', [], function(ret) {
                                                                    var commands = [];
                                                                    if (ret.procs) {
                                                                        var interpreter_object = {};
                                                    Severity: Minor
                                                    Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                                      Function Cycle has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          function Cycle(init) {
                                                              var data = init ? [init] : [];
                                                              var pos = 0;
                                                              $.extend(this, {
                                                                  get: function() {
                                                      Severity: Minor
                                                      Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                        (function recur(interpreters, success) {
                                                                            if (interpreters.length) {
                                                                                var first = interpreters[0];
                                                                                var rest = interpreters.slice(1);
                                                                                var type = $.type(first);
                                                        Severity: Minor
                                                        Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                  function complete_helper(command, string, commands) {
                                                                      var test = command_line.get().substring(0, command_line.position());
                                                                      if (test !== command) {
                                                                          // command line changed between TABS - ignore
                                                                          return;
                                                          Severity: Minor
                                                          Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                $.jrpc = function(url, method, params, success, error) {
                                                                    ids[url] = ids[url] || 0;
                                                                    var request = $.json_stringify({
                                                                       'jsonrpc': '2.0', 'method': method,
                                                                        'params': params, 'id': ++ids[url]});
                                                            Severity: Minor
                                                            Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                              pop: function(string) {
                                                                                  if (string !== undefined) {
                                                                                      echo_command(string);
                                                                                  }
                                                                                  var token = self.token(true);
                                                              Severity: Minor
                                                              Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                        function make_basic_json_rpc_interpreter(url) {
                                                                            var service = function(method, params) {
                                                                                self.pause();
                                                                                $.jrpc(url, method, params, function(json) {
                                                                                    if (!json.error) {
                                                                Severity: Minor
                                                                Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                          parseArguments: function(string) {
                                                                              return $.map(string.match(command_re) || [], function(arg) {
                                                                                  if (arg[0] === "'" && arg[arg.length-1] === "'") {
                                                                                      return arg.replace(/^'|'$/g, '');
                                                                                  } else if (arg[0] === '"' && arg[arg.length-1] === '"') {
                                                                  Severity: Minor
                                                                  Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                                    exception: function(e, label) {
                                                                                        var message = exception_message(e);
                                                                                        if (label) {
                                                                                            message = '&#91;' + label + '&#93;: ' + message;
                                                                                        }
                                                                    Severity: Minor
                                                                    Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                                      push: function(interpreter, options) {
                                                                                          options = options || {};
                                                                                          options.name = options.name || prev_command;
                                                                                          options.prompt = options.prompt || options.name + ' ';
                                                                                          //names.push(options.name);
                                                                      Severity: Minor
                                                                      Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

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

                                                                                function reverse_history_search(next) {
                                                                                    var history_data = history.data();
                                                                                    var regex, save_string;
                                                                                    var len = history_data.length;
                                                                                    if (next && reverse_search_position > 0) {
                                                                        Severity: Minor
                                                                        Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                                                          Consider simplifying this complex logical expression.
                                                                          Open

                                                                                  if (this.length > 1) {
                                                                                      return this.each(function() {
                                                                                          $.fn.terminal.call($(this),
                                                                                                             init_interpreter,
                                                                                                             $.extend({name: self.selector}, options));
                                                                          Severity: Major
                                                                          Found in lib/public/javascripts/jquery-terminal.js - About 1 hr to fix

                                                                            Avoid deeply nested control flow statements.
                                                                            Open

                                                                                                            if (match[1] == '0') {
                                                                                                                //just closing
                                                                                                                inside = false;
                                                                                                                prev_color = prev_background = '';
                                                                                                            } else {
                                                                            Severity: Major
                                                                            Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                              Avoid deeply nested control flow statements.
                                                                              Open

                                                                                                      if (line[j] === '&') { // treat entity as one character
                                                                                                          var m = line.substring(j).match(/^(&[^;]+;)/);
                                                                                                          if (!m) {
                                                                                                              // should never happen if used by terminal, because
                                                                                                              // it always calls $.terminal.encode before this function
                                                                              Severity: Major
                                                                              Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                Avoid deeply nested control flow statements.
                                                                                Open

                                                                                                            if (last[last.length-1] !== ']') {
                                                                                                                prev_format = last.match(format_begin_re)[1];
                                                                                                                output_line += ']';
                                                                                                            } else if (output_line.match(format_last_re)) {
                                                                                                                var line_len = output_line.length;
                                                                                Severity: Major
                                                                                Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                  Avoid deeply nested control flow statements.
                                                                                  Open

                                                                                                      if (terminals.length() > 1) {
                                                                                                          self.focus(false);
                                                                                                          return false;
                                                                                                      }
                                                                                  Severity: Major
                                                                                  Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                    Avoid deeply nested control flow statements.
                                                                                    Open

                                                                                                                        if (arguments[i] === undef) {
                                                                                                                            match[i] = undef;
                                                                                                                        }
                                                                                    Severity: Major
                                                                                    Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                      Avoid deeply nested control flow statements.
                                                                                      Open

                                                                                                      } else if (e.which === 8) { //backspace
                                                                                                          if (reverse_search) {
                                                                                                              reverse_search_string = reverse_search_string.slice(0, -1);
                                                                                                              draw_reverse_prompt();
                                                                                                          } else {
                                                                                      Severity: Major
                                                                                      Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                        Avoid deeply nested control flow statements.
                                                                                        Open

                                                                                                                    if (interpreters.size() > 1 ||
                                                                                                                        settings.login !== undefined) {
                                                                                                                        self.pop('');
                                                                                                                    } else {
                                                                                                                        self.resume();
                                                                                        Severity: Major
                                                                                        Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                          Avoid deeply nested control flow statements.
                                                                                          Open

                                                                                                                      for (var _fn in timers[label]) {
                                                                                                                          if (timers[label].hasOwnProperty(_fn)) {
                                                                                                                              window.clearInterval(timers[label][_fn]);
                                                                                                                              delete timers[label][_fn];
                                                                                                                          }
                                                                                          Severity: Major
                                                                                          Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                            } else if (e.which === 34) { // PAGE DOWN
                                                                                                                self.scroll(self.height());
                                                                                                            } else if (e.which === 33) { // PAGE UP
                                                                                                                self.scroll(-self.height());
                                                                                                            } else {
                                                                                            Severity: Major
                                                                                            Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                              Function add has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                              Open

                                                                                                          add: function(element, interval, label, fn, times, belay) {
                                                                                              Severity: Minor
                                                                                              Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                Avoid deeply nested control flow statements.
                                                                                                Open

                                                                                                                        while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
                                                                                                                            if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) {
                                                                                                                                field_list.push(field_match[1]);
                                                                                                                            }
                                                                                                                            else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) {
                                                                                                Severity: Major
                                                                                                Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                  Avoid deeply nested control flow statements.
                                                                                                  Open

                                                                                                                                  if (rpc_count === 1) {
                                                                                                                                      function_interpreter = make_basic_json_rpc_interpreter(first);
                                                                                                                                  } else {
                                                                                                                                      self.error(strings.oneRPCWithIgnore);
                                                                                                                                  }
                                                                                                  Severity: Major
                                                                                                  Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                    Avoid deeply nested control flow statements.
                                                                                                    Open

                                                                                                                            if (4 !== r.readyState) {
                                                                                                                                try {
                                                                                                                                    r.abort();
                                                                                                                                } catch (error) {
                                                                                                                                    self.error(strings.ajaxAbortError);
                                                                                                    Severity: Major
                                                                                                    Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                      Avoid deeply nested control flow statements.
                                                                                                      Open

                                                                                                                          if (e.shiftKey) {
                                                                                                                              self.insert('\n');
                                                                                                                          } else {
                                                                                                                              if (history && command && !mask &&
                                                                                                                                  ((typeof options.historyFilter == 'function' &&
                                                                                                      Severity: Major
                                                                                                      Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                        Avoid deeply nested control flow statements.
                                                                                                        Open

                                                                                                                                            if (style.indexOf('g') !== -1) {
                                                                                                                                                style_str += 'text-shadow:0 0 5px ' + color + ';';
                                                                                                                                            }
                                                                                                        Severity: Major
                                                                                                        Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                          Avoid deeply nested control flow statements.
                                                                                                          Open

                                                                                                                                          if (match[1] != '0') {
                                                                                                                                              inside = true;
                                                                                                                                              output.push('[[' + code.join(';') + ']');
                                                                                                                                              // store colors to next use
                                                                                                                                              if (code[1]) {
                                                                                                          Severity: Major
                                                                                                          Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                            Avoid deeply nested control flow statements.
                                                                                                            Open

                                                                                                                                        if (function_interpreter) {
                                                                                                                                            self.error(strings.oneInterpreterFunction);
                                                                                                                                        } else {
                                                                                                                                            function_interpreter = first;
                                                                                                                                        }
                                                                                                            Severity: Major
                                                                                                            Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                              Avoid deeply nested control flow statements.
                                                                                                              Open

                                                                                                                                                  if (!silent) {
                                                                                                                                                      try {
                                                                                                                                                          settings.onTerminalChange(self);
                                                                                                                                                      } catch (e) {
                                                                                                                                                          display_exception(e, 'onTerminalChange');
                                                                                                              Severity: Major
                                                                                                              Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                Open

                                                                                                                                        for (i=strings.length-1; i>0; i--) {
                                                                                                                                            // treat escape space as part of the string
                                                                                                                                            if (strings[i-1][strings[i-1].length-1] == '\\') {
                                                                                                                                                string = strings[i-1] + ' ' + string;
                                                                                                                                            } else {
                                                                                                                Severity: Major
                                                                                                                Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                  Open

                                                                                                                                                  if (num_lines === 3) {
                                                                                                                                                      before.before('<div>' + $.terminal.encode(array[0], true) +
                                                                                                                                                                    '</div>');
                                                                                                                                                      draw_cursor_line(array[1], position-first_len-1);
                                                                                                                                                      after.after('<div class="clear">' +
                                                                                                                  Severity: Major
                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                    Open

                                                                                                                                                        if (new_object) {
                                                                                                                                                            $.extend(object, new_object);
                                                                                                                                                        }
                                                                                                                    Severity: Major
                                                                                                                    Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                      Open

                                                                                                                                              } else if (type === 'object') {
                                                                                                                                                  $.extend(object, first);
                                                                                                                                                  recur(rest, success);
                                                                                                                                              }
                                                                                                                      Severity: Major
                                                                                                                      Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                        Open

                                                                                                                                                    if (timers[label].hasOwnProperty(ret)) {
                                                                                                                                                        break;
                                                                                                                                                    }
                                                                                                                        Severity: Major
                                                                                                                        Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                          Open

                                                                                                                                                          if (result !== false) {
                                                                                                                                                              self.echo(result);
                                                                                                                                                          }
                                                                                                                          Severity: Major
                                                                                                                          Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                            Open

                                                                                                                                                        if (output_line.match(']')) {
                                                                                                                                                            prev_format = '';
                                                                                                                                                        }
                                                                                                                            Severity: Major
                                                                                                                            Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                              Open

                                                                                                                                                      if (!arg.hasOwnProperty(match[2][k])) {
                                                                                                                                                          throw(sprintf('[sprintf] property "%s" does not exist', match[2][k]));
                                                                                                                                                      }
                                                                                                                              Severity: Major
                                                                                                                              Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                                Open

                                                                                                                                                            if (fn.$timerID) {
                                                                                                                                                                window.clearInterval(timers[label][fn.$timerID]);
                                                                                                                                                                delete timers[label][fn.$timerID];
                                                                                                                                                            }
                                                                                                                                Severity: Major
                                                                                                                                Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                  Open

                                                                                                                                                              if (reverse_search_string.length !== j) {
                                                                                                                                                                  reverse_search_string = reverse_search_string.substring(0, j);
                                                                                                                                                                  draw_reverse_prompt();
                                                                                                                                                              }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                    Open

                                                                                                                                                                    if (result === false) {
                                                                                                                                                                        lines = lines.slice(0, position).
                                                                                                                                                                            concat(lines.slice(position+1));
                                                                                                                                                                    } else {
                                                                                                                                                                        lines = lines.slice(0, position).
                                                                                                                                    Severity: Major
                                                                                                                                    Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                                      Open

                                                                                                                                                                  if (matched[0].charAt(j) !== matched[i].charAt(j)) {
                                                                                                                                                                      break loop;
                                                                                                                                                                  }
                                                                                                                                      Severity: Major
                                                                                                                                      Found in lib/public/javascripts/jquery-terminal.js - About 45 mins to fix

                                                                                                                                        Consider simplifying this complex logical expression.
                                                                                                                                        Open

                                                                                                                                                                if (history && command && !mask &&
                                                                                                                                                                    ((typeof options.historyFilter == 'function' &&
                                                                                                                                                                      options.historyFilter(command)) ||
                                                                                                                                                                     !options.historyFilter)) {
                                                                                                                                                                    history.append(command);
                                                                                                                                        Severity: Major
                                                                                                                                        Found in lib/public/javascripts/jquery-terminal.js - About 40 mins to fix

                                                                                                                                          Function everyTime has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                          Open

                                                                                                                                                  everyTime: function(interval, label, fn, times, belay) {
                                                                                                                                          Severity: Minor
                                                                                                                                          Found in lib/public/javascripts/jquery-terminal.js - About 35 mins to fix

                                                                                                                                            Function jrpc has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                            Open

                                                                                                                                                $.jrpc = function(url, method, params, success, error) {
                                                                                                                                            Severity: Minor
                                                                                                                                            Found in lib/public/javascripts/jquery-terminal.js - About 35 mins to fix

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                                  return true;
                                                                                                                                              Severity: Major
                                                                                                                                              Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                                        return true;
                                                                                                                                                Severity: Major
                                                                                                                                                Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                                      return arg.replace(/\\ /g, ' ');
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                                        return;
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                                                  return true;
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                                                return false;
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                                      return true; // CMD+l jump into Omnibox on Chrome Mac
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                                        return true;
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                              Open

                                                                                                                                                                                  return true;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                Open

                                                                                                                                                                                    return true;
                                                                                                                                                                Severity: Major
                                                                                                                                                                Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                  Open

                                                                                                                                                                                              return false;
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                    Open

                                                                                                                                                                                    return false;
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                      Open

                                                                                                                                                                                          return parseFloat(arg);
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                                        Open

                                                                                                                                                                                                    return false;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                          Open

                                                                                                                                                                                                      return true;
                                                                                                                                                                          Severity: Major
                                                                                                                                                                          Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                            Open

                                                                                                                                                                                                        return true;
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                              Open

                                                                                                                                                                                                          return false;
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                Open

                                                                                                                                                                                                return false;
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in lib/public/javascripts/jquery-terminal.js - About 30 mins to fix

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

                                                                                                                                                                                                              } else {
                                                                                                                                                                                                                  try {
                                                                                                                                                                                                                      if (!silent && settings.onFocus(self) !== false) {
                                                                                                                                                                                                                          self.enable();
                                                                                                                                                                                                                      }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 3642..3651

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 63.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                              if (toggle === false) {
                                                                                                                                                                                                                  try {
                                                                                                                                                                                                                      if (!silent && settings.onBlur(self) !== false) {
                                                                                                                                                                                                                          self.disable();
                                                                                                                                                                                                                      }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 3651..3660

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 63.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                          if (_8bit_color && process_8bit && palette[num-1]) {
                                                                                                                                                                                                              output_color = palette[num-1];
                                                                                                                                                                                                          } else if (color[num]) {
                                                                                                                                                                                                              output_color = color[num];
                                                                                                                                                                                                          }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 2097..2101

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 61.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                          if (_8bit_background && process_8bit && palette[num-1]) {
                                                                                                                                                                                                              output_background = palette[num-1];
                                                                                                                                                                                                          } else if (background[num]) {
                                                                                                                                                                                                              output_background = background[num];
                                                                                                                                                                                                          }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 2092..2096

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 61.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              visible: (function() {
                                                                                                                                                                                                  var visible = self.visible;
                                                                                                                                                                                                  return function() {
                                                                                                                                                                                                      visible.apply(self, []);
                                                                                                                                                                                                      redraw();
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1490..1497

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 57.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              show: (function() {
                                                                                                                                                                                                  var show = self.show;
                                                                                                                                                                                                  return function() {
                                                                                                                                                                                                      show.apply(self, []);
                                                                                                                                                                                                      redraw();
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1482..1489

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 57.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              var color = {
                                                                                                                                                                                                  30: 'black',
                                                                                                                                                                                                  31: 'red',
                                                                                                                                                                                                  32: 'green',
                                                                                                                                                                                                  33: 'yellow',
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 2036..2047

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 55.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              var background = {
                                                                                                                                                                                                  40: 'black',
                                                                                                                                                                                                  41: 'red',
                                                                                                                                                                                                  42: 'green',
                                                                                                                                                                                                  43: 'yellow',
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 2024..2035

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 55.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              if ($.type(top.keydown) === 'function') {
                                                                                                                                                                                                  result = top.keydown(e, self);
                                                                                                                                                                                                  if (result !== undefined) {
                                                                                                                                                                                                      return result;
                                                                                                                                                                                                  }
                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 55 mins to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 3232..3237

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 53.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              if ($.type(settings.keydown) === 'function') {
                                                                                                                                                                                                  result = settings.keydown(e, self);
                                                                                                                                                                                                  if (result !== undefined) {
                                                                                                                                                                                                      return result;
                                                                                                                                                                                                  }
                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 55 mins to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 3215..3220

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 53.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                      } else if (position === first_len) {
                                                                                                                                                                                                          before.before(div(array[0]));
                                                                                                                                                                                                          draw_cursor_line(array[1], 0);
                                                                                                                                                                                                          lines_after(array.slice(2));
                                                                                                                                                                                                      } else {
                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1005..1052

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 50.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                          } else if (position === first_len) {
                                                                                                                                                                                                              before.before(div(array[0]));
                                                                                                                                                                                                              draw_cursor_line(array[1], 0);
                                                                                                                                                                                                              lines_after(array.slice(2));
                                                                                                                                                                                                          } else {
                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 995..1053

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 50.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  token: settings.login ? function(local) {
                                                                                                                                                                                                      return $.Storage.get(self.prefix_name(local) + '_token');
                                                                                                                                                                                                  } : $.noop,
                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 3997..3999

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 49.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                                  login_name: settings.login ? function(local) {
                                                                                                                                                                                                      return $.Storage.get(self.prefix_name(local) + '_login');
                                                                                                                                                                                                  } : $.noop,
                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 3991..3993

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 49.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              normal: {
                                                                                                                                                                                                  black: '#000',
                                                                                                                                                                                                  red: '#A00',
                                                                                                                                                                                                  green: '#008400',
                                                                                                                                                                                                  yellow: '#A50',
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 5 other locations - About 35 mins to fix
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 87..96
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 97..106
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 157..166
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1945..1954
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1955..1964

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 46.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              faited: {
                                                                                                                                                                                                  black: '#000',
                                                                                                                                                                                                  red: '#640000',
                                                                                                                                                                                                  green: '#006100',
                                                                                                                                                                                                  yellow: '#737300',
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 5 other locations - About 35 mins to fix
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 87..96
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 97..106
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 157..166
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1935..1944
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1955..1964

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 46.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

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

                                                                                                                                                                                              bold: {
                                                                                                                                                                                                  black: '#000',
                                                                                                                                                                                                  red: '#F55',
                                                                                                                                                                                                  green: '#44D544',
                                                                                                                                                                                                  yellow: '#FF5',
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in lib/public/javascripts/jquery-terminal.js and 5 other locations - About 35 mins to fix
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 87..96
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 97..106
                                                                                                                                                                                  lib/public/javascripts/humanize_duration.js on lines 157..166
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1935..1944
                                                                                                                                                                                  lib/public/javascripts/jquery-terminal.js on lines 1945..1954

                                                                                                                                                                                  Duplicated Code

                                                                                                                                                                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                                                                                                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                                                                                                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                                                                                                                  Tuning

                                                                                                                                                                                  This issue has a mass of 46.

                                                                                                                                                                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                                                                                                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                                                                                                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                                                                                                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                                                                                                                  Refactorings

                                                                                                                                                                                  Further Reading

                                                                                                                                                                                  There are no issues that match your filters.

                                                                                                                                                                                  Category
                                                                                                                                                                                  Status