owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function createFile has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function createFile($name, $data = null) {
        # the check here is necessary, because createFile uses put covered in sabre/file.php
        # and not touch covered in files/view.php
        if (Filesystem::isForbiddenFileOrDir($name)) {
            throw new SabreForbidden();
Severity: Minor
Found in apps/dav/lib/Connector/Sabre/Directory.php - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function run(IOutput $out) {
        if (!$this->config->getSystemValue('installed', false)) {
            // Skip the migration for new installations -> nothing to migrate
            return;
        }
Severity: Minor
Found in apps/files_external/appinfo/Migrations/Version20220329110116.php - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function fopen($path, $mode) {
        $this->log('enter: '.__FUNCTION__."($path, $mode)");
        $fullPath = $this->buildPath($path);
        $result = false;
        try {
Severity: Minor
Found in apps/files_external/lib/Lib/Storage/SMB.php - About 2 hrs 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 rmdir has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function rmdir($path) {
        if (!$this->isDeletable($path)) {
            return false;
        }
        if (\trim($path, '/') === '') {
Severity: Minor
Found in apps/files_external/lib/Lib/Storage/Google.php - About 2 hrs 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 getGroupObject has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getGroupObject($gid, $displayName = null) {
        $backends = [];
        foreach ($this->backends as $backend) {
            if ($backend->groupExists($gid)) {
                if ($backend->implementsActions(\OC\Group\Backend::GROUP_DETAILS)) {
Severity: Minor
Found in lib/private/Group/Manager.php - About 2 hrs 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 getUserIdGroups has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getUserIdGroups($uid, $scope = null) {
        if (!isset($this->cachedUserGroups[$uid])) {
            $groups = [];

            foreach ($this->backends as $backend) {
Severity: Minor
Found in lib/private/Group/Manager.php - About 2 hrs 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 copyFromStorage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
        if ($sourceStorage === $this) {
            return $this->copy($sourceInternalPath, $targetInternalPath);
        }

Severity: Minor
Found in lib/private/Files/Storage/Common.php - About 2 hrs 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 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function touch($path, $mtime = null) {
        $this->init();
        if ($mtime === null) {
            $mtime = \OC::$server->getTimeFactory()->getTime();
        }
Severity: Minor
Found in lib/private/Files/Storage/DAV.php - About 2 hrs 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 extractMp4CoverArtwork has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function extractMp4CoverArtwork($absPath) {
        if (isset($this->noArtworkIndex[$absPath])) {
            return false;
        }

Severity: Minor
Found in lib/private/Preview/Movie.php - About 2 hrs 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 makeTheme has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function makeTheme($themeName, $appTheme = true) {
        $serverRoot = $this->environmentHelper->getServerRoot();
        $baseDirectory = $serverRoot;
        $directory = '';
        $webPath = '';
Severity: Minor
Found in lib/private/Theme/ThemeService.php - About 2 hrs 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 delete has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete($names) {
        if (!\is_array($names)) {
            $names = [$names];
        }

Severity: Minor
Found in lib/private/Tags.php - About 2 hrs 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 groupItems has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function groupItems($items, $itemType) {
        $fileSharing = ($itemType === 'file' || $itemType === 'folder') ? true : false;

        $result = [];

Severity: Minor
Found in lib/private/Share/Share.php - About 2 hrs 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 getAppComplains has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function getAppComplains(): array {
        $apps = [];
        $appComplains = $this->config->getAppKeys('core-license-complains');
        foreach ($appComplains as $appComplain) {
            if ($this->config->getAppValue($appComplain, 'enabled', 'no') === 'yes' && $this->appManager->getAppPath($appComplain) !== false) {
Severity: Minor
Found in lib/private/License/LicenseManager.php - About 2 hrs 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 formatResult has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE, $parameters = null) {
        if ($format === self::FORMAT_NONE) {
            return $items;
        } elseif ($format === self::FORMAT_STATUSES) {
            $statuses = [];
Severity: Minor
Found in lib/private/Share/Share.php - About 2 hrs 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 createShare has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function createShare(\OCP\Share\IShare $share) {
        $this->canShare($share);

        // Verify if there are any issues with the path
        $this->pathCreateChecks($share->getNode());
Severity: Minor
Found in lib/private/Share20/Manager.php - About 2 hrs 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 getShareByToken has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getShareByToken($token) {
        $provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);

        try {
            $share = $provider->getShareByToken($token);
Severity: Minor
Found in lib/private/Share20/Manager.php - About 2 hrs 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 normalizeVersion has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function normalizeVersion($version, $fullVersion = null) {
        $version = \trim($version);
        if ($fullVersion === null) {
            $fullVersion = $version;
        }
Severity: Minor
Found in lib/private/App/PlatformRepository.php - About 2 hrs 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 loadApp has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function loadApp($app, $checkUpgrade = true) {
        self::$loadedApps[] = $app;
        $appPath = self::getAppPath($app);
        if ($appPath === false) {
            return;
Severity: Minor
Found in lib/private/legacy/app.php - About 2 hrs 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 needUpgrade has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function needUpgrade(\OCP\IConfig $config) {
        if ($config->getSystemValue('installed', false)) {
            $installedVersion = $config->getSystemValue('version', '0.0.0');
            $currentVersion = \implode('.', \OCP\Util::getVersion());
            $versionDiff = \version_compare($currentVersion, $installedVersion);
Severity: Minor
Found in lib/private/legacy/util.php - About 2 hrs 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 loginUser has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private static function loginUser() {
        if (self::$isLoggedIn === true) {
            return \OC_User::getUser();
        }

Severity: Minor
Found in lib/private/legacy/api.php - About 2 hrs 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