owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

    private function generateThumbNail($maxX, $maxY, $absPath, $second) {
        $extractedCover = $this->extractMp4CoverArtwork($absPath);
        if ($extractedCover !== false) {
            $tmpPath = $extractedCover;
        } else {
Severity: Minor
Found in lib/private/Preview/Movie.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 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

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

    private static function validateExpireDate($expireDate, $shareTime, $itemType, $itemSource) {
        $l = \OC::$server->getL10N('lib');
        $date = new \DateTime($expireDate);
        $today = new \DateTime('now');

Severity: Minor
Found in lib/private/Share/Share.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function run(IOutput $out) {
        $view = new View('/');
        $children = $view->getDirectoryContent('/');

        foreach ($children as $child) {
Severity: Minor
Found in lib/private/Repair/Preview.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 checkPasswordProtectedShare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function checkPasswordProtectedShare(array $linkItem) {
        if (!isset($linkItem['share_with'])) {
            return true;
        }
        if (!isset($linkItem['share_type'])) {
Severity: Minor
Found in lib/private/Share/Share.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 getOwncloudLicense has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOwncloudLicense(): ?ILicense {
        $licenseClass = $this->config->getSystemValue('license-class', BasicLicense::class);
        if (!\class_exists($licenseClass)) {
            throw new HintException("Unknown license $licenseClass");
        }
Severity: Minor
Found in lib/private/License/LicenseFetcher.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function run(IOutput $out) {
        $enabledThemes = $this->getEnabledAppThemes();

        $activeTheme = '';
        if (\count($enabledThemes) >= 2) {
Severity: Minor
Found in lib/private/Repair/DisableExtraThemes.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 registerBackend has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
        if (self::isEnabled()) {
            if (!isset(self::$backendTypes[$itemType])) {
                self::$backendTypes[$itemType] = [
                    'class' => $class,
Severity: Minor
Found in lib/private/Share/Share.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 getAllSharesBy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAllSharesBy($userId, $shareTypes, $nodeIDs, $reshares) {
        $shares = [];
        $qb = $this->dbConn->getQueryBuilder();

        $qb->select('*')
Severity: Minor
Found in lib/private/Share20/DefaultShareProvider.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 pathCreateChecks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function pathCreateChecks($path) {
        // Make sure that we do not share a path that contains a shared mountpoint
        if ($path instanceof \OCP\Files\Folder) {
            $mounts = $this->mountManager->findIn($path->getPath());
            foreach ($mounts as $mount) {
Severity: Minor
Found in lib/private/Share20/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 showPreview has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function showPreview($mimeTypeForHeaders = null) {
        // Check if file is valid
        if ($this->isFileValid() === false) {
            throw new NotFoundException('File not found.');
        }
Severity: Minor
Found in lib/private/Preview.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 setValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setValues(array $configs) {
        if ($this->isReadOnly()) {
            throw new \Exception('Config file is read only.');
        }
        $needsUpdate = false;
Severity: Minor
Found in lib/private/Config.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 buildCachePath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function buildCachePath($maxX = null, $maxY = null) {
        if ($maxX === null) {
            $maxX = $this->getMaxX();
        }
        if ($maxY === null) {
Severity: Minor
Found in lib/private/Preview.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 passesCSRFCheck has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function passesCSRFCheck() {
        if ($this->csrfTokenManager === null) {
            return false;
        }

Severity: Minor
Found in lib/private/AppFramework/Http/Request.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 getId has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getId() {
        // allow clients to provide a request id
        if (isset($this->server['HTTP_X_REQUEST_ID'])) {
            $reqId = $this->server['HTTP_X_REQUEST_ID'];
            if (\strlen($reqId) > 19
Severity: Minor
Found in lib/private/AppFramework/Http/Request.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 log has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function log($message, $level) {
        switch ($level) {
            case 'debug':
                $level = \OCP\Util::DEBUG;
                break;
Severity: Minor
Found in lib/private/AppFramework/DependencyInjection/DIContainer.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 isManipulation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isManipulation($sql) {
        $selectOccurrence = \stripos($sql, 'SELECT');
        if ($selectOccurrence !== false && $selectOccurrence < 10) {
            return false;
        }
Severity: Minor
Found in lib/private/legacy/db.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