Showing 3,235 of 4,504 total issues
Function registerDefaultActions
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerDefaultActions: function (excludeActions) {
excludeActions = excludeActions || [];
var self = this;
var defaultActions = [
Function _initXHRData
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initXHRData: function (options) {
var that = this,
formData,
file = options.files[0],
// Ignore non-multipart setting if not supported:
Method sendInternalShareMail
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendInternalShareMail($sender, $node, $shareType, $recipientList): array {
if ($this->config->getAppValue('core', 'shareapi_allow_mail_notification', 'no') !== 'yes') {
$message_t = $this->l->t('Internal mail notification for shared files is not allowed');
throw new GenericShareException($message_t, $message_t, 403);
}
Method getItemSharedWithUser
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getItemSharedWithUser($itemType, $itemSource, $user, $owner = null, $shareType = null) {
$shares = [];
$fileDependent = false;
$where = 'WHERE';
Method mergeResponses
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function mergeResponses($responses) {
// Sort into shipped and third-party
$shipped = [
'succeeded' => [],
'failed' => [],
Function getPermissionsFromRequest
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function getPermissionsFromRequest() {
// int-based permissions are set -> use them
$permissions = $this->request->getParam('permissions', null);
if ($permissions !== null) {
return $permissions;
- 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 move2trash
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function move2trash($file_path) {
// get the user for which the filesystem is setup
$root = Filesystem::getRoot();
list(, $user) = \explode('/', $root);
list($owner, $ownerPath) = self::getUidAndFilename($file_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 xmlDeserialize
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function xmlDeserialize(Reader $reader) {
$elems = (array)$reader->parseInnerTree([
'{DAV:}prop' => KeyValue::class,
'{http://owncloud.org/ns}filter-rules' => Base::class,
'{http://owncloud.org/ns}search' => KeyValue::class,
- 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 buildPolicy
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function buildPolicy() {
$policy = "default-src 'none';manifest-src 'self';";
if (!empty($this->allowedScriptDomains) || $this->inlineScriptAllowed || $this->evalScriptAllowed) {
$policy .= 'script-src ';
- 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 buildParts
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function buildParts(array $data) {
$fields = [
'path', 'parent', 'name', 'mimetype', 'size', 'mtime', 'storage_mtime', 'encrypted',
'etag', 'permissions', 'checksum'];
- 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 doAppUpgrade
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function doAppUpgrade() {
$apps = \OC_App::getEnabledApps();
$priorityTypes = ['authentication', 'filesystem', 'logging'];
$pseudoOtherType = 'other';
$stacks = [$pseudoOtherType => []];
- 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 handleChildren
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function handleChildren($path, $recursive, $reuse, $folderId, $lock, &$size) {
// we put this in it's own function so it cleans up the memory before we start recursing
$existingChildren = $this->getExistingChildren($folderId);
$newChildren = $this->getNewChildren($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 createSelectStatement
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private static function createSelectStatement($format, $fileDependent, $uidOwner = null) {
$select = '*';
if ($format == self::FORMAT_STATUSES) {
if ($fileDependent) {
$select = '`*PREFIX*share`.`id`, `*PREFIX*share`.`parent`, `share_type`, `path`, `storage`, '
- 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 afterException
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function afterException($controller, $methodName, \Exception $exception) {
$headers = [];
if ($controller instanceof OCSController) {
if ($this->request->getHeader('OC-RequestAppPassword') === 'true'
&& ($exception instanceof NotLoggedInException || $exception instanceof LoginException)) {
- 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 execute
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
if ($this->userManager->userExists($uid)) {
$output->writeln('<error>The user "' . $uid . '" already exists.</error>');
return 1;
- 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
File ia.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"core",
{
"Please select a file." : "Per favor, selige un file.",
"File is too big" : "Le file es troppo grande",
File AppRegistryController.php
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Thomas Müller <thomas.mueller@tmit.eu>
*
* @copyright Copyright (c) 2023, ownCloud GmbH
Method init
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function init() {
if ($this->init) {
return;
}
$this->init = true;
Method registerCoreProviders
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function registerCoreProviders() {
if ($this->registeredCoreProviders) {
return;
}
$this->registeredCoreProviders = true;
Method handleRemovedUsers
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleRemovedUsers(array $removedUsers, InputInterface $input, OutputInterface $output, $missingAccountsAction): void {
if (empty($removedUsers)) {
$output->writeln('No removed users have been detected.');
} else {
// define some actions to be used