Showing 110 of 168 total issues
File jquery-terminal.js
has 3622 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**@license
* __ _____ ________ __
* / // _ /__ __ _____ ___ __ _/__ ___/__ ___ ______ __ __ __ ___ / /
* __ / // // // // // _ // _// // / / // _ // _// // // \/ // _ \/ /
* / / // // // // // ___// / / // / / // ___// / / / / // // /\ // // / /__
Function terminal
has 1464 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.terminal = function(init_interpreter, options) {
// -----------------------------------------------------------------------
// :: helper function
// -----------------------------------------------------------------------
function get_processed_command(command) {
Function cmd
has 721 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.cmd = function(options) {
var self = this;
var maybe_data = self.data('cmd');
if (maybe_data) {
return maybe_data;
Function keydown_event
has 242 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function keydown_event(e) {
var result, pos, len;
if (typeof options.keydown == 'function') {
result = options.keydown(e);
if (result !== undefined) {
Function from_ansi
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
from_ansi: (function() {
var color = {
30: 'black',
31: 'red',
32: 'green',
Function redraw
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var redraw = (function(self) {
var before = cursor.prev();
var after = cursor.next();
// -----------------------------------------------------------------------
// :: Draw line with the cursor
File jquery.noty.js
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* noty - jQuery Notification Plugin v2.1.0
* Contributors: https://github.com/needim/noty/graphs/contributors
*
* Examples and Documentation - http://needim.github.com/noty/
Function key_down
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
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') {
Function style
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
style: function() {
this.$bar.css({
overflow: 'hidden',
background: "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAoCAYAAAAPOoFWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAPZJREFUeNq81tsOgjAMANB2ov7/7ypaN7IlIwi9rGuT8QSc9EIDAsAznxvY4pXPKr05RUE5MEVB+TyWfCEl9LZApYopCmo9C4FKSMtYoI8Bwv79aQJU4l6hXXCZrQbokJEksxHo9KMOgc6w1atHXM8K9DVC7FQnJ0i8iK3QooGgbnyKgMDygBWyYFZoqx4qS27KqLZJjA1D0jK6QJcYEQEiWv9PGkTsbqxQ8oT+ZtZB6AkdsJnQDnMoHXHLGKOgDYuCWmYhEERCI5gaamW0bnHdA3k2ltlIN+2qKRyCND0bhqSYCyTB3CAOc4WusBEIpkeBuPgJMAAX8Hs1NfqHRgAAAABJRU5ErkJggg==') repeat-x scroll left top #fff"
Function make_interpreter
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function make_interpreter(user_interpreter, auth, finalize) {
finalize = finalize || $.noop;
var type = $.type(user_interpreter);
var result = {};
var commands;
Function format
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
format: function(str, options) {
var settings = $.extend({}, {
linksNoReferrer: false
}, options || {});
if (typeof str === 'string') {
Function split_equal
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
split_equal: function(str, length) {
var formatting = false;
var in_text = false;
var braket = 0;
var prev_format = '';
Function format_ansi
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function format_ansi(code) {
var controls = code.split(';');
var num;
var faited = false;
var reverse = false;
Function noty
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
window.noty = function noty(options) {
// This is for BC - Will be deleted on v2.2.0
var using_old = 0
, old_to_new = {
Function noty
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
window.noty = function noty(options) {
// This is for BC - Will be deleted on v2.2.0
var using_old = 0
, old_to_new = {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function date
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
humanize.date = function(format, timestamp) {
var jsdate = ((timestamp === undefined) ? new Date() : // Not provided
(timestamp instanceof Date) ? new Date(timestamp) : // JS Date()
new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
);
Function History
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function History(name, size) {
var enabled = true;
var storage_key = '';
if (typeof name === 'string' && name !== '') {
storage_key = name + '_';
File humanize_duration.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// HumanizeDuration.js - http://git.io/j0HgmQ
(function() {
var UNITS = {
Function login
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
login: function(auth, infinite, success, error) {
if (in_login) {
throw new Error(strings.notWhileLogin);
}
if (typeof auth !== 'function') {
Function json_stringify
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.json_stringify = function(object, level) {
var result = '', i;
level = level === undefined ? 1 : level;
var type = typeof object;
switch (type) {