Showing 256 of 374 total issues
Consider simplifying this complex logical expression. Open
if (build && build.conf) {
var conf = build.conf;
this.conf = conf;
this.name(conf.name);
this.platform(conf.platform);
Consider simplifying this complex logical expression. Open
if (status) {
status.agents = status.agents || [];
this.logs((status.logs || []).map(function(log) {
return new Msg(log);
}));
Function 50
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
},{"./binary":48,"./is-buffer":50,"component-emitter":51,"debug":9,"isarray":52,"json3":53}],50:[function(require,module,exports){
(function (global){
module.exports = isBuf;
- 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 serialize
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
Function 11
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
},{"./lib/":11}],11:[function(require,module,exports){
/**
* Module dependencies.
*/
- 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 40
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
},{}],40:[function(require,module,exports){
/**
* Parses an URI
*
* @author Steven Levithan <stevenlevithan.com> (MIT license)
- 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 update
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
update: function(build, sender, by, priority, message, args) {
Avoid deeply nested control flow statements. Open
if (!(mixin in calledMixins)) {
calledMixins[mixin] = 1;
mixin.call(objectInstance, p, p.constructor);
}
Avoid deeply nested control flow statements. Open
} else if (typeof value.toJSON == "function" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, "toJSON"))) {
// Prototype <= 1.6.1 adds non-standard `toJSON` methods to the
// `Number`, `String`, `Date`, and `Array` prototypes. JSON 3
// ignores all `toJSON` methods on these objects unless they are
// defined directly on an instance.
Avoid deeply nested control flow statements. Open
if (charCode == 45) {
isSigned = true;
charCode = source.charCodeAt(++Index);
}
Avoid deeply nested control flow statements. Open
} else if (copy !== undefined) {
target[name] = copy;
}
Avoid deeply nested control flow statements. Open
if (ko.utils.arrayIndexOf(cyclicDependencyStack, bindingDependencyKey) !== -1) {
throw Error("Cannot combine the following bindings, because they have a cyclic dependency: " + cyclicDependencyStack.join(", "));
} else {
pushBinding(bindingDependencyKey);
}
Avoid deeply nested control flow statements. Open
if (!(isFunction && property == "prototype") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {
callback(property);
}
Avoid deeply nested control flow statements. Open
for (length = value.length; length--;) {
update(value, length, callback);
}
Avoid deeply nested control flow statements. Open
} else if (c === 47 && i && tok.length > 1) { // "/"
// Look at the end of the previous token to determine if the slash is actually division
var match = toks[i-1].match(divisionLookBehind);
if (match && !keywordRegexLookBehind[match[0]]) {
// The slash is actually a division punctuator; re-parse the remainder of the string (not including the slash)
Avoid deeply nested control flow statements. Open
if (isSigned) {
abort();
}
Avoid deeply nested control flow statements. Open
if (parseSupported) {
try {
// Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
parseSupported = !parse('"\t"');
} catch (exception) {}
Avoid deeply nested control flow statements. Open
if (charCode >= 48 && charCode <= 57) {
// Leading zeroes are interpreted as octal literals.
if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {
// Illegal octal literal.
abort();
Avoid deeply nested control flow statements. Open
if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) {
callback(property);
}
Avoid deeply nested control flow statements. Open
if (value > -1 / 0 && value < 1 / 0) {
// Dates are serialized according to the `Date#toJSON` method
// specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15
// for the ISO 8601 date time string format.
if (getDay) {