Showing 229 of 406 total issues
Avoid deeply nested control flow statements. Open
Open
if (symbol >= "0" && symbol <= "9") {
// Leading zeroes are interpreted as octal literals.
if (symbol == "0" && (symbol = source.charAt(Index + 1), symbol >= "0" && symbol <= "9")) {
// Illegal octal literal.
abort();
Avoid deeply nested control flow statements. Open
Open
for (index = 0, length = filter.length; index < length; value = filter[index++], ((getClass.call(value) == "[object String]" || getClass.call(value) == "[object Number]") && (properties[value] = 1)));
Avoid deeply nested control flow statements. Open
Open
if (typeof resolved == "string") {
code += walk(core.template.Parser.parse(resolved, true), labels);
} else {
code += 'buf+=this._label("' + escaped + '",data,partials,labels);';
}
Function detect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
detect : function()
{
return new core.event.Promise(function(resolve, reject) {
if (navigator.geolocation)
{
- 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
Avoid deeply nested control flow statements. Open
Open
} else if (getClass.call(width) == "[object String]") {
whitespace = width.length <= 10 ? width : width.slice(0, 10);
}
Avoid deeply nested control flow statements. Open
Open
else if (core.Interface.isInterface(type))
{
core.Interface.assert(value, type);
}
else
Avoid deeply nested control flow statements. Open
Open
} else if (scrollTop > maxScrollTop) {
scrollTop = maxScrollTop;
} else {
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
} else if (value == "{") {
// Parses a JSON object, returning a new JavaScript object.
results = {};
for (;; any || (any = true)) {
value = lex();
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
for (;; any || (any = 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 (raise) {
throw new Error("Property " + name + " in " + this + " is not valid!");
} else {
return false;
}
Avoid deeply nested control flow statements. Open
Open
if (key in members && members[key] instanceof Function && includedClass.prototype[key] instanceof Function && allIncludeMembers[key] instanceof Function) {
// pass
} else {
throw new Error("Included class " + includedClass.className + " overwrites member " + key + " of other included class " + allIncludeMembers[key].className + " in class " + name);
}
Avoid deeply nested control flow statements. Open
Open
for (value = "@", Index++; Index < length;) {
symbol = source.charAt(Index);
if (symbol < " ") {
// Unescaped ASCII control characters are not permitted.
abort();
Avoid deeply nested control flow statements. Open
Open
if (href.charAt(0) === '#') {
this.open(href.slice(1));
} else {
return;
}
Function cmn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var cmn = function(q, a, b, x, s, t) {
Function __showTree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
__showTree: function(data) {
if (!data.file) {
return;
}
- 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
Avoid deeply nested control flow statements. Open
Open
if (!(cMember instanceof Function)) {
throw new Error(commonErrMsg + "Different member types in: " + name + "! Expecting a function!");
} else if (!removedUnusedArgs && iMember.length != cMember.length) {
throw new Error(commonErrMsg + "Different number of arguments in function '" + name + "'. Expecting " + iMember.length + "!");
}
Avoid deeply nested control flow statements. Open
Open
if (next) {
parent.insertBefore(child, next);
} else {
parent.appendChild(child);
}
Avoid deeply nested control flow statements. Open
Open
else if (agent.indexOf("webOS") != -1)
{
name = "webos";
match = /webOS\/([\.0-9]+)/.exec(agent);
if (match) {