Showing 110 of 168 total issues
Function test
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
test: function() {
var term = $.terminal.active();
if (!term) {
term = $('body').terminal($.noop).css('margin', 0);
var margin = term.outerHeight() - term.height();
Function commands
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function commands(command, silent, exec) {
try {
if (!ghost()) {
prev_command = $.terminal.splitCommand(command).name;
if (exec && typeof settings.historyFilter == 'function' &&
Function close
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
close:function () {
if (this.closed) return;
if (this.$bar && this.$bar.hasClass('i-am-closing-now')) return;
Function relativeTime
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
humanize.relativeTime = function(timestamp) {
timestamp = (timestamp === undefined) ? humanize.time() : timestamp;
var currTime = humanize.time();
var timeDiff = currTime - timestamp;
Function format
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
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') {
Function add
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function(element, interval, label, fn, times, belay) {
var counter = 0;
if (jQuery.isFunction(label)) {
if (!times) {
Function parse
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
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]);
Function focus
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
focus: function(toggle, silent) {
self.oneTime(1, function() {
if (terminals.length() === 1) {
if (toggle === false) {
try {
Function draw_line
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function draw_line(string, options) {
// prevent exception in display exception
try {
var line_settings = $.extend({
raw: false,
Consider simplifying this complex logical expression. Open
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();
Function remove
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
remove: function(element, label, fn) {
var timers = element.$timers, ret;
if (timers) {
Function show
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
show:function () {
var self = this;
$(self.options.layout.container.selector).append(self.$bar);
Function flush
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
flush: function() {
try {
var wrapper;
// print all lines
$.each(output_buffer, function(i, line) {
Function make_object_interpreter
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 === '') {
Function make_json_rpc_object
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function make_json_rpc_object(url, auth, success) {
$.jrpc(url, 'system.describe', [], function(ret) {
var commands = [];
if (ret.procs) {
var interpreter_object = {};
Function Cycle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Cycle(init) {
var data = init ? [init] : [];
var pos = 0;
$.extend(this, {
get: function() {
Function recur
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(function recur(interpreters, success) {
if (interpreters.length) {
var first = interpreters[0];
var rest = interpreters.slice(1);
var type = $.type(first);
Function complete_helper
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function jrpc
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
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]});
Function pop
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
pop: function(string) {
if (string !== undefined) {
echo_command(string);
}
var token = self.token(true);