owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function getHeader has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getHeader($path) {
        if (\is_resource($path)) {
            $exists = false;
        } else {
            $realFile = OC_Util::stripPartialFileExtension($path);
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 getNotificationTypes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNotificationTypes($languageCode) {
        $filesNotificationTypes = [];
        $sharingNotificationTypes = [];

        $notificationTypes = [];
Severity: Minor
Found in lib/private/Activity/Manager.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 post_deleteUser has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function post_deleteUser($arguments) {
        // Find all objectid/tagId pairs.
        $result = null;
        try {
            $stmt = \OCP\DB::prepare('SELECT `id` FROM `' . self::TAG_TABLE . '` '
Severity: Minor
Found in lib/private/Tags.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 getSharedItemsOwners has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getSharedItemsOwners($user, $type, $includeCollections = false, $includeOwner = false) {
        // First, we find out if $type is part of a collection (and if that collection is part of
        // another one and so on).
        $collectionTypes = [];
        if (!$includeCollections || !$collectionTypes = self::getCollectionItemTypes($type)) {
Severity: Minor
Found in lib/private/Share/Share.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 generateTarget has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $suggestedTarget = null, $groupParent = null) {
        // FIXME: $uidOwner and $groupParent seems to be unused
        $backend = \OC\Share\Share::getBackend($itemType);
        if ($shareType === self::SHARE_TYPE_LINK || $shareType === self::SHARE_TYPE_REMOTE) {
            if (isset($suggestedTarget)) {
Severity: Minor
Found in lib/private/Share/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 create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function create(\OCP\Share\IShare $share) {
        $this->validate($share);
        $qb = $this->dbConn->getQueryBuilder();

        $qb->insert('share');
Severity: Minor
Found in lib/private/Share20/DefaultShareProvider.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 getAllSharedWith has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAllSharedWith($userId, $shareTypes, $node = null) {
        $shares = [];

        // Aggregate all required $shareTypes by mapping provider to supported shareTypes
        $providerIdMap = $this->shareTypeToProviderMap($shareTypes);
Severity: Minor
Found in lib/private/Share20/Manager.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 decodeContent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function decodeContent() {
        if ($this->contentDecoded) {
            return;
        }
        $params = [];
Severity: Minor
Found in lib/private/AppFramework/Http/Request.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 getRawPathInfo has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRawPathInfo() {
        $requestUri = $this->server['REQUEST_URI'] ?? '';
        // remove too many leading slashes - can be caused by reverse proxy configuration
        if (\strpos($requestUri, '/') === 0) {
            $requestUri = '/' . \ltrim($requestUri, '/');
Severity: Minor
Found in lib/private/AppFramework/Http/Request.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 executeController has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function executeController($controller, $methodName) {
        $arguments = [];

        // valid types that will be casted
        $types = ['int', 'integer', 'bool', 'boolean', 'float'];
Severity: Minor
Found in lib/private/AppFramework/Http/Dispatcher.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 afterController has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function afterController($controller, $methodName, Response $response) {
        // only react if its a CORS request and if the request sends origin and
        $userId = null;
        if ($this->session->getUser() !== null) {
            $userId = $this->session->getUser()->getUID();
Severity: Minor
Found in lib/private/AppFramework/Middleware/Security/CORSMiddleware.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 decryptAll has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function decryptAll(InputInterface $input, OutputInterface $output, $user = '') {
        $this->input = $input;
        $this->output = $output;

        if ($user !== '' && $this->userManager->userExists($user) === false) {
Severity: Minor
Found in lib/private/Encryption/DecryptAll.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 installShippedApps has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function installShippedApps($softErrors = false) {
        $errors = [];
        $appsToInstall = Installer::getShippedApps();

        foreach ($appsToInstall as $appToInstall) {
Severity: Minor
Found in lib/private/Installer.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 createConnectionParams has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function createConnectionParams() {
        $type = $this->config->getValue('dbtype', 'sqlite');

        $connectionParams = [
            'user' => $this->config->getValue('dbuser', ''),
Severity: Minor
Found in lib/private/DB/ConnectionFactory.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 logClientIn has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function logClientIn($user, $password, IRequest $request) {
        $isTokenPassword = $this->isTokenPassword($password);
        if ($user === null || \trim($user) === '') {
            throw new \InvalidArgumentException('$user cannot be empty');
        }
Severity: Minor
Found in lib/private/User/Session.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 listJobsIncludingInvalid has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function listJobsIncludingInvalid(
        \Closure $validJobCallback,
        \Closure $invalidJobCallback
    ): void {
        $query = $this->connection->getQueryBuilder();
Severity: Minor
Found in lib/private/BackgroundJob/JobList.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 searchPaged has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function searchPaged($query, array $inApps = [], $page = 1, $size = 30) {
        $this->initProviders();
        $results = [];
        foreach ($this->providers as $provider) {
            /** @var $provider Provider */
Severity: Minor
Found in lib/private/Search.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 findLanguage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function findLanguage($app = null) {
        if ($this->requestLanguage !== '' && $this->languageExists($app, $this->requestLanguage)) {
            return $this->requestLanguage;
        }

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

    public function load($class) {
        $pathsToRequire = null;
        if ($this->memoryCache) {
            $pathsToRequire = $this->memoryCache->get($class);
        }
Severity: Minor
Found in lib/private/Autoloader.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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function get($uid, $evenMissing = false) {
        // fix numeric uid that was cast by storing it in an array key
        if (\is_numeric($uid)) {
            $uid = (string)$uid;
        }
Severity: Minor
Found in lib/private/User/Manager.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