Showing 179 of 254 total issues
Function callback
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callback: function( rule, branch, compressor ) {
if ( rule.property == 'margin' || rule.property == 'padding' ) {
// Local copies
var before = rule.parts.slice( 0 ),
parts = rule.parts.slice( 0 );
Function fix
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fix: function( event ) {
if ( event[ jQuery.expando ] ) {
return event;
}
Consider simplifying this complex logical expression. Open
Open
if ( match[1] === "nth" ) {
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
Function callback
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callback: function( value, position, compressor ) {
var m = rhsl.exec( value ),
str = '#',
h, s, l,
p, q;
Function callback
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callback: function( value, position, compressor ) {
var m = rrgb.exec( value ),
str = '#', values;
if ( m ) {
Function rule
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
rule: function( options, type, callback ) {
var rules = CSSCompressor._rules;
// Passing no arguments returns the entire list
if ( options === undefined ) {
- 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
Function data
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
data: function( elem, name, data ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
Function each
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
each: function( object, callback, args ) {
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction(object);
Function textSelection
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.textSelection = function( start, end ) {
return this.each(function( i, element ) {
var textarea = jQuery( element ),
height = textarea.height(),
current, caret, ypos, range;
Function removeData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
removeData: function( elem, name ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
Function dirCheck
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
var elem = checkSet[i];
if ( elem ) {
Function callback
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callback: function( branches, compressor ) {
var imports = [], charsets = [], pos = -1;
// Find all import and charset declarations (after the first rule filled branch)
branches.forEach(function( branch, i ) {
Function callback
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callback: function( branch, compressor ) {
if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
return;
}
Function _blocks
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_blocks: function( branches ) {
var self = this,
rules = CSSCompressor.rule( CSSCompressor.RULE_TYPE_RULE ),
blocks = CSSCompressor.rule( CSSCompressor.RULE_TYPE_BLOCK );
Function setOffset
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
Function offset
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.offset = function( options ) {
var elem = this[0], box;
if ( options ) {
return this.each(function( i ) {
Function ATTR
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ATTR: function( elem, match ) {
var name = match[1],
result = Expr.attrHandle[ name ] ?
Expr.attrHandle[ name ]( elem ) :
elem[ name ] != null ?
Function callback
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callback: function( branch, compressor ) {
if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
return;
}
Function callback
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
callback: function( branch, compressor ) {
if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
return;
}
Function callback
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
callback: function( branch, compressor ) {
if ( ! branch.selector || ! branch.parts || ! branch.parts.length ) {
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"