owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

    private function syncSingleUser(
        InputInterface $input,
        OutputInterface $output,
        SyncService $syncService,
        UserInterface $backend,
Severity: Minor
Found in core/Command/User/SyncBackend.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 execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        '@phan-var \OC\Files\MimetypeDetector $this->mimetypeDetector';
        $mappings = $this->mimetypeDetector->getAllMappings();

        $totalFilecacheUpdates = 0;
Severity: Minor
Found in core/Command/Maintenance/Mimetype/UpdateDB.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 handleRemovedUsers has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleRemovedUsers(array $removedUsers, InputInterface $input, OutputInterface $output, $missingAccountsAction): void {
        if (empty($removedUsers)) {
            $output->writeln('No removed users have been detected.');
        } else {
            // define some actions to be used
Severity: Minor
Found in core/Command/User/SyncBackend.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 render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        render: function() {
            var parts = this._makeCrumbs(this.dir || '/');
            var $crumb;
            this.$el.empty();
            this.breadcrumbs = [];
Severity: Minor
Found in apps/files/js/breadcrumb.js - About 1 hr to fix

    Function setSort has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            setSort: function(sort, direction, update, persist) {
                var comparator = FileList.Comparators[sort] || FileList.Comparators.name;
                this._sort = sort;
                this._sortDirection = (direction === 'desc')?'desc':'asc';
                this._sortComparator = comparator;
    Severity: Minor
    Found in apps/files/js/filelist.js - About 1 hr to fix

      Function render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              render: function() {
                  if (this.model) {
                      var isFavorite = (this.model.get('tags') || []).indexOf(OC.TAG_FAVORITE) >= 0;
                      this.$el.html(this.template({
                          type: this.model.isImage()? 'image': '',
      Severity: Minor
      Found in apps/files/js/mainfileinfodetailview.js - About 1 hr to fix

        Function updateSelectionSummary has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                updateSelectionSummary: function() {
                    var summary = this._selectionSummary.summary;
                    var selection;
        
                    var showHidden = !!this._filesConfig.get('showhidden');
        Severity: Minor
        Found in apps/files/js/filelist.js - About 1 hr to fix

          Function _onProgress has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _onProgress: function (e, data) {
                      if (e.lengthComputable) {
                          var now = ((Date.now) ? Date.now() : (new Date()).getTime()),
                              loaded;
                          if (data._time && data.progressInterval &&
          Severity: Minor
          Found in apps/files/js/jquery.fileupload.js - About 1 hr to fix

            Function render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    render: function() {
                        var baseTemplate = this._getTemplate('base', TEMPLATE_BASE);
            
                        this.$el.html(baseTemplate({
                            cid: this.cid,
            Severity: Minor
            Found in core/js/sharedialogview.js - About 1 hr to fix

              Function putFileContents has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      putFileContents: function(path, body, options) {
                          if (!path) {
                              throw 'Missing argument "path"';
                          }
                          var self = this;
              Severity: Minor
              Found in core/js/files/client.js - About 1 hr to fix

                Function getShareeObject has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        getShareeObject: function(shareIndex) {
                            var shareWith = this.model.getShareWith(shareIndex);
                            var shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex);
                            var shareType = this.model.getShareType(shareIndex);
                            var shareWithAdditionalInfo = this.model.getShareWithAdditionalInfo(shareIndex);
                Severity: Minor
                Found in core/js/sharedialogshareelistview.js - About 1 hr to fix

                  Function getShareeList has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          getShareeList: function() {
                              var universal = {
                                  avatarEnabled: this.configModel.areAvatarsEnabled(),
                                  mailNotificationEnabled: this.configModel.isMailNotificationEnabled(),
                                  notifyByMailLabel: t('core', 'notify by email'),
                  Severity: Minor
                  Found in core/js/sharedialogshareelistview.js - About 1 hr to fix

                    Method isUsedTlsLibOutdated has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function isUsedTlsLibOutdated(): string {
                            // Don't run check when:
                            // 1. Server has `has_internet_connection` set to false
                            // 2. App Store AND S2S is disabled
                            if (!$this->config->getSystemValue('has_internet_connection', true)) {
                    Severity: Minor
                    Found in settings/Controller/CheckSetupController.php - About 1 hr to fix

                      Method handleException has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function handleException($e) {
                          $request = \OC::$server->getRequest();
                          // in case the request content type is text/xml - we assume it's a WebDAV request
                          $isXmlContentType = \strpos($request->getHeader('Content-Type') ?? '', 'text/xml');
                          if ($isXmlContentType === 0) {
                      Severity: Minor
                      Found in remote.php - About 1 hr to fix

                        Method doDelete has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function doDelete($path, $method) {
                                if (self::$disableTrash
                                    || !\OC_App::isEnabled('files_trashbin')
                                    || (\pathinfo($path, PATHINFO_EXTENSION) === 'part')
                                    || $this->shouldMoveToTrash($path) === false
                        Severity: Minor
                        Found in apps/files_trashbin/lib/Storage.php - About 1 hr to fix

                          Method registerService has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function registerService() {
                                  $container = $this->getContainer();
                          
                                  $container->registerService('addServerMiddleware', function (IAppContainer $c) {
                                      return new AddServerMiddleware(
                          Severity: Minor
                          Found in apps/federation/lib/AppInfo/Application.php - About 1 hr to fix

                            Method getCalendarByUri has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getCalendarByUri($principal, $uri) {
                                    $fields = \array_values($this->propertyMap);
                                    $fields[] = 'id';
                                    $fields[] = 'uri';
                                    $fields[] = 'synctoken';
                            Severity: Minor
                            Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 1 hr to fix

                              Method createCardsTable has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function createCardsTable(Schema $schema) {
                                      if (!$schema->hasTable("{$this->prefix}cards")) {
                                          $table = $schema->createTable("{$this->prefix}cards");
                                          $table->addColumn('id', 'integer', [
                                              'autoincrement' => true,
                              Severity: Minor
                              Found in apps/dav/appinfo/Migrations/Version20170116150538.php - About 1 hr to fix

                                Method displayPanel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function displayPanel() {
                                        $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime(
                                            $this->config->getAppValue('core', 'lastupdatedat')
                                        );
                                
                                
                                Severity: Minor
                                Found in apps/updatenotification/lib/Controller/AdminController.php - About 1 hr to fix

                                  Method httpGet has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function httpGet(RequestInterface $request, ResponseInterface $response) {
                                          // Only handle valid files
                                          $node = $this->tree->getNodeForPath($request->getPath());
                                          if (!($node instanceof IFile)) {
                                              return;
                                  Severity: Minor
                                  Found in apps/dav/lib/Connector/Sabre/FilesPlugin.php - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language