Showing 256 of 374 total issues
Avoid deeply nested control flow statements. Open
Open
if (copyIsArray) {
copyIsArray = false;
clone = src && Array.isArray(src) ? src : [];
} else {
clone = src && isPlainObject(src) ? src : {};
Avoid deeply nested control flow statements. Open
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
Open
} else if (copy !== undefined) {
target[name] = copy;
}
Avoid deeply nested control flow statements. Open
Open
if (!(mixin in calledMixins)) {
calledMixins[mixin] = 1;
mixin.call(objectInstance, p, p.constructor);
}
Avoid deeply nested control flow statements. Open
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
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
Open
if (charCode < 32) {
result += unicodePrefix + toPaddedString(2, charCode.toString(16));
break;
}
Avoid deeply nested control flow statements. Open
Open
if (element !== undef) {
// According to ES 5.1 section 15.12.3: "If `gap` {whitespace}
// is not the empty string, let `member` {quote(property) + ":"}
// be the concatenation of `member` and the `space` character."
// The "`space` character" refers to the literal space
Avoid deeply nested control flow statements. Open
Open
for (length = value.length; length--;) {
update(value, length, callback);
}
Avoid deeply nested control flow statements. Open
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) {
Avoid deeply nested control flow statements. Open
Open
if (isSigned) {
abort();
}
Avoid deeply nested control flow statements. Open
Open
} else if (className == stringClass) {
whitespace = width.length <= 10 ? width : width.slice(0, 10);
}
Avoid deeply nested control flow statements. Open
Open
for (value = "@", Index++; Index < length;) {
charCode = source.charCodeAt(Index);
if (charCode < 32) {
// Unescaped ASCII control characters (those with a code unit
// less than the space character) are not permitted.
Avoid deeply nested control flow statements. Open
Open
for (;; hasMembers || (hasMembers = true)) {
value = lex();
// A closing square bracket marks the end of the array literal.
if (value == "]") {
break;
Avoid deeply nested control flow statements. Open
Open
if (stack[length] === value) {
// Cyclic structures cannot be serialized by `JSON.stringify`.
throw TypeError();
}
Avoid deeply nested control flow statements. Open
Open
if ((width -= width % 1) > 0) {
for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
}
Avoid deeply nested control flow statements. Open
Open
if (charCode == 45) {
isSigned = true;
charCode = source.charCodeAt(++Index);
}
Avoid deeply nested control flow statements. Open
Open
for (index = 0, length = value.length; index < length; index++) {
element = serialize(index, value, callback, properties, whitespace, indentation, stack);
results.push(element === undef ? "null" : element);
}
Consider simplifying this complex logical expression. Open
Open
if (typeof trueishCondition === "function" ? !trueishCondition.apply(this, arguments) : !trueishCondition) {
var parameters = Array.prototype.slice.call(arguments, 1);
var msg = typeof message == "string" ? String.format.apply(message, parameters) : message;
return typeof console != "undefined" && !console.__throwErrorOnAssert && console.assert && console.assert.bind && console.assert.bind(console, trueishCondition, msg) || function consoleAssertThrow() { throw msg; };
}
Consider simplifying this complex logical expression. Open
Open
if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {
// Invalid Unicode escape sequence.
abort();
}