Showing 175 of 609 total issues
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
&& y2 - (this.helperProportions.height / 2) < b )) return false; // Top Half
Avoid too many return
statements within this function. Open
Open
if(y2 > t && y1 < t) return 1; //Crosses top edge
Avoid too many return
statements within this function. Open
Open
return false;
Avoid too many return
statements within this function. Open
Open
return colors['transparent']
Avoid too many return
statements within this method. Open
Open
return Project.new
Avoid too many return
statements within this function. Open
Open
if(x1 < r && x2 > r) return 1; //Crosses right edge
Avoid too many return
statements within this function. Open
Open
if(x2 > l && x1 < l) return 2; //Crosses left edge
Avoid too many return
statements within this method. Open
Open
return nil
Avoid too many return
statements within this function. Open
Open
return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
Avoid too many return
statements within this function. Open
Open
return colors[jQuery.trim(color).toLowerCase()];
Avoid too many return
statements within this function. Open
Open
else if (direction == 2 && (y1 + dyClick) > t + height/2) { return 1; } // down
Avoid too many return
statements within this function. Open
Open
if(y1 < b && y2 > b) return 2; //Crosses bottom edge
Method save_time_entry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def save_time_entry
@time_entry = TimeEntry.new
@time_entry.user = User.current
if params[:time_entry] && params[:time_entry].first
@time_entry.attributes = params[:time_entry].first
- 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"