Showing 5,566 of 7,504 total issues
Avoid deeply nested control flow statements. Open
if (value[1]) return parseFloat(value[1]) / 100;
Avoid deeply nested control flow statements. Open
if (targetNode.parentNode == node) return [targetNode];
Function setHash
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
setHash : function(name, values_obj, expires, path, domain, secure) {
Avoid deeply nested control flow statements. Open
if (node.nodeIndex == indices[j]) results.push(node);
Function convertRGBToHex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function convertRGBToHex(col) {
var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
if (!col)
return col;
- 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
if (TB_FoundURL) {
TB_NextCaption = TB_TempArray[TB_Counter].title;
TB_NextURL = TB_TempArray[TB_Counter].href;
TB_NextHTML = "<span id='TB_next'> <a href='#'>"+thickboxL10n.next+"</a></span>";
} else {
Function getType
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getType(v) {
var fo, i, c, el, x, f = document.forms[0];
fo = ed.getParam("media_types", "flash=swf;flv=flv;shockwave=dcr;qt=mov,qt,mpg,mp3,mp4,mpeg;shockwave=dcr;wmp=avi,wmv,wm,asf,asx,wmx,wvx;rmp=rm,ra,ram").split(';');
- 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
if ( dom.isEmpty( parent ) ) {
dom.remove( parent );
}
Avoid deeply nested control flow statements. Open
if ( lnk && lnk.childNodes.length == 1 )
ed.dom.remove(lnk);
else ed.dom.remove(el);
Avoid deeply nested control flow statements. Open
if ( ! editor.getParam( 'wpeditimage_html5_captions' ) ) {
captionWidth += 10;
}
Avoid deeply nested control flow statements. Open
if ( container.nextSibling ) {
return;
}
Avoid deeply nested control flow statements. Open
if (value) {
attrs.map[name] = value;
attr.value = value;
} else {
delete attrs.map[name];
Avoid deeply nested control flow statements. Open
if ( b > B ) {
if ( b - B < top - S )
window.scrollBy(0, (b - B) + 10);
else
window.scrollBy(0, top - S - 40);
Function createInstance
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
windowManager.createInstance = function(className, a, b, c, d, e) {
Avoid deeply nested control flow statements. Open
if (editor.settings.video_template_callback) {
html = editor.settings.video_template_callback(data);
} else {
html = (
'<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' +
Avoid deeply nested control flow statements. Open
if(element.tagName == 'IMG' && element.width) {
element.width++; element.width--;
} else try {
var n = document.createTextNode(' ');
element.appendChild(n);
Avoid deeply nested control flow statements. Open
if (targetNode.parentNode == node) return [targetNode];
Avoid deeply nested control flow statements. Open
if(_29>0){
_28=_29;
}
Avoid deeply nested control flow statements. Open
} else if (combinator == 'adjacent') {
for (var i = 0, node; node = nodes[i]; i++)
if (Selector.handlers.previousElementSibling(targetNode) == node)
return [targetNode];
} else nodes = h[combinator](nodes);
Function getStyle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getStyle: function(element, style) {
element = $(element);
style = style == 'float' ? 'cssFloat' : style.camelize();
var value = element.style[style];
if (!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"