Showing 840 of 1,637 total issues
Consider simplifying this complex logical expression. Open
Open
if ((tt1[0] != tt2[0]) ||
(tt1[0].toLowerCase() == "r" && (tt1[2] != tt2[2] || tt1[3] != tt2[3])) ||
(tt1[0].toLowerCase() == "s" && (tt1[3] != tt2[3] || tt1[4] != tt2[4]))
) {
return;
Consider simplifying this complex logical expression. Open
Open
if ((navigator.vendor == "Apple Computer, Inc.") && (version && version[1] < 4 || navigator.platform.slice(0, 2) == "iP") ||
(navigator.vendor == "Google Inc." && version && version[1] < 8)) {
paperproto.safari = function () {
var rect = this.rect(-99, -99, this.width + 99, this.height + 99).attr({stroke: "none"});
Function bezierBBox
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
R.bezierBBox = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {
Function intersect
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function intersect(x1, y1, x2, y2, x3, y3, x4, y4) {
Consider simplifying this complex logical expression. Open
Open
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
support.getById && context.nodeType === 9 && documentIsHTML &&
Expr.relative[ tokens[1].type ] ) {
context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
Consider simplifying this complex logical expression. Open
Open
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
// Support: Opera <= 12.12
// Opera reports offsetWidths and offsetHeights less than zero on some elements
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
Function get_initial
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_initial(self):
if self.initial:
initial = self.initial
else:
initial = {}
- 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 drawPieSlice
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
drawPieSlice: function (x, y, radius, startAngle, endAngle, lineColor, fillColor) {
Function _drawRect
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
Function _drawRect
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
Function _drawCircle
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
Function _drawCircle
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
Function print
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
paperproto.print = function (x, y, string, font, size, origin, letter_spacing) {
Function access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
Function drawCircle
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
drawCircle: function (x, y, radius, lineColor, fillColor, lineWidth) {
Avoid deeply nested control flow statements. Open
Open
if (searchText.length) {
startpos = option.search_text.search(zregex);
text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
}
Avoid deeply nested control flow statements. Open
Open
if (stackMin < 0 && stackMax > 0) {
if (val < 0) {
stackRangesNeg[i] += Math.abs(val);
} else {
stackRanges[i] += val;
Function drawLine
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
drawLine: function (x1, y1, x2, y2, lineColor, lineWidth) {
Avoid deeply nested control flow statements. Open
Open
} else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
option.search_match = true;
}
Function drawRect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
drawRect: function (x, y, width, height, lineColor, fillColor) {