owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method sendMail has 11 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $toaddress,
        $toname,
        $subject,
        $mailtext,
        $fromaddress,
Severity: Major
Found in lib/public/Util.php - About 1 hr to fix

    Method getItems has 11 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $itemType,
            $item = null,
            $shareType = null,
            $shareWith = null,
            $uidOwner = null,
    Severity: Major
    Found in lib/private/Share/Share.php - About 1 hr to fix

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

          public function __construct(
              $AppName,
              IRequest $request,
              IConfig $config,
              IClientService $clientService,
      Severity: Major
      Found in settings/Controller/CheckSetupController.php and 3 other locations - About 1 hr to fix
      apps/federation/lib/Controller/OCSAuthAPIController.php on lines 72..88
      apps/files/lib/Controller/ApiController.php on lines 69..84
      core/Controller/AppRegistryController.php on lines 51..66

      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 108.

      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 4 locations. Consider refactoring.
      Open

          public function __construct(
              $appName,
              IRequest $request,
              IAppManager $appManager,
              IRootFolder $rootFolder,
      Severity: Major
      Found in core/Controller/AppRegistryController.php and 3 other locations - About 1 hr to fix
      apps/federation/lib/Controller/OCSAuthAPIController.php on lines 72..88
      apps/files/lib/Controller/ApiController.php on lines 69..84
      settings/Controller/CheckSetupController.php on lines 60..75

      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 108.

      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 4 locations. Consider refactoring.
      Open

          public function __construct(
              $appName,
              IRequest $request,
              IUserSession $userSession,
              TagService $tagService,
      Severity: Major
      Found in apps/files/lib/Controller/ApiController.php and 3 other locations - About 1 hr to fix
      apps/federation/lib/Controller/OCSAuthAPIController.php on lines 72..88
      core/Controller/AppRegistryController.php on lines 51..66
      settings/Controller/CheckSetupController.php on lines 60..75

      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 108.

      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

              try {
                  $message = $this->mailer->createMessage();
                  $message->setTo([$email => $name]);
                  $message->setSubject($this->l10n->t('%s password reset', [$this->defaults->getName()]));
                  $message->setPlainBody($msgAlt);
      Severity: Major
      Found in core/Controller/LostController.php and 1 other location - About 1 hr to fix
      core/Controller/LostController.php on lines 290..302

      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 108.

      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 4 locations. Consider refactoring.
      Open

          public function __construct(
              $appName,
              IRequest $request,
              ISecureRandom $secureRandom,
              IJobList $jobList,
      Severity: Major
      Found in apps/federation/lib/Controller/OCSAuthAPIController.php and 3 other locations - About 1 hr to fix
      apps/files/lib/Controller/ApiController.php on lines 69..84
      core/Controller/AppRegistryController.php on lines 51..66
      settings/Controller/CheckSetupController.php on lines 60..75

      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 108.

      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

              if (!$exists) {
                  \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_create, [
                      Filesystem::signal_param_path => $this->getHookPath($path),
                      Filesystem::signal_param_run => &$run,
                  ]);
      Severity: Major
      Found in lib/private/Files/View.php and 1 other location - About 1 hr to fix
      lib/private/Files/View.php on lines 647..659

      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 108.

      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

              $query->update('share')
                  ->set('uid_owner', $query->createParameter('uid_owner'))
                  ->where(
                      $query->expr()->andX(
                          $query->expr()->eq('id', $query->createParameter('shareid')),
      Severity: Major
      Found in apps/files/lib/Command/TroubleshootTransferOwnership.php and 1 other location - About 1 hr to fix
      apps/files/lib/Command/TroubleshootTransferOwnership.php on lines 401..411

      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 108.

      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

                  try {
                      $message = $this->mailer->createMessage();
                      $message->setTo([$email => $name]);
                      $message->setSubject($this->l10n->t('%s password changed successfully', [$this->defaults->getName()]));
                      $message->setPlainBody($msgAlt);
      Severity: Major
      Found in core/Controller/LostController.php and 1 other location - About 1 hr to fix
      core/Controller/LostController.php on lines 376..388

      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 108.

      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

              $query->update('share')
                  ->set('uid_initiator', $query->createParameter('uid_initiator'))
                  ->where(
                      $query->expr()->andX(
                          $query->expr()->eq('id', $query->createParameter('shareid')),
      Severity: Major
      Found in apps/files/lib/Command/TroubleshootTransferOwnership.php and 1 other location - About 1 hr to fix
      apps/files/lib/Command/TroubleshootTransferOwnership.php on lines 430..440

      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 108.

      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

              if (!$distributedCacheClass::isAvailable()) {
                  if (\OC::$CLI && !\defined('PHPUNIT_RUN')) {
                      // CLI should not hard-fail on broken memcache
                      $this->logger->debug($missingCacheMessage, [
                          'class' => $distributedCacheClass,
      Severity: Major
      Found in lib/private/Memcache/Factory.php and 1 other location - About 1 hr to fix
      lib/private/Memcache/Factory.php on lines 89..103

      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 108.

      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

              } else {
                  \OC_Hook::emit(Filesystem::CLASSNAME, Filesystem::signal_update, [
                      Filesystem::signal_param_path => $this->getHookPath($path),
                      Filesystem::signal_param_run => &$run,
                  ]);
      Severity: Major
      Found in lib/private/Files/View.php and 1 other location - About 1 hr to fix
      lib/private/Files/View.php on lines 635..659

      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 108.

      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

              if (!$localCacheClass::isAvailable()) {
                  if (\OC::$CLI && !\defined('PHPUNIT_RUN')) {
                      // CLI should not hard-fail on broken memcache
                      $this->logger->debug($missingCacheMessage, [
                          'class' => $localCacheClass,
      Severity: Major
      Found in lib/private/Memcache/Factory.php and 1 other location - About 1 hr to fix
      lib/private/Memcache/Factory.php on lines 104..118

      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 108.

      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 render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              render: function() {
                  var self = this;
                  if (this._dialog) {
                      // remove/destroy older instance
                      this._dialog.model.off();
      Severity: Minor
      Found in apps/files_sharing/js/sharetabview.js - About 1 hr to fix

        Function attach has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                attach: function (view) {
                    var that = this;
                    var baseRenderCall = view.render;
        
                    var shareCollectionModel = view.model.getLinkSharesCollection();
        Severity: Minor
        Found in apps/files_sharing/js/sharedialogview.js - About 1 hr to fix

          Function reloadCallback has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  reloadCallback: function(result) {
                      delete this._reloadCall;
                      this.hideMask();
          
                      if (!result || result.status === 'error') {
          Severity: Minor
          Found in apps/files_trashbin/js/filelist.js - About 1 hr to fix

            Function showAddExternalDialog has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                OCA.Sharing.showAddExternalDialog = function (share, passwordProtected, callback) {
                    var remote = share.remote;
                    var owner = share.ownerDisplayName || share.owner;
                    var name = share.name;
                    var remoteClean = (remote.substr(0, 8) === 'https://') ? remote.substr(8) : remote.substr(7);
            Severity: Minor
            Found in apps/files_sharing/js/external.js - About 1 hr to fix

              Function _saveToOwnCloud has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _saveToOwnCloud: function (remote, token, owner, ownerDisplayName, name, isProtected) {
                      var that = this;
              
                      var toggleLoading = function () {
                          var isLoading = !that.$saveToOcButton.find('#save-to-oc-button-loading').hasClass('hidden');
              Severity: Minor
              Found in apps/files_sharing/js/public.js - About 1 hr to fix

                Function actionHandler has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                                actionHandler: function(fileName, context) {
                                    var $actionEl = context.$file.find('.action-favorite');
                                    var $file = context.$file;
                                    var fileInfo = context.fileList.files[$file.index()];
                                    var dir = context.dir || context.fileList.getCurrentDirectory();
                Severity: Minor
                Found in apps/files/js/tagsplugin.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language