owncloud/core

View on GitHub

Showing 4,502 of 4,502 total issues

Function startHashingContexts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function startHashingContexts($algos = null) {
        if ($algos === null) {
            foreach ($this->hashingContexts as $key => $value) {
                $this->hashingContexts[$key] = \hash_init($key);
            }
Severity: Minor
Found in lib/private/Files/Stream/Checksum.php - About 25 mins to fix

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 getTagsByIds has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTagsByIds($tagIds) {
        if (!\is_array($tagIds)) {
            $tagIds = [$tagIds];
        }

Severity: Minor
Found in lib/private/SystemTag/SystemTagManager.php - About 25 mins to fix

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 lockPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function lockPath($path, $type, $lockMountPoint = false) {
        $absolutePath = $this->getAbsolutePath($path);
        $absolutePath = Filesystem::normalizePath($absolutePath);
        if (!$this->shouldLockFile($absolutePath)) {
            return false;
Severity: Minor
Found in lib/private/Files/View.php - About 25 mins to fix

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 touch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function touch($path, $mtime = null) {
        // sets the modification time of the file to the given value.
        // If mtime is nil the current time is set.
        // note that the access time of the file always changes to the current time.
        if ($this->file_exists($path) and !$this->isUpdatable($path)) {
Severity: Minor
Found in lib/private/Files/Storage/Local.php - About 25 mins to fix

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 file_get_contents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function file_get_contents($path) {
        if ($this->encryptionManager->isEnabled() !== false) {
            $encryptionModule = $this->getEncryptionModule($path);

            if ($encryptionModule) {
Severity: Minor
Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 25 mins to fix

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 moveFromStorage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
        if ($sourceStorage === $this) {
            return $this->rename($sourceInternalPath, $targetInternalPath);
        }

Severity: Minor
Found in lib/private/Files/Storage/Common.php - About 25 mins to fix

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 parseRawHeader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function parseRawHeader($rawHeader) {
        $result = [];
        if (\substr($rawHeader, 0, \strlen(Util::HEADER_START)) === Util::HEADER_START) {
            $header = $rawHeader;
            $endAt = \strpos($header, Util::HEADER_END);
Severity: Minor
Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 25 mins to fix

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 remove has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function remove($path) {
        if (!$this->enabled or Scanner::isPartialFile($path)) {
            return;
        }

Severity: Minor
Found in lib/private/Files/Cache/Updater.php - About 25 mins to fix

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 scan has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
        if ($reuse === -1) {
            $reuse = ($recursive === self::SCAN_SHALLOW) ? self::REUSE_ETAG | self::REUSE_SIZE : self::REUSE_ETAG;
        }
        if ($lock && $this->storage->instanceOfStorage(ILockingStorage::class)) {
Severity: Minor
Found in lib/private/Files/Cache/Scanner.php - About 25 mins to fix

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 getMimeType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMimeType($path) {
        try {
            $response = $this->propfind($path);
            if ($response === false) {
                return false;
Severity: Minor
Found in lib/private/Files/Storage/DAV.php - About 25 mins to fix

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 addToCache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function addToCache(ICachedMountInfo $mount) {
        if ($mount->getStorageId() !== -1) {
            try {
                $rows = $this->connection->insertIfNotExist(
                    '*PREFIX*mounts',
Severity: Minor
Found in lib/private/Files/Config/UserMountCache.php - About 25 mins to fix

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 createStorage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function createStorage(
        $mountPoint,
        $backendIdentifier,
        $authMechanismIdentifier,
        $backendOptions,
Severity: Minor
Found in lib/private/Files/External/Service/StoragesService.php - About 25 mins to fix

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 find has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function find($path) {
        \OC_Util::setupFS();
        $path = $this->formatPath($path);
        if (isset($this->mounts[$path])) {
            return $this->mounts[$path];
Severity: Minor
Found in lib/private/Files/Mount/Manager.php - About 25 mins to fix

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 unTag has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function unTag($objid, $tag) {
        if (\is_string($tag) && !\is_numeric($tag)) {
            $tag = \trim($tag);
            if ($tag === '') {
                \OCP\Util::writeLog('core', __METHOD__.', Tag name is empty', \OCP\Util::DEBUG);
Severity: Minor
Found in lib/private/Tags.php - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getThumbnail(File $file, $maxX, $maxY, $scalingUp) {
        $this->initCmd();
        if ($this->cmd === null) {
            return false;
        }
Severity: Minor
Found in lib/private/Preview/Office.php - About 25 mins to fix

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 isApplicable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function isApplicable(IStorageConfig $config) {
        $applicableUsers = $config->getApplicableUsers();
        $applicableGroups = $config->getApplicableGroups();

        if (\count($applicableUsers) === 0 && \count($applicableGroups) === 0) {
Severity: Minor
Found in lib/private/Files/External/Service/UserGlobalStoragesService.php - About 25 mins to fix

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 getAbsoluteMountPoints has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAbsoluteMountPoints($uid) {
        $mountPoints = [];

        $userGlobalStoragesService = \OC::$server->getUserGlobalStoragesService();
        '@phan-var \OC\Files\External\Service\UserGlobalStoragesService $userGlobalStoragesService';
Severity: Minor
Found in lib/private/Files/External/LegacyUtil.php - About 25 mins to fix

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 verifyAppSignature has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function verifyAppSignature($appId, $path = '', $force = false) {
        try {
            if ($path === '') {
                $path = $this->appLocator->getAppPath($appId);
            }
Severity: Minor
Found in lib/private/IntegrityCheck/Checker.php - About 25 mins to fix

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 sendLinkShareMail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function sendLinkShareMail($sender, $recipients, $link, $personalNote = null) {
        if ($this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no') !== 'yes') {
            $message_t = $this->l->t('Public link mail notification is not allowed');
            throw new GenericShareException($message_t, $message_t, 403);
        }
Severity: Minor
Found in lib/private/Share/MailNotifications.php - About 25 mins to fix

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 cleanFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function cleanFiles(array $files): void {
        foreach ($files as $file) {
            if (\file_exists($file)) {
                try {
                    OC_Helper::rmdirr($file);
Severity: Minor
Found in lib/private/TempManager.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language