Showing 4,504 of 4,504 total issues
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,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\OCP\L10N\IFactory $factory,
INotificationManager $notificationManager,
IShareManager $shareManager,
IGroupManager $groupManager,
IUserManager $userManager,
Function dirRecursiveCheck
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function dirRecursiveCheck(Folder $dirInfo) {
if (!$this->checkFileInfo($dirInfo)) {
return false;
}
// If any of elements cannot be downloaded, prevent whole download
- 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
\OCP\IDBConnection $connection,
\OC\Files\Mount\Manager $mountManager,
\OCP\Files\Storage\IStorageFactory $storageLoader,
IManager $notificationManager,
EventDispatcherInterface $eventDispatcher,
Function getChildren
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getChildren($itemSource) {
$children = [];
$parents = [$itemSource];
$query = \OCP\DB::prepare('SELECT `id` FROM `*PREFIX*mimetypes` WHERE `mimetype` = ?');
$result = $query->execute(['httpd/unix-directory']);
- 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
IClient $httpClient = null,
IURLGenerator $urlGenerator = null,
IJobList $jobList = null,
TrustedServers $trustedServers = null,
ILogger $logger = null,
Method retainVersions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private static function retainVersions($filename, $owner, $ownerPath, $timestamp, $sourceStorage = null, $forceCopy = false) {
Function linkShareAuth
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function linkShareAuth(\OCP\Share\IShare $share, $password = null) {
$beforeEvent = new GenericEvent(null, ['shareObject' => $share]);
$this->eventDispatcher->dispatch($beforeEvent, 'share.beforelinkauth');
if ($password !== null) {
if ($this->shareManager->checkPassword($share, $password)) {
- 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 translate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function run($argument) {
$target = $argument['url'];
$source = $this->urlGenerator->getAbsoluteURL('/');
$source = \rtrim($source, '/');
$token = $argument['token'];
- 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,
\OCA\Files_Sharing\External\Manager $externalManager,
IClientService $clientService,
EventDispatcherInterface $eventDispatcher,
Method translate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {