Showing 1,065 of 16,781 total issues
Avoid deeply nested control flow statements. Open
Open
if (bytes > Math.pow(1024, 2)) {
show += round(bytes / Math.pow(1024, 2), 2);
show += " " + genlang(88);
} else {
if (bytes > Math.pow(1024, 1)) {
Function init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
init: function( elem, options, prop, end, easing, unit ) {
Function getLanguage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
function getLanguage(plugin, langarrId) {
var getLangUrl = "";
if (current_language) {
getLangUrl = 'language/language.php?lang=' + current_language;
if (plugin) {
- 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 ( nodeType === 9 ) {
if ( (elem = context.getElementById( m )) ) {
// Support: IE, Opera, Webkit
// TODO: identify versions
Avoid deeply nested control flow statements. Open
Open
if ( nid === expando ) {
context.removeAttribute( "id" );
}
Avoid deeply nested control flow statements. Open
Open
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
cur += clazz + " ";
}
Avoid deeply nested control flow statements. Open
Open
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
Avoid deeply nested control flow statements. Open
Open
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
Avoid deeply nested control flow statements. Open
Open
if ( sNodeName == "TD" || sNodeName == "TH" )
{
_fnSetCellData( oSettings, iThisIndex, jInner, $.trim(nTds[j].innerHTML) );
jInner++;
}
Avoid deeply nested control flow statements. Open
Open
while ( i-- ) {
groups[i] = nidselect + " " + toSelector( groups[i] );
}
Avoid deeply nested control flow statements. Open
Open
if ( (elem = matcherOut[i]) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( (matcherIn[i] = elem) );
}
Avoid deeply nested control flow statements. Open
Open
if ( Expr.relative[ tokens[j].type ] ) {
break;
}
Avoid deeply nested control flow statements. Open
Open
if ( !selector ) {
push.apply( results, seed );
return results;
}
Avoid deeply nested control flow statements. Open
Open
if ( ( event.result = ret ) === false ) {
event.preventDefault();
event.stopPropagation();
}
Avoid deeply nested control flow statements. Open
Open
if ( !attributes && typeof elem.removeAttribute !== "undefined" ) {
elem.removeAttribute( internalKey );
// Webkit & Blink performance suffers when deleting properties
// from DOM nodes, so set to undefined instead
Avoid deeply nested control flow statements. Open
Open
if ( sValType !== '' )
{
sThisType = _fnDetectType( sValType );
if ( oSettings.aoColumns[iColumn].sType === null )
{
Avoid deeply nested control flow statements. Open
Open
for ( k=0 ; k<iRowspan ; k++ )
{
aLayout[i+k][iColShifted+l] = {
"cell": nCell,
"unique": iColspan == 1 ? true : false
Avoid deeply nested control flow statements. Open
Open
while( oSettings.aoColumns.length <= aTargets[j] )
{
_fnAddColumn( oSettings );
}
Avoid deeply nested control flow statements. Open
Open
if ( elem.id !== match[ 2 ] ) {
return rootjQuery.find( selector );
}
Avoid deeply nested control flow statements. Open
Open
if ( oSettings.aoColumns[iColumn].bUseRendered )
{
/* Use the rendered data for filtering/sorting */
_fnSetCellData( oSettings, iRow, iColumn, sRendered );
}