Showing 282 of 417 total issues
Avoid deeply nested control flow statements. Open
Open
if (typeof(this.glyphs[child.unicode]) == 'undefined') this.glyphs[child.unicode] = [];
Function CreateFont
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) {
Avoid deeply nested control flow statements. Open
Open
else if (!set.fontSize) { if (d[i] != 'inherit') f.fontSize = d[i].split('/')[0]; set.fontStyle = set.fontVariant = set.fontWeight = set.fontSize = true; }
else { if (d[i] != 'inherit') ff += d[i]; }
Avoid deeply nested control flow statements. Open
Open
if (cssClass == '@font-face') {
var fontFamily = props['font-family'].value.replace(/"/g,'');
var srcs = props['src'].value.split(',');
for (var s=0; s<srcs.length; s++) {
if (srcs[s].indexOf('format("svg")') > 0) {
Avoid deeply nested control flow statements. Open
Open
for (var name in styles) {
this.styles[name] = styles[name];
}
Function addQuadraticCurve
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) {
Function imGet
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function imGet(img, x, y, width, height, rgba) {
Avoid deeply nested control flow statements. Open
Open
else if (!set.fontWeight && that.Weights.indexOf(d[i]) != -1) { if (d[i] != 'inherit') f.fontWeight = d[i]; set.fontStyle = set.fontVariant = set.fontWeight = true; }
Avoid deeply nested control flow statements. Open
Open
for (var k=0; k<cssProps.length; k++) {
var prop = cssProps[k].indexOf(':');
var name = cssProps[k].substr(0, prop);
var value = cssProps[k].substr(prop + 1, cssProps[k].length - prop);
if (name != null && value != null) {
Avoid deeply nested control flow statements. Open
Open
session[:prop_id] = uncertain_search_space.any? ? uncertain_search_space.first.id : session[:prop_id]
Method set
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.set(major, minor, patch, build)
current = YAML.load_file(TARGET)
current['major'] = major unless major.nil?
current['minor'] = minor unless minor.nil?
current['patch'] = patch unless patch.nil?
- 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
Consider simplifying this complex logical expression. Open
Open
} else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
value = value.replace(rxhtmlTag, "<$1></$2>");
Consider simplifying this complex logical expression. Open
Open
if ( s.crossDomain == null ) {
parts = rurl.exec( s.url.toLowerCase() );
s.crossDomain = !!( parts &&
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
Consider simplifying this complex logical expression. Open
Open
if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
// Pregenerate a single jQuery object for reuse with .is()
jqcur = jQuery(this);
jqcur.context = this.ownerDocument || this;
Consider simplifying this complex logical expression. Open
Open
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
ret = Sizzle.find( parts.shift(), context, contextXML );
context = ret.expr ?
Consider simplifying this complex logical expression. Open
Open
if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
// Don't re-trigger an onFOO event when we call its FOO() method
old = elem[ ontype ];
Consider simplifying this complex logical expression. Open
Open
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
Consider simplifying this complex logical expression. Open
Open
if (element === polyline[0]) {
strokeColor = element.strokeColor || this.polylines_conf.strokeColor;
strokeOpacity = element.strokeOpacity || this.polylines_conf.strokeOpacity;
strokeWeight = element.strokeWeight || this.polylines_conf.strokeWeight;
clickable = element.clickable || this.polylines_conf.clickable;
Function remove
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
remove: function( elem, types, handler, selector, mappedTypes ) {
Function add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data, selector ) {