owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method stream_open has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function stream_open($path, $mode, $options, &$opened_path) {
        $context = $this->loadContext('ocencryption');

        $this->position = 0;
        $this->cache = '';
Severity: Minor
Found in lib/private/Files/Stream/Encryption.php - About 1 hr to fix

    Method emit_file_hooks_pre has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function emit_file_hooks_pre($exists, $path, &$run) {
            $event = new GenericEvent(null);
            if (!$exists) {
                \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, [
                    Filesystem::signal_param_path => $this->getHookPath($path),
    Severity: Minor
    Found in lib/private/Files/View.php - About 1 hr to fix

      Method opendir has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function opendir($path) {
              $this->init();
              $path = $this->cleanPath($path);
              try {
                  // client propfind is in \OC\HTTP\Client
      Severity: Minor
      Found in lib/private/Files/Storage/DAV.php - About 1 hr to fix

        Method getMountsForUser has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getMountsForUser(IUser $user) {
                $loader = $this->loader;
                $mounts = \array_map(function (IMountProvider $provider) use ($user, $loader) {
                    return $provider->getMountsForUser($user, $loader);
                }, $this->providers);
        Severity: Minor
        Found in lib/private/Files/Config/MountProviderCollection.php - About 1 hr to fix

          Method mkdir has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function mkdir($path) {
                  $path = $this->normalizePath($path);
          
                  if ($this->file_exists($path)) {
                      return false;
          Severity: Minor
          Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php - About 1 hr to fix

            Method getThumbnail has 37 lines of code (exceeds 25 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 1 hr to fix

              Method dispatch has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function dispatch(Controller $controller, $methodName) {
                      $out = [null, [], null];
              
                      try {
                          // prefill reflector with everything thats needed for the
              Severity: Minor
              Found in lib/private/AppFramework/Http/Dispatcher.php - About 1 hr to fix

                Method getNext has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getNext() {
                        $query = $this->connection->getQueryBuilder();
                        $query->select('*')
                            ->from('jobs')
                            ->where($query->expr()->lte('reserved_at', $query->createNamedParameter($this->timeFactory->getTime() - 12 * 3600, IQueryBuilder::PARAM_INT)))
                Severity: Minor
                Found in lib/private/BackgroundJob/JobList.php - About 1 hr to fix

                  Method syncSingleUser has 37 lines of code (exceeds 25 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

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    } catch (\Exception $e) {
                        \OCP\Util::writeLog(
                            'files_sharing',
                            'Failure adding external share. Unhandled exception thrown while checking storage availability',
                            \OCP\Util::ERROR
                    Severity: Major
                    Found in apps/files_sharing/ajax/external.php and 1 other location - About 1 hr to fix
                    apps/files_sharing/ajax/external.php on lines 96..115

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 110.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        private function shouldHideKey(IStorageConfig $mount, $key) {
                            $backend = $mount->getBackend();
                            $backendParameters = $backend->getParameters();
                    
                            $auth = $mount->getAuthMechanism();
                    Severity: Major
                    Found in apps/files_external/lib/Command/ListCommand.php and 1 other location - About 1 hr to fix
                    apps/files_external/appinfo/Migrations/Version20210511082903.php on lines 74..93

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 110.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                    } catch (\OCP\Files\StorageInvalidException $e) {
                        // note: checkStorageAvailability will already remove the invalid share
                        \OCP\Util::writeLog(
                            'files_sharing',
                            'Failure adding external share. Invalid remote storage thrown while checking storage availability',
                    Severity: Major
                    Found in apps/files_sharing/ajax/external.php and 1 other location - About 1 hr to fix
                    apps/files_sharing/ajax/external.php on lines 115..133

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 110.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        private function shouldBeEncrypted($storageConfig, $key) {
                            $backend = $storageConfig->getBackend();
                            $backendParameters = $backend->getParameters();
                    
                            $auth = $storageConfig->getAuthMechanism();
                    apps/files_external/lib/Command/ListCommand.php on lines 333..351

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 110.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                    $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'), {
                                            files: JSON.stringify([filename]),
                                            dir: fileList.getCurrentDirectory()
                                        },
                                        _.bind(fileList._removeCallback, fileList)
                    Severity: Major
                    Found in apps/files_trashbin/js/app.js and 1 other location - About 1 hr to fix
                    apps/files_trashbin/js/app.js on lines 60..65

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 64.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                                    $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), {
                                            files: JSON.stringify([filename]),
                                            dir: fileList.getCurrentDirectory()
                                        },
                                        _.bind(fileList._removeCallback, fileList)
                    Severity: Major
                    Found in apps/files_trashbin/js/app.js and 1 other location - About 1 hr to fix
                    apps/files_trashbin/js/app.js on lines 89..94

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 64.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Function saveStorageConfig has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        saveStorageConfig:function($tr, callback, concurrentTimer) {
                            var self = this;
                            var storage = this.getStorageConfig($tr);
                            if (!storage || !storage.validate()) {
                                return false;
                    Severity: Minor
                    Found in apps/files_external/js/settings.js - About 1 hr to fix

                      Function getMountPointList has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          getMountPointList: function (afterCallback) {
                              var self = this;
                              if (typeof afterCallback !== 'function' || self.isGetMountPointListRunning) {
                                  return;
                              }
                      Severity: Minor
                      Found in apps/files_external/js/statusmanager.js - About 1 hr to fix

                        Function parse has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                parse: function(data) {
                                    if(data === false) {
                                        console.warn('no data was returned');
                                        this.trigger('fetchError');
                                        return {};
                        Severity: Minor
                        Found in core/js/shareitemmodel.js - About 1 hr to fix

                          Method getSharedWithMe has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function getSharedWithMe($node, $includeTags, $requestedShareTypes, $stateFilter = 0) {
                                  // sharedWithMe is limited to user and group shares for compatibility.
                                  $shares = [];
                                  if (isset($requestedShareTypes[Share::SHARE_TYPE_USER]) && $requestedShareTypes[Share::SHARE_TYPE_USER]) {
                                      $shares = \array_merge(
                          Severity: Minor
                          Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 1 hr to fix

                            Method event has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function event(ManagerEvent $event) {
                                    $actor = $this->session->getUser();
                                    if ($actor instanceof IUser) {
                                        $actor = $actor->getUID();
                                    } else {
                            Severity: Minor
                            Found in apps/systemtags/lib/Activity/Listener.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language