Showing 52 of 98 total issues
Avoid deeply nested control flow statements. Open
Open
for (var r = 0; r < q.length - 1; r++) {
var s = q[r];
typeof o[s] != "object" && (o[s] = {}), o = o[s]
}
Consider simplifying this complex logical expression. Open
Open
if (g)try {
g.focus()
} catch (d) {
} else {
if (!b.isSupported()) {
Consider simplifying this complex logical expression. Open
Open
if (a.onlogin && typeof a.onlogin != "function" || a.onlogout && typeof a.onlogout != "function" || a.onready && typeof a.onready != "function")throw new Error("non-function where function expected in parameters to navigator.id.watch()");
Consider simplifying this complex logical expression. Open
Open
if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
relType = options.groupAttr || 'data-fancybox-group';
relVal = what.attr(relType);
if (!relVal) {
Consider simplifying this complex logical expression. Open
Open
if (c === "*")for (var h in b) {
if (!b.hasOwnProperty(h))continue;
if (h === "*")continue;
if (typeof b[h][d] == "object") {
g = f(b[h][d]);
Avoid too many return
statements within this function. Open
Open
return this;
Avoid too many return
statements within this function. Open
Open
return;
Avoid too many return
statements within this function. Open
Open
return this;
Avoid too many return
statements within this function. Open
Open
return $(el).val();
Avoid too many return
statements within this function. Open
Open
return F._error( 'content' );
Avoid too many return
statements within this function. Open
Open
return F._error( 'href' );
Method process_sc_embed_code
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def process_sc_embed_code object, owner
return unless object
return unless owner == current_person
object.track = $1 if params[:sc_embed_code] =~ /tracks%2F(\d+)/
object.secret = $1 if params[:sc_embed_code] =~ /secret_token%3D(s-[0-9a-zA-Z]+)/
- 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"