Showing 32 of 62 total issues
Function createObjectWith
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
function createObjectWith(aClass, aArguments) {
var args = [aClass];
if (aArguments)
args = args.concat(arraySlice.call(aArguments));
var result = new (Function.prototype.bind.apply(aClass, args));
- 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 createObject
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function createObject(aClass) {
var result = new (Function.prototype.bind.apply(aClass, arguments));
if (aClass !== Object && aClass !== Array && aClass !== RegExp) {
var vPrototype = aClass.prototype;
if (!vPrototype.hasOwnProperty('Class')) {
- 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 exports
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.initConfig({
clean: {
build: {
src: ["lib", ".cache", "tests.js.map", "tests.js"]
Function _getFilterFunc
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function _getFilterFunc(filter){
if (!filter) {
filter = function all(name, value){return value};
} else if (filter === 1) {
filter = function raiseErrorOnSuper(name, value) {
- 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 isInheritedFrom
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function isInheritedFrom(ctor, superCtor, throwError) {
if (typeof superCtor === 'string') {return isInheritedFromStr(ctor, superCtor, throwError);}
if (ctor === superCtor) {
if (throwError)
throw new Error('Circular inherits found!');
- 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 isInheritedFromStr
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function isInheritedFromStr(ctor, superStr, throwError) {
if (ctor.name === superStr) {
if (throwError)
throw new Error('Circular inherits found!');
else
- 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 getParentClass
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function getParentClass(ctor) {
var result;
if (typeof ctor === 'object' && ctor !== null) {
ctor = getPrototypeOf(ctor);
ctor = getOwnPropValue(ctor, 'Class') || ctor.constructor;
- 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 _inherits
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function _inherits(ctor, superCtor, staticInherit) {
var v = getSuperCtor(ctor);
var mixinCtor = ctor.mixinCtor_;
if (mixinCtor && v === mixinCtor) {
ctor = mixinCtor;
- 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 createObjectWith
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createObjectWith(aClass, aArguments) {
var args = [aClass];
if (aArguments)
args = args.concat(arraySlice.call(aArguments));
var result = new (Function.prototype.bind.apply(aClass, args));
Function isInheritedFrom
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function isInheritedFrom(ctor, superCtor, throwError) {
if (typeof superCtor === 'string') {return isInheritedFromStr(ctor, superCtor, throwError);}
if (ctor === superCtor) {
if (throwError)
throw new Error('Circular inherits found!');
Function createObject
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createObject(aClass) {
var result = new (Function.prototype.bind.apply(aClass, arguments));
if (aClass !== Object && aClass !== Array && aClass !== RegExp) {
var vPrototype = aClass.prototype;
if (!vPrototype.hasOwnProperty('Class')) {
Function isInheritedFromStr
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function isInheritedFromStr(ctor, superStr, throwError) {
if (ctor.name === superStr) {
if (throwError)
throw new Error('Circular inherits found!');
else
Function defineProperty
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function defineProperty(object, key, value, aOptions) {
var descriptor, isAccessor, writable;
writable = true;
descriptor = {
configurable: true,
Function newPrototype
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function newPrototype(aClass, aConstructor) {
//Object.create(prototype) only for ES5
//Object.create(prototype, initProps) only for ES6
//For Browser not support ES5/6:
// var Object = function() { this.constructor = aConstructor; };
Function getClass
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getClass(aClassName, aScope, aValues) {
var vKeys;
if (typeof aScope === 'function') {
return aScope(aClassName)
} else if (isArray(aScope)) {
Function execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
InheritsEx.execute = function(ctor, superCtors, aScope, aValues) {
var isStrCtor;
var getClass = InheritsEx.getClass;
if (isStrCtor = isString(ctor)) {
ctor = getClass(ctor, aScope, aValues);
Function _getFilterFunc
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _getFilterFunc(filter){
if (!filter) {
filter = function all(name, value){return value};
} else if (filter === 1) {
filter = function raiseErrorOnSuper(name, value) {
Function isEmptyFunction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function isEmptyFunction(aFunc, istanbul) {
var vStr = aFunc.toString();
var result = /^function\s*\S*\s*\((.|[\n\r\u2028\u2029])*\)\s*{[\s;]*}$/g.test(vStr);
if (!result) {result = isEmptyCtor(vStr)}
- 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 createFunction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function createFunction(name, args, body, scope, values) {
if (arguments.length === 1) return Function('function ' + name + '(){}\nreturn ' + name + ';')();
if (isString(args)) {
values = scope;
scope = body;
- 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 getProtoChain
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getProtoChain(ctor, depth) {
if (depth == null) {
depth = 0;
}
if (depth >= getProtoChain.maxDepth) {
- 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"