Showing 110 of 168 total issues
Function doHumanization
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function doHumanization(ms, options) {
// Make sure we have a positive number.
// Has the nice sideffect of turning Number objects into primitives.
ms = Math.abs(ms);
Function make_basic_json_rpc_interpreter
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function make_basic_json_rpc_interpreter(url) {
var service = function(method, params) {
self.pause();
$.jrpc(url, method, params, function(json) {
if (!json.error) {
Function parseArguments
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
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] === '"') {
Function exception
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exception: function(e, label) {
var message = exception_message(e);
if (label) {
message = '[' + label + ']: ' + message;
}
Function push
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
push: function(interpreter, options) {
options = options || {};
options.name = options.name || prev_command;
options.prompt = options.prompt || options.name + ' ';
//names.push(options.name);
Function reverse_history_search
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Consider simplifying this complex logical expression. Open
Open
if (this.length > 1) {
return this.each(function() {
$.fn.terminal.call($(this),
init_interpreter,
$.extend({name: self.selector}, options));
Function intword
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
humanize.intword = function(number, units, kilo, decimals, decPoint, thousandsSep, suffixSep) {
Avoid deeply nested control flow statements. Open
Open
if (reverse_search_string.length !== j) {
reverse_search_string = reverse_search_string.substring(0, j);
draw_reverse_prompt();
}
Avoid deeply nested control flow statements. Open
Open
if (rpc_count === 1) {
function_interpreter = make_basic_json_rpc_interpreter(first);
} else {
self.error(strings.oneRPCWithIgnore);
}
Avoid deeply nested control flow statements. Open
Open
if (result !== false) {
self.echo(result);
}
Avoid deeply nested control flow statements. Open
Open
if (function_interpreter) {
self.error(strings.oneInterpreterFunction);
} else {
function_interpreter = first;
}
Avoid deeply nested control flow statements. Open
Open
if (match[1] != '0') {
inside = true;
output.push('[[' + code.join(';') + ']');
// store colors to next use
if (code[1]) {
Avoid deeply nested control flow statements. Open
Open
if (4 !== r.readyState) {
try {
r.abort();
} catch (error) {
self.error(strings.ajaxAbortError);
Avoid deeply nested control flow statements. Open
Open
if (interpreters.size() > 1 ||
settings.login !== undefined) {
self.pop('');
} else {
self.resume();
Avoid deeply nested control flow statements. Open
Open
if (style.indexOf('g') !== -1) {
style_str += 'text-shadow:0 0 5px ' + color + ';';
}
Avoid deeply nested control flow statements. Open
Open
if (match[1] == '0') {
//just closing
inside = false;
prev_color = prev_background = '';
} else {
Avoid deeply nested control flow statements. Open
Open
for (var _fn in timers[label]) {
if (timers[label].hasOwnProperty(_fn)) {
window.clearInterval(timers[label][_fn]);
delete timers[label][_fn];
}
Avoid deeply nested control flow statements. Open
Open
if (timers[label].hasOwnProperty(ret)) {
break;
}
Avoid deeply nested control flow statements. Open
Open
if (!arg.hasOwnProperty(match[2][k])) {
throw(sprintf('[sprintf] property "%s" does not exist', match[2][k]));
}