owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function checkExistingFiles has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    checkExistingFiles: function (selection, callbacks) {
        var self = this;
        var fileList = this.fileList;
        var conflicts = [];
        // only keep non-conflicting uploads
Severity: Minor
Found in apps/files/js/file-upload.js - About 1 hr 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 parseQueryString has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    parseQueryString: function (queryString) {
        var parts,
            pos,
            components,
            result = {},
Severity: Minor
Found in core/js/js.js - About 1 hr 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 EventSource has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

OC.EventSource=function(src,data){
    var dataStr='';
    var name;
    var joinChar;
    this.typelessListeners=[];
Severity: Minor
Found in core/js/eventsource.js - About 1 hr 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 check has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function check($pathsToCheck) {
        // If any of elements cannot be downloaded, prevent whole download
        foreach ($pathsToCheck as $file) {
            try {
                $info = $this->userFolder->get($file);
Severity: Minor
Found in apps/files_sharing/lib/ViewOnly.php - About 1 hr 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 setupFromToken has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function setupFromToken($token, $relativePath = null, $password = null) {
        \OC_User::setIncognitoMode(true);

        $linkItem = \OCP\Share::getShareByToken($token, !$password);
        if ($linkItem === false || ($linkItem['item_type'] !== 'file' && $linkItem['item_type'] !== 'folder')) {
Severity: Minor
Found in apps/files_sharing/lib/Helper.php - About 1 hr 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 run has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function run($argument) {
        $target = $argument['url'];
        $source = $this->urlGenerator->getAbsoluteURL('/');
        $source = \rtrim($source, '/');
        $token = $argument['token'];
Severity: Minor
Found in apps/federation/lib/BackgroundJob/GetSharedSecret.php - About 1 hr 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 discover has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private function discover($remote) {
        // Check if something is in the cache
        if ($cacheData = $this->cache->get($remote)) {
            return \json_decode($cacheData, true);
        }
Severity: Minor
Found in apps/federatedfilesharing/lib/DiscoveryManager.php - About 1 hr 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 firstLogin has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function firstLogin(IUser $user = null) {
        if ($user !== null) {
            $principal = 'principals/users/' . $user->getUID();
            $calendars = $this->calDav->getCalendarsForUser($principal);
            if (empty($calendars) || (\count($calendars) === 1 && $calendars[0]['uri'] === BirthdayService::BIRTHDAY_CALENDAR_URI)) {
Severity: Minor
Found in apps/dav/lib/HookManager.php - About 1 hr 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 verifyChecksumsForFolder has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private function verifyChecksumsForFolder($folder, InputInterface $input, OutputInterface $output) {
        $folderQueue = [$folder];
        while ($currentFolder = \array_pop($folderQueue)) {
            '@phan-var \OCP\Files\Folder $currentFolder';
            $currentFolderPath = $currentFolder->getPath();
Severity: Minor
Found in apps/files/lib/Command/VerifyChecksums.php - About 1 hr 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 checkDependencies has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkDependencies() {
        $ret = [];

        $result = \call_user_func([$this->getStorageClass(), 'checkDependencies']);
        if ($result !== true) {
Severity: Minor
Found in apps/files_external/lib/Lib/LegacyDependencyCheckPolyfill.php - About 1 hr 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 writeExtra has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public static function writeExtra($app, $message, $level, $conditionalLogFile, $extraFields = []) {
        $config = \OC::$server->getSystemConfig();

        // default to ISO8601
        $format = $config->getValue('logdateformat', 'c');
Severity: Minor
Found in lib/private/Log/Owncloud.php - About 1 hr 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 get has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function get($path, $ensureExists = false) {
        $path = $this->normalizePath($path);
        if ($this->isValidPath($path)) {
            $fullPath = $this->getFullPath($path);
            $virtualNode = $this->resolveVirtualNode($fullPath);
Severity: Minor
Found in lib/private/Files/Node/Root.php - About 1 hr 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 searchInDir has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function searchInDir($query, $dir = '') {
        $files = [];
        $dh = $this->opendir($dir);
        if (\is_resource($dh)) {
            while (($item = \readdir($dh)) !== false) {
Severity: Minor
Found in lib/private/Files/Storage/Common.php - About 1 hr 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 fromTmpFile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function fromTmpFile($tmpFile, $path) {
        $this->assertPathLength($path);
        if (Filesystem::isValidPath($path)) {
            // Get directory that the file is going into
            $filePath = \dirname($path);
Severity: Minor
Found in lib/private/Files/View.php - About 1 hr 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 filemtime has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function filemtime($path) {
        $fullPath = $this->getSourcePath($path);
        \clearstatcache($fullPath);
        if (!$this->file_exists($path)) {
            return false;
Severity: Minor
Found in lib/private/Files/Storage/Local.php - About 1 hr 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 __construct has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct(
        $globalPrefix,
        ILogger $logger,
        $localCacheClass = null,
        $distributedCacheClass = null,
Severity: Minor
Found in lib/private/Memcache/Factory.php - About 1 hr 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 updateEncryptedVersion has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private function updateEncryptedVersion(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $isRename) {
        $isEncrypted = $this->encryptionManager->isEnabled() && $this->mount->getOption('encrypt', true) ? 1 : 0;
        $cacheInformation = [
            'encrypted' => (bool)$isEncrypted,
        ];
Severity: Minor
Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 1 hr 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 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function scan($dir = '') {
        if (!Filesystem::isValidPath($dir)) {
            throw new \InvalidArgumentException('Invalid path to scan');
        }
        $mounts = $this->getMounts($dir);
Severity: Minor
Found in lib/private/Files/Utils/Scanner.php - About 1 hr 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 mkdir has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function mkdir($path) {
        $path = $this->normalizePath($path);

        if ($this->file_exists($path)) {
            return false;
Severity: Minor
Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php - About 1 hr 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 getFontFile has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    private function getFontFile(array $info): string {
        $fontFileDir  = __DIR__;
        $fontFileDir .= '/../../../core/fonts/';

        $fontSet = [
Severity: Minor
Found in lib/private/Preview/TXT.php - About 1 hr 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