Showing 4,504 of 4,504 total issues
Function xmlDeserialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function xmlDeserialize(Reader $reader) {
$newProps = [
'properties' => [],
'searchInfo' => 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
Function getUsers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getUsers() {
$search = !empty($_GET['search']) ? $_GET['search'] : '';
$limit = !empty($_GET['limit']) ? $_GET['limit'] : null;
$offset = !empty($_GET['offset']) ? $_GET['offset'] : 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
Function updateCalendar
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function updateCalendar($cardUri, $cardData, $book, $calendarId, $type) {
$objectUri = $book['uri'] . '-' . $cardUri . $type['postfix'] . '.ics';
$calendarData = $this->buildDateFromContact($cardData, $type['field'], $type['symbol']);
$existing = $this->calDavBackEnd->getCalendarObject($calendarId, $objectUri);
if ($calendarData === 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
Function __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(IRequest $request, $baseUri) {
$this->request = $request;
$this->baseUri = $baseUri;
$logger = OC::$server->getLogger();
$dispatcher = OC::$server->getEventDispatcher();
- 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 getSearchResultIterator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getSearchResultIterator($filesUri, $searchResults, $requestedProps, $maxResults) {
$paths = [];
foreach ($searchResults as $searchResult) {
$paths[$filesUri . $searchResult->path] = $searchResult;
}
- 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 handleGetProperties
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handleGetProperties(
PropFind $propFind,
\Sabre\DAV\INode $node
) {
if (!($node instanceof \OCA\DAV\Connector\Sabre\Node)) {
- 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 createDirectory
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function createDirectory($name) {
# the check here is necessary, because createDirectory does not use the methods in files/view.php
if (Filesystem::isForbiddenFileOrDir($name)) {
throw new SabreForbidden();
}
- 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 handleBeforeMove
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handleBeforeMove($source, $destination) {
$sourceNode = $this->server->tree->getNodeForPath($source);
// get target node for proper path conversion
$destinationSize = 0;
- 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 isFolderEmpty
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function isFolderEmpty($view, $dir) {
if ($dir === '' || $dir === '.' || $dir === '/') {
// root folder won't be considered as empty
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 findRegisteredPanels
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function findRegisteredPanels($type) {
$panels = [];
foreach ($this->appManager->getEnabledAppsForUser($this->userSession->getUser()) as $app) {
if (isset($this->appManager->getAppInfo($app)['settings'])) {
foreach ($this->appManager->getAppInfo($app)['settings'] as $t => $detected) {
- 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 searchCommon
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function searchCommon($method, $args) {
$files = [];
$rootLength = \strlen($this->path);
$mount = $this->root->getMount($this->path);
$storage = $mount->getStorage();
- 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 stream_write
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function stream_write($data) {
$length = 0;
// loop over $data to fit it in 6126 sized unencrypted blocks
while (isset($data[0])) {
$remainingLength = \strlen($data);
- 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 calculateFolderSize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function calculateFolderSize($path, $entry = null) {
if ($path !== '/' and $path !== '' and $path !== 'files' and $path !== 'files_trashbin' and $path !== 'files_versions') {
return parent::calculateFolderSize($path, $entry);
} elseif ($path === '' or $path === '/') {
// since the size of / isn't used (the size of /files is used instead) there is no use in calculating it
- 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 fopen
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function fopen($path, $mode) {
$path = $this->normalizePath($path);
switch ($mode) {
case 'r':
- 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 moveFromCache
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
self::$path_cache->clear();
if ($sourceCache instanceof Cache) {
// normalize source and target
$sourcePath = $this->normalize($sourcePath);
- 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 getMultiBucketObjectStoreConfig
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getMultiBucketObjectStoreConfig(IUser $user) {
$config = $this->config->getSystemValue('objectstore_multibucket');
if (!\is_array($config)) {
return 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
Function buildRequestOptions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function buildRequestOptions(array $options): array {
if (!$this->defaultOptions) {
$this->setDefaultOptions();
}
- 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 getThumbnail
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getThumbnail(File $file, $maxX, $maxY, $scalingUp) {
$stream = $file->fopen('r');
$content = \stream_get_contents($stream, 2048);
\fclose($stream);
- 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 getOldFiles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getOldFiles(): array {
$cutOfTime = \time() - 3600;
$files = [];
$dh = \opendir($this->tmpBaseDir);
if ($dh) {
- 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 splitUserRemote
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function splitUserRemote($id) {
if (\strpos($id, '@') === false) {
$l = \OC::$server->getL10N('lib');
$hint = $l->t('Invalid Federated Cloud ID');
throw new HintException('Invalid Federated Cloud ID', $hint);
- 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"