Showing 4,504 of 4,504 total issues
Function getCacheEntry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getCacheEntry($storage, $internalPath, $relativePath) {
$cache = $storage->getCache($internalPath);
$data = $cache->get($internalPath);
$watcher = $storage->getWatcher($internalPath);
- 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 getSourcePath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getSourcePath($path) {
$fullPath = $this->datadir . $path;
if ($this->allowSymlinks || $path === '') {
return $fullPath;
}
- 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
public function __construct($path, $storage, $internalPath, $data, $mount, $owner= null) {
Function runHooks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function runHooks($hooks, $path, $post = false) {
if (empty($hooks)) {
return true;
}
$relativePath = $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
Avoid deeply nested control flow statements. Open
if ($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage) {
continue;
}
Function searchInDir
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function searchInDir($query, $dir = '') {
$files = [];
$physicalDir = $this->getSourcePath($dir);
foreach (\scandir($physicalDir) as $item) {
if (\OC\Files\Filesystem::isIgnoredDir($item)) {
- 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 ($first) {
break;
}
Function clear
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function clear($prefix = '') {
$prefix = $this->getNamespace() . $prefix;
$allKeys = self::$cache->getAllKeys();
if ($allKeys === false) {
// newer Memcached doesn't like getAllKeys(), flush everything
- 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 (\hash_equals($logCondition['shared_secret'], $q['log_secret'] ?? '')) {
$this->logConditionSatisfied = true;
if (!empty($logCondition['logfile'])) {
$logConditionFile = $logCondition['logfile'];
}
Method handleChildren
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function handleChildren($path, $recursive, $reuse, $folderId, $lock, &$size) {
Function verifyUnencryptedSize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function verifyUnencryptedSize($path, $unencryptedSize) {
$size = $this->storage->filesize($path);
$result = $unencryptedSize;
if ($unencryptedSize < 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 normalizePath
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function normalizePath($path, $stripTrailingSlash = true, $isAbsolutePath = false, $keepUnicode = false) {
if (self::$normalizedPathCache === null) {
self::$normalizedPathCache = new CappedMemoryCache();
}
- 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 writeBack
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function writeBack($tmpFile) {
if (!isset(self::$tmpFiles[$tmpFile])) {
return;
}
- 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 backgroundScan
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function backgroundScan($dir) {
$mounts = $this->getMounts($dir);
foreach ($mounts as $mount) {
if (!$this->shouldScan($mount)) {
continue;
- 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 formatCacheEntry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function formatCacheEntry($entry) {
$storageId = $entry->getStorageId();
// Give all permissions to whitelisted "internal" paths and their
// subdirectories
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function getThumbnail(File $file, $maxX, $maxY, $scalingUp) {
$useFileDirectly = (!$file->isEncrypted() && !$file->isMounted());
if ($useFileDirectly) {
$absPath = $file->getStorage()->getLocalFile($file->getInternalPath());
} else {
- 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 setBackendOptions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function setBackendOptions($backendOptions) {
if ($this->getBackend() instanceof Backend) {
$parameters = $this->getBackend()->getParameters();
foreach ($backendOptions as $key => $value) {
if (isset($parameters[$key])) {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null) {
if ($arguments === null) {
$arguments = [];
}
if ($loader === 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 addMultiple
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function addMultiple($names, $sync=false, $id = null) {
if (!\is_array($names)) {
$names = [$names];
}
$names = \array_map('trim', $names);
- 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 tagAs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function tagAs($objid, $tag) {
if (\is_string($tag) && !\is_numeric($tag)) {
$tag = \trim($tag);
if ($tag === '') {
\OCP\Util::writeLog('core', __METHOD__.', Cannot add an empty tag', \OCP\Util::DEBUG);
- 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"