lib/client/system/modules/eventemitter2.js
File eventemitter2.js
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;!function(exports, undefined) {
var isArray = Array.isArray ? Array.isArray : function _isArray(obj) {
return Object.prototype.toString.call(obj) === "[object Array]";
};
Function emit
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
EventEmitter.prototype.emit = function() {
this._events || init.call(this);
var type = arguments[0];
Function off
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
EventEmitter.prototype.off = function(type, listener) {
if (typeof listener !== 'function') {
throw new Error('removeListener only takes instances of Function');
}
Function growListenerTree
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function growListenerTree(type, listener) {
type = typeof type === 'string' ? type.split(this.delimiter) : type.slice();
var tree = this.listenerTree;
Function on
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
EventEmitter.prototype.on = function(type, listener) {
this._events || init.call(this);
// To avoid recursion in the case that type == "newListeners"! Before
// adding it to the listeners, first emit "newListeners".
Function searchListenerTree
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function searchListenerTree(handlers, type, tree, i) {
if (!tree) {
return;
}
Avoid deeply nested control flow statements. Open
Open
if (m > 0 && tree._listeners.length > m) {
tree._listeners.warned = true;
console.error('(node) warning: possible EventEmitter memory ' +
'leak detected. %d listeners added. ' +
Avoid too many return
statements within this function. Open
Open
return listeners;