Showing 2,136 of 3,976 total issues
Function _generateMonthYearHeader
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
secondary, monthNames, monthNamesShort) {
Consider simplifying this complex logical expression. Open
Open
if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
}
Consider simplifying this complex logical expression. Open
Open
if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
if (that._trigger("stop", event) !== false) {
that._clear();
}
Function _generateMonthYearHeader
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
secondary, monthNames, monthNamesShort) {
Consider simplifying this complex logical expression. Open
Open
if ($.datepicker._datepickerShowing) {
switch (event.keyCode) {
case 9: $.datepicker._hideDatepicker();
handled = false;
break; // hide on tab out
Consider simplifying this complex logical expression. Open
Open
} else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') {
out.x = e.clientX;
out.y = e.clientY;
}
Consider simplifying this complex logical expression. Open
Open
if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
if (that._trigger("stop", event) !== false) {
that._clear();
}
Consider simplifying this complex logical expression. Open
Open
if ( this.options.tolerance === "pointer" ||
this.options.forcePointerForContainers ||
(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
) {
return isOverElement;
Consider simplifying this complex logical expression. Open
Open
if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
}
Function toHaveBeenCalled
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
getJasmineRequireObj().toHaveBeenCalled = function(j$) {
var getErrorMsg = j$.formatErrorMsg('<toHaveBeenCalled>', 'expect(<spyObj>).toHaveBeenCalled()');
function toHaveBeenCalled() {
- 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
Method update
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
def update
@event = Event.find(params[:id])
if not @is_admin and @event.user != @current_user
flash[:notice] = "You may not edit another person's event."
redirect_to events_path
- 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 access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Function access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Function performAction
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
Function createDate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createDate (y, m, d, h, M, s, ms) {
Function access
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
Function createDate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function createDate (y, m, d, h, M, s, ms) {
Avoid deeply nested control flow statements. Open
Open
if ( (elem = matcherOut[i]) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( (matcherIn[i] = elem) );
}
Avoid deeply nested control flow statements. Open
Open
if ( !selector ) {
push.apply( results, seed );
return results;
}
Avoid deeply nested control flow statements. Open
Open
if ( nid === expando ) {
context.removeAttribute( "id" );
}