Showing 3,235 of 4,504 total issues
Avoid deeply nested control flow statements. Open
if ($.isFunction(this.callback)) {
$.when.apply($, this.deferredsList)
.always($.proxy(function(){
this.callback();
}, this)
Function preSortSearchString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
preSortSearchString: function(a, b) {
var pattern = this.filter;
if(typeof pattern === 'undefined') {
return 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 register
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
register: function(mime, name, permissions, icon, action, displayName) {
Avoid deeply nested control flow statements. Open
if (options.uniqueFilenames) {
fileName = that._getUniqueFilename(
fileName,
options.uniqueFilenames
);
Function register
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
window.FileActions.register = function (mime, name, permissions, icon, action, displayName) {
Function loadPreview
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
loadPreview: function(path, mime, etag, $iconDiv, $container, isImage) {
Function position
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
$.fn.position = function( options ) {
if ( !options || !options.of ) {
return _position.apply( this, arguments );
}
- 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
Avoid deeply nested control flow statements. Open
if (upload) {
var response = upload.getResponse();
message = t('files', 'Failed to upload the file "{fileName}": {error}', {fileName: upload.getFileName(), error: response.message});
}
Avoid deeply nested control flow statements. Open
if (!paramNameSlice.length) {
paramNameSlice = paramName;
}
Avoid deeply nested control flow statements. Open
for (j = 0; j < groupsLength; j++) {
if (groups[j].value.shareWith === share.share_with) {
groups.splice(j, 1);
break;
}
Avoid deeply nested control flow statements. Open
if (res.found[i].shareWith === OC.currentUser) {
res.found.splice(i, 1);
continue;
}
Avoid deeply nested control flow statements. Open
if (w >= -1 && w <= 1) {
//hermite filter
weight = 2 * w * w * w - 3 * w * w + 1;
if (weight > 0) {
dx = 4 * (xx + yy * W);
Avoid deeply nested control flow statements. Open
if (!$('#app-sidebar').hasClass('hidden') && !$('#app-sidebar').hasClass('disappear')) {
controlsWidth -= $('#app-sidebar').width();
}
Function loadItem
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
loadItem:function(itemType, itemSource, callback) {
var data = '';
var checkReshare = true;
var async = !_.isUndefined(callback);
if (typeof OC.Share.statuses[itemSource] === '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
Avoid deeply nested control flow statements. Open
if (!$('#app-sidebar').hasClass('hidden') && !$('#app-sidebar').hasClass('disappear')) {
controlsWidth -= $('#app-sidebar').width();
}
Avoid deeply nested control flow statements. Open
if ( copyIsArray ) {
copyIsArray = false;
clone = src && jQuery.isArray(src) ? src : [];
} else {
Avoid deeply nested control flow statements. Open
} else if (share.share_type === OC.Share.SHARE_TYPE_REMOTE) {
remotesLength = remotes.length;
for (j = 0; j < remotesLength; j++) {
if (remotes[j].value.shareWith === share.share_with) {
remotes.splice(j, 1);
Function avatar
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) {
Function _moveOrCopy
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_moveOrCopy: function(operation, path, destinationPath, allowOverwrite, headers, options) {
Function translatePlural
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
translatePlural: function(app, textSingular, textPlural, count, vars, options) {