Showing 429 of 903 total issues
Avoid deeply nested control flow statements. Open
Open
if ( hasScripts ) {
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( scripts, getAll( node, "script" ) );
Avoid deeply nested control flow statements. Open
Open
if ( matches[ sel ] ) {
matches.push( handleObj );
}
Method SetBrightness
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
public void SetBrightness(int brightness)
{
Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
if (brightness < -255) brightness = -255;
if (brightness > 255) brightness = 255;
- 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 ( rscriptType.test( node.type || "" ) &&
!dataPriv.access( node, "globalEval" ) &&
jQuery.contains( doc, node ) ) {
if ( node.src ) {
Method SetContrast
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
public void SetContrast(double contrast)
{
Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
if (contrast < -100) contrast = -100;
if (contrast > 100) contrast = 100;
- 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
for ( type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
Avoid deeply nested control flow statements. Open
Open
for (int y2 = ApetureMin; y2 < ApetureMax; ++y2)
{
int TempY = y + y2;
if (TempY >= 0 && TempY < NewBitmap.Height)
{
Avoid deeply nested control flow statements. Open
Open
while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
cur = cur.replace( " " + clazz + " ", " " );
}
Method InsertShape
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void InsertShape(string shapeType, int xPosition, int yPosition, int width, int height, string colorName)
Avoid deeply nested control flow statements. Open
Open
if ( conv && s.throws ) {
response = conv( response );
} else {
try {
response = conv( response );
Avoid deeply nested control flow statements. Open
Open
if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
return true;
}
Avoid deeply nested control flow statements. Open
Open
if ( !selector ) {
push.apply( results, seed );
return results;
}
Avoid deeply nested control flow statements. Open
Open
for (int y2 = ApetureMin; y2 < ApetureMax; ++y2)
{
int TempY = y + y2;
if (TempY >= 0 && TempY < NewBitmap.Height)
{
Avoid deeply nested control flow statements. Open
Open
if (TempX >= 0 && TempX < NewBitmap.Width)
{
for (int y2 = ApetureMinY[i]; y2 < ApetureMaxY[i]; ++y2)
{
int TempY = y + y2;
Avoid deeply nested control flow statements. Open
Open
if ( nid === expando ) {
context.removeAttribute( "id" );
}
Avoid deeply nested control flow statements. Open
Open
for (int y2 = ApetureMin; y2 < ApetureMax; ++y2)
{
int TempY = y + y2;
if (TempY >= 0 && TempY < NewBitmap.Height)
{
Avoid deeply nested control flow statements. Open
Open
for ( match in context ) {
// Properties of context are called as methods if possible
if ( jQuery.isFunction( this[ match ] ) ) {
this[ match ]( context[ match ] );
Avoid deeply nested control flow statements. Open
Open
for (int y2 = ApetureMin; y2 < ApetureMax; ++y2)
{
int TempY = y + y2;
if (TempY >= 0 && TempY < NewBitmap.Height)
{
Avoid deeply nested control flow statements. Open
Open
if (TempX >= 0 && TempX < NewBitmap.Width)
{
for (int y2 = ApetureMinY[i]; y2 < ApetureMaxY[i]; ++y2)
{
int TempY = y + y2;
Avoid deeply nested control flow statements. Open
Open
if ( ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) &&
++diff ) {