Showing 3,235 of 4,504 total issues
Function showDropDown
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
showDropDown:function(itemType, itemSource, appendTo, link, possiblePermissions, filename) {
Avoid deeply nested control flow statements. Open
switch ( col ) {
case 0: calender += " ui-datepicker-group-first";
cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break;
case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
Avoid deeply nested control flow statements. Open
while (path != last) {
if (path === data.path && !data.link) {
var actions = $fileList.find('.fileactions .action[data-action="Share"]');
var files = $fileList.find('.filename');
var i;
Function _handlePickerClick
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_handlePickerClick:function(event, $element) {
var getOcDialog = this.$filePicker.closest('.oc-dialog');
var buttonEnableDisable = getOcDialog.find('.primary');
if ($element.data('type') === 'file') {
if (this.$filePicker.data('multiselect') !== true || !event.ctrlKey) {
- 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
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
Avoid deeply nested control flow statements. Open
if (users[j].value.shareWith === share.share_with) {
users.splice(j, 1);
break;
}
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
ICertificateManager $userCertificateManager,
ICertificateManager $systemCertificateManager,
IL10N $l10n,
Function checkCoreMailMap
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function checkCoreMailMap($author) {
if (empty($this->mailMap)) {
$content = \file_get_contents(__DIR__ . '/../.mailmap');
$entries = \explode("\n", $content);
foreach ($entries as $entry) {
- 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 (query.length > 2) {
self.search(query);
} else {
self.hideResults();
}
Function isValidUrl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function isValidUrl(string $url) {
$parsedUrl = \parse_url($url);
if (!\filter_var($url, FILTER_VALIDATE_URL) || !$parsedUrl) {
return false;
- 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 setEmailAddress
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function setEmailAddress($id, $mailAddress) {
$resp = $this->validateEMail($mailAddress);
if ($resp) {
return $resp;
}
- 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 getAffectedUsers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getAffectedUsers(IShare $share) {
$users = [];
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
// notify all group members
$group = $this->groupManager->get($share->getSharedWith());
- 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(self.hasFilter(getCurrentApp())) {
self.getFilter(getCurrentApp())(query);
}
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
IGroupManager $groupManager,
IUserSession $userSession,
$isAdmin,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
Manager $externalManager,
IConfig $config,
ILogger $logger,
Method translate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
Function moveShareToShare
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function moveShareToShare($path) {
$userFolder = \OC::$server->getUserFolder();
// If the user folder can't be constructed (e.g. link share) just return.
if ($userFolder === null) {
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
IManager $shareManager,
IConfig $config,
UserSearch $userSearch,
IL10N $l10n,
SharingAllowlist $sharingAllowlist,
Function rename
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function rename($path1, $path2) {
$isPartFile = \pathinfo($path1, PATHINFO_EXTENSION) === 'part';
$targetExists = $this->file_exists($path2);
$sameFolder = \dirname($path1) === \dirname($path2);
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
ISettingsManager $settingsManager,
IURLGenerator $urlGenerator,
IGroupManager $groupManager,