owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Function showDropDown has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    showDropDown:function(itemType, itemSource, appendTo, link, possiblePermissions, filename) {
Severity: Minor
Found in core/js/share.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            switch ( col ) {
                                case 0: calender += " ui-datepicker-group-first";
                                    cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break;
                                case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
                                    cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
    Severity: Major
    Found in core/js/js.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              while (path != last) {
                                  if (path === data.path && !data.link) {
                                      var actions = $fileList.find('.fileactions .action[data-action="Share"]');
                                      var files = $fileList.find('.filename');
                                      var i;
      Severity: Major
      Found in core/js/share.js - About 45 mins to fix

        Function _handlePickerClick has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            _handlePickerClick:function(event, $element) {
                var getOcDialog = this.$filePicker.closest('.oc-dialog');
                var buttonEnableDisable = getOcDialog.find('.primary');
                if ($element.data('type') === 'file') {
                    if (this.$filePicker.data('multiselect') !== true || !event.ctrlKey) {
        Severity: Minor
        Found in core/js/oc-dialogs.js - About 45 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

        Avoid deeply nested control flow statements.
        Open

                        } else if ( copy !== undefined ) {
                            target[ name ] = copy;
                        }
        Severity: Major
        Found in core/js/js.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                              if (users[j].value.shareWith === share.share_with) {
                                                  users.splice(j, 1);
                                                  break;
                                              }
          Severity: Major
          Found in core/js/sharedialogview.js - About 45 mins to fix

            Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $appName,
                    IRequest $request,
                    ICertificateManager $userCertificateManager,
                    ICertificateManager $systemCertificateManager,
                    IL10N $l10n,
            Severity: Minor
            Found in settings/Controller/CertificateController.php - About 45 mins to fix

              Function checkCoreMailMap has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function checkCoreMailMap($author) {
                      if (empty($this->mailMap)) {
                          $content = \file_get_contents(__DIR__ . '/../.mailmap');
                          $entries = \explode("\n", $content);
                          foreach ($entries as $entry) {
              Severity: Minor
              Found in build/license.php - About 45 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

              Avoid deeply nested control flow statements.
              Open

                                          if (query.length > 2) {
                                              self.search(query);
                                          } else {
                                              self.hideResults();
                                          }
              Severity: Major
              Found in core/search/js/search.js - About 45 mins to fix

                Function isValidUrl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function isValidUrl(string $url) {
                        $parsedUrl = \parse_url($url);
                
                        if (!\filter_var($url, FILTER_VALIDATE_URL) || !$parsedUrl) {
                            return  false;
                Severity: Minor
                Found in settings/Controller/CorsController.php - About 45 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 setEmailAddress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function setEmailAddress($id, $mailAddress) {
                        $resp = $this->validateEMail($mailAddress);
                        if ($resp) {
                            return $resp;
                        }
                Severity: Minor
                Found in settings/Controller/UsersController.php - About 45 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 getAffectedUsers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function getAffectedUsers(IShare $share) {
                        $users = [];
                        if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
                            // notify all group members
                            $group = $this->groupManager->get($share->getSharedWith());
                Severity: Minor
                Found in apps/files_sharing/lib/Service/NotificationPublisher.php - About 45 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

                Avoid deeply nested control flow statements.
                Open

                                            if(self.hasFilter(getCurrentApp())) {
                                                self.getFilter(getCurrentApp())(query);
                                            }
                Severity: Major
                Found in core/search/js/search.js - About 45 mins to fix

                  Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          $appName,
                          IRequest $request,
                          IGroupManager $groupManager,
                          IUserSession $userSession,
                          $isAdmin,
                  Severity: Minor
                  Found in settings/Controller/GroupsController.php - About 45 mins to fix

                    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            $appName,
                            IRequest $request,
                            Manager $externalManager,
                            IConfig $config,
                            ILogger $logger,
                    Severity: Minor
                    Found in apps/files_sharing/lib/Controller/RemoteOcsController.php - About 45 mins to fix

                      Method translate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
                      Severity: Minor
                      Found in apps/files_sharing/lib/Activity.php - About 45 mins to fix

                        Function moveShareToShare has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function moveShareToShare($path) {
                                $userFolder = \OC::$server->getUserFolder();
                        
                                // If the user folder can't be constructed (e.g. link share) just return.
                                if ($userFolder === null) {
                        Severity: Minor
                        Found in apps/files_sharing/lib/Updater.php - About 45 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

                        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                IManager $shareManager,
                                IConfig $config,
                                UserSearch $userSearch,
                                IL10N $l10n,
                                SharingAllowlist $sharingAllowlist,
                        Severity: Minor
                        Found in apps/files_sharing/lib/Capabilities.php - About 45 mins to fix

                          Function rename has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function rename($path1, $path2) {
                                  $isPartFile = \pathinfo($path1, PATHINFO_EXTENSION) === 'part';
                                  $targetExists = $this->file_exists($path2);
                                  $sameFolder = \dirname($path1) === \dirname($path2);
                          
                          
                          Severity: Minor
                          Found in apps/files_sharing/lib/SharedStorage.php - About 45 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

                          Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  $appName,
                                  IRequest $request,
                                  ISettingsManager $settingsManager,
                                  IURLGenerator $urlGenerator,
                                  IGroupManager $groupManager,
                          Severity: Minor
                          Found in settings/Controller/SettingsPageController.php - About 45 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language