owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

    hide: function ($row, callback) {
        var self = this;
        var $notification = $('#notification');

        if (_.isFunction($row)) {
Severity: Minor
Found in core/js/js.js - 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 _updateProgressBar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _updateProgressBar: function() {
        var progress = parseInt(this.$uploadprogressbar.attr('data-loaded'), 10);
        var total = parseInt(this.$uploadprogressbar.attr('data-total'), 10);
        if (progress !== this._lastProgress) {
            this._lastProgress = progress;
Severity: Minor
Found in apps/files/js/file-upload.js - 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 resetDone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    resetDone : function(result){
        var resetErrorMsg;
        if (result && result.status === 'success'){
            $.post(
                    OC.webroot + '/',
Severity: Minor
Found in core/js/lostpassword.js - 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 register has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    register: function(appName, bundle, pluralForm) {
        var self = this;
        if (_.isUndefined(this._bundles[appName])) {
            this._bundles[appName] = bundle || {};

Severity: Minor
Found in core/js/l10n.js - 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 _formatRemoteShare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _formatRemoteShare: function(remoteAddress) {
        var parts = this._REMOTE_OWNER_REGEXP.exec(remoteAddress);
        if (!parts) {
            // display as is, most likely to be a simple owner name
            return escapeHTML(remoteAddress);
Severity: Minor
Found in core/js/share.js - 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 setEnabled has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setEnabled($id, $enabled) {
        $userId = $this->userSession->getUser()->getUID();
        $user = $this->userManager->get($id);
        '@phan-var \OC\Group\Manager $this->groupManager';

Severity: Minor
Found in settings/Controller/UsersController.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 destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function destroy($id) {
        $userId = $this->userSession->getUser()->getUID();
        $user = $this->userManager->get($id);

        if ($userId === $id) {
Severity: Minor
Found in settings/Controller/UsersController.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 changeMail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function changeMail($token, $userId) {
        $user = $this->userManager->get($userId);
        $sessionUser = $this->userSession->getUser();

        if ($user->getUID() !== $sessionUser->getUID()) {
Severity: Minor
Found in settings/Controller/UsersController.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 changePersonalPassword has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function changePersonalPassword($args) {
        // Check if we are an user
        \OC_JSON::callCheck();
        \OC_JSON::checkLoggedIn();

Severity: Minor
Found in settings/ChangePassword/Controller.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 getParents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParents($itemSource, $shareWith = null, $owner = null) {
        $result = [];
        $parent = $this->getParentId($itemSource);
        while ($parent) {
            $shares = \OCP\Share::getItemSharedWithUser('folder', $parent, $shareWith, $owner);
Severity: Minor
Found in apps/files_sharing/lib/ShareBackend/Folder.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 updateInitiatorInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateInitiatorInfo() {
        while (true) {
            $shares = $this->getMissingInitiator(1000);

            if (empty($shares)) {
Severity: Minor
Found in apps/files_sharing/lib/Migration.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 testUrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function testUrl(IClientService $clientService, string $remote, bool $checkVersion = false, bool $throwConnectException = false): bool {
        try {
            $client = $clientService->newClient();
            $response = \json_decode($client->get(
                $remote,
Severity: Minor
Found in apps/files_sharing/lib/External/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 notifyRecipients has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function notifyRecipients($itemSource, $itemType, $shareType, $recipient) {
        $recipientList = [];
        $sender = $this->userSession->getUser();
        if ($shareType === Share::SHARE_TYPE_USER) {
            $recipientList[] = $this->userManager->get($recipient);
Severity: Minor
Found in apps/files_sharing/lib/Controller/NotificationController.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 getFreeSpace has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getFreeSpace(IUser $user) {
        $free = 0;
        $quota = \OC_Util::getUserQuota($user);
        if ($quota === FileInfo::SPACE_UNLIMITED) {
            $free = Filesystem::free_space('/');
Severity: Minor
Found in apps/files_trashbin/lib/Quota.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 addGroup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addGroup($parameters) {
        // Validate name
        $groupId = $this->request->getParam('groupid', '');
        if (($groupId === '') || $groupId === null || ($groupId === false)) {
            \OCP\Util::writeLog('provisioning_api', 'Group name not supplied', \OCP\Util::ERROR);
Severity: Minor
Found in apps/provisioning_api/lib/Groups.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 getSubscriptionsForUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSubscriptionsForUser($principalUri) {
        $fields = \array_values($this->subscriptionPropertyMap);
        $fields[] = 'id';
        $fields[] = 'uri';
        $fields[] = 'source';
Severity: Minor
Found in apps/dav/lib/CalDAV/CalDavBackend.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 getChildren has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getChildren() {
        // Within a PROPFIND request we return no listing in case the share is a file drop folder
        if ($this->isFileDropFolder()
            && ($this->isPropfind() || $this->isGet())
        ) {
Severity: Minor
Found in apps/dav/lib/Files/PublicFiles/PublicSharedRootNode.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 getACL has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getACL() {
        $acl =  [
            [
                'privilege' => '{DAV:}read',
                'principal' => $this->getOwner(),
Severity: Minor
Found in apps/dav/lib/CalDAV/Calendar.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 checkPropFind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPropFind($request) {
        $path = $request->getPath();
        $node = $this->server->tree->getNodeForPath($path);

        if ($node instanceof Node) {
Severity: Minor
Found in apps/dav/lib/Connector/Sabre/FilesPlugin.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 getGroupMembership has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getGroupMembership($principal, $needGroups = false) {
        list($prefix, $name) = \Sabre\Uri\split($principal);

        if ($prefix === $this->principalPrefix) {
            $user = $this->userManager->get($name);
Severity: Minor
Found in apps/dav/lib/Connector/Sabre/Principal.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