owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method createMailBody has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function createMailBody(
        $filename,
        $link,
        $expiration,
        $senderDisplayName,
Severity: Minor
Found in lib/private/Share/MailNotifications.php - About 1 hr to fix

    Method getSharesBy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset) {
            $qb = $this->dbConn->getQueryBuilder();
            $qb->select('*')
                ->from('share')
                ->andWhere($qb->expr()->orX(
    Severity: Minor
    Found in lib/private/Share20/DefaultShareProvider.php - About 1 hr to fix

      Method getDescription has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getDescription($errorCode, $errorObject) {
              switch ($errorCode) {
                  case CodeChecker::STATIC_CALL_NOT_ALLOWED:
                      $functions = $this->getLocalFunctions();
                      $functions = \array_change_key_case($functions, CASE_LOWER);
      Severity: Minor
      Found in lib/private/App/CodeChecker/AbstractCheck.php - About 1 hr to fix

        Method buildNotExistingFileNameForView has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function buildNotExistingFileNameForView($path, $filename, \OC\Files\View $view) {
                if ($path === '/') {
                    $path = '';
                }
                if ($pos = \strrpos($filename, '.')) {
        Severity: Minor
        Found in lib/private/legacy/helper.php - About 1 hr to fix

          Method isAuthorised has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private static function isAuthorised($action) {
                  $level = $action['authlevel'];
                  switch ($level) {
                      case API::GUEST_AUTH:
                          // Anyone can access
          Severity: Minor
          Found in lib/private/legacy/api.php - About 1 hr to fix

            Method getDefaultPageUrl has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getDefaultPageUrl() {
                    $urlGenerator = \OC::$server->getURLGenerator();
                    // Deny the redirect if the URL contains a @
                    // This prevents unvalidated redirects like ?redirect_url=:user@domain.com
                    if (isset($_REQUEST['redirect_url']) && \strpos($_REQUEST['redirect_url'], '@') === false) {
            Severity: Minor
            Found in lib/private/legacy/util.php - About 1 hr to fix

              Method analyzeStream has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function analyzeStream($stream, array $processors = [], int $maxBytes = PHP_INT_MAX) {
                      $byteCount = 0;
                      $map = [];
                      $processorActions = [
                          'count' => 'processCountChars',
              Severity: Minor
              Found in lib/private/Utf8Analyzer.php - About 1 hr to fix

                Method acquireLock has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function acquireLock($path, $type) {
                        if (\strlen($path) > 64) { // max length in file_locks
                            throw new \InvalidArgumentException("Lock key length too long");
                        }
                        $expire = $this->getExpireTime();
                Severity: Minor
                Found in lib/private/Lock/DBLockingProvider.php - About 1 hr to fix

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

                          getShareWith: function(shareIndex) {
                              /** @type OC.Share.Types.ShareInfo **/
                              var share = this.get('shares')[shareIndex];
                              if(!_.isObject(share)) {
                                  throw "Unknown Share";
                  Severity: Major
                  Found in core/js/shareitemmodel.js and 2 other locations - About 1 hr to fix
                  core/js/shareitemmodel.js on lines 455..462
                  core/js/shareitemmodel.js on lines 468..475

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

                  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(user.lastLogin !== 0) {
                              lastLoginRel = OC.Util.relativeModifiedDate(user.lastLogin);
                              lastLoginAbs = OC.Util.formatDate(user.lastLogin);
                          }
                  Severity: Major
                  Found in settings/js/users/users.js and 1 other location - About 1 hr to fix
                  settings/js/users/users.js on lines 193..196

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

                  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

                              $.get(OC.filePath('core', 'templates', 'message.html'), function(tmpl) {
                                  self.$messageTemplate = $(tmpl);
                                  defer.resolve(self.$messageTemplate);
                              })
                              .fail(function(jqXHR, textStatus, errorThrown) {
                  Severity: Major
                  Found in core/js/oc-dialogs.js and 1 other location - About 1 hr to fix
                  core/js/oc-dialogs.js on lines 730..736

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

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

                          getShareWithDisplayName: function(shareIndex) {
                              /** @type OC.Share.Types.ShareInfo **/
                              var share = this.get('shares')[shareIndex];
                              if(!_.isObject(share)) {
                                  throw "Unknown Share";
                  Severity: Major
                  Found in core/js/shareitemmodel.js and 2 other locations - About 1 hr to fix
                  core/js/shareitemmodel.js on lines 442..449
                  core/js/shareitemmodel.js on lines 468..475

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

                  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 (t('settings', 'Official').toLowerCase().indexOf(query) !== -1) {
                              apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
                                  return app.level === 200;
                              }));
                          }
                  Severity: Major
                  Found in settings/js/admin-apps.js and 1 other location - About 1 hr to fix
                  settings/js/admin-apps.js on lines 544..548

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

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

                          getShareWithAdditionalInfo: function(shareIndex) {
                              /** @type OC.Share.Types.ShareInfo **/
                              var share = this.get('shares')[shareIndex];
                              if(!_.isObject(share)) {
                                  throw "Unknown Share";
                  Severity: Major
                  Found in core/js/shareitemmodel.js and 2 other locations - About 1 hr to fix
                  core/js/shareitemmodel.js on lines 442..449
                  core/js/shareitemmodel.js on lines 455..462

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

                  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(user.creationTime !== 0) {
                                          creationTimeRel = OC.Util.relativeModifiedDate(user.creationTime);
                                          creationTimeAbs = OC.Util.formatDate(user.creationTime);
                                  }
                  Severity: Major
                  Found in settings/js/users/users.js and 1 other location - About 1 hr to fix
                  settings/js/users/users.js on lines 178..181

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

                  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 (t('settings', 'Approved').toLowerCase().indexOf(query) !== -1) {
                              apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
                                  return app.level === 100;
                              }));
                          }
                  Severity: Major
                  Found in settings/js/admin-apps.js and 1 other location - About 1 hr to fix
                  settings/js/admin-apps.js on lines 539..543

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

                  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

                              $.get(OC.filePath('files', 'templates', 'fileexists.html'), function (tmpl) {
                                  self.$fileexistsTemplate = $(tmpl);
                                  defer.resolve(self.$fileexistsTemplate);
                              })
                              .fail(function () {
                  Severity: Major
                  Found in core/js/oc-dialogs.js and 1 other location - About 1 hr to fix
                  core/js/oc-dialogs.js on lines 714..720

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

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

                          fetchNext: function(options) {
                              var self = this;
                              if (!this.hasMoreResults()) {
                                  return null;
                              }
                  Severity: Minor
                  Found in apps/comments/js/commentcollection.js - About 1 hr to fix

                    Function success has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                success: function (apps) {
                                    var appListWithIndex = _.indexBy(apps.apps, 'id');
                                    OC.Settings.Apps.State.apps = appListWithIndex;
                                    var appList = _.map(appListWithIndex, function(app) {
                                        // default values for missing fields
                    Severity: Minor
                    Found in settings/js/admin-apps.js - About 1 hr to fix

                      Function translate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          translate: function(app, text, vars, count, options) {
                              var defaultOptions = {
                                      escape: true
                                  },
                                  allOptions = options || {};
                      Severity: Minor
                      Found in core/js/l10n.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language