owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $maxAge = $this->expiration->getMaxAgeAsTimestamp();
        if (!$maxAge) {
            $output->writeln("Auto expiration is configured - expiration will be handled automatically.");
            return 1;
Severity: Minor
Found in apps/files_versions/lib/Command/ExpireVersions.php - About 55 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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $uid = $input->getArgument('uid');
        $userFolder = $this->rootFolder->getUserFolder($uid);  // might throw a NoUserException

        try {
Severity: Minor
Found in apps/files/lib/Command/CheckCache.php - About 55 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 formatFileInfo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function formatFileInfo(FileInfo $i) {
        $entry = [];

        $entry['id'] = $i['fileid'];
        $entry['parentId'] = $i['parent'];
Severity: Minor
Found in apps/files/lib/Helper.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMimeType($path) {
        $file = $this->getDriveFile($path);
        if ($file) {
            $mimetype = $file->getMimeType();
            // Convert Google Doc mimetypes, choosing Open Document formats for download
Severity: Minor
Found in apps/files_external/lib/Lib/Storage/Google.php - About 55 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 filetype has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filetype($path) {
        if ($this->getAbsolutePath($path) === '') {
            return 'dir';
        } else {
            $file = $this->getDriveFile($path);
Severity: Minor
Found in apps/files_external/lib/Lib/Storage/Google.php - About 55 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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute($sql, array $params=[], $limit=null, $offset=null) {
        if ($this->db instanceof IDb) {
            $query = $this->db->prepareQuery($sql, $limit, $offset);
        } else {
            $query = $this->db->prepare($sql, $limit, $offset);
Severity: Minor
Found in lib/public/AppFramework/Db/Mapper.php - About 55 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 validateValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function validateValue(&$value) {
        switch ($this->getType()) {
            case self::VALUE_BOOLEAN:
                if (!\is_bool($value)) {
                    switch ($value) {
Severity: Minor
Found in lib/public/Files/External/DefinitionParameter.php - About 55 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 getFavoriteFilePaths has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFavoriteFilePaths($user) {
        $tags = $this->tagManager->load('files', [], false, $user);
        $favorites = $tags->getFavorites();

        if (empty($favorites)) {
Severity: Minor
Found in apps/files/lib/ActivityHelper.php - About 55 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 getNodeForPath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function getNodeForPath($path) {
        $info = Filesystem::getView()->getFileInfo($path);
        if (!$info) {
            $fullPath = Filesystem::getView()->getAbsolutePath($path);
            if (isset($this->deleteMetaCache[$fullPath])) {
Severity: Minor
Found in lib/private/Files/Node/HookConnector.php - About 55 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 verifyPath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function verifyPath($path, $fileName) {
        $l10n = \OC::$server->getL10N('lib');

        // verify empty and dot files
        $trimmed = \trim($fileName);
Severity: Minor
Found in lib/private/Files/View.php - About 55 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 deleteTags has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in lib/private/SystemTag/SystemTagManager.php - About 55 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 fopen has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function fopen($path, $mode) {
        $fullPath = $this->buildPath($path);
        $useExisting = true;
        switch ($mode) {
            case 'r':
Severity: Minor
Found in lib/private/Files/Storage/Flysystem.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function find($resources) {
        foreach ($resources as $resource) {
            try {
                $this->doFind($resource);
            } catch (ResourceNotFoundException $e) {
Severity: Minor
Found in lib/private/Template/ResourceLocator.php - About 55 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 createGroup has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function createGroup($gid) {
        if ($gid === '' || $gid === null || \trim($gid) !== $gid) {
            return false;
        } elseif ($group = $this->get($gid)) {
            return $group;
Severity: Minor
Found in lib/private/Group/Manager.php - About 55 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 getStatus has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getStatus($file) {
        // normalize file
        $file = $this->normalize($file);

        $pathHash = \md5($file);
Severity: Minor
Found in lib/private/Files/Cache/Cache.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function touch($path, $mtime = null) {
        if ($mtime === null) {
            $mtime = \time();
        }

Severity: Minor
Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php - About 55 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 fopen has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function fopen($path, $mode) {
        $source = $this->storage->fopen($path, $mode);

        $used = \OCP\Files\FileInfo::SPACE_NOT_COMPUTED;
        $free = $this->free_space('');
Severity: Minor
Found in lib/private/Files/Storage/Wrapper/Quota.php - About 55 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 getChildrenWithFilter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function getChildrenWithFilter($fileId, $mimetypeFilter = null) {
        if ($fileId > -1) {
            $qb = $this->connection->getQueryBuilder();
            $qb->select(
                'fileid',
Severity: Minor
Found in lib/private/Files/Cache/Cache.php - About 55 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 fixUnencryptedSize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function fixUnencryptedSize($path, $size, $unencryptedSize) {
        $headerSize = $this->getHeaderSize($path);
        $header = $this->getHeader($path);
        $encryptionModule = $this->getEncryptionModule($path);

Severity: Minor
Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 55 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 opendir has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function opendir($path) {
        $this->init();
        $path = $this->cleanPath($path);
        try {
            // client propfind is in \OC\HTTP\Client
Severity: Minor
Found in lib/private/Files/Storage/DAV.php - About 55 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