owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

OC_Helper has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

class OC_Helper {
    private static $templateManager;

    /**
     * Creates an absolute url for public use
Severity: Minor
Found in lib/private/legacy/helper.php - About 2 hrs to fix

    MigrationService has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class MigrationService {
        /** @var boolean */
        private $migrationTableCreated;
        /** @var array */
        private $migrations;
    Severity: Minor
    Found in lib/private/DB/MigrationService.php - About 2 hrs to fix

      AllConfig has 22 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class AllConfig implements IConfig {
          /** @var SystemConfig */
          private $systemConfig;
      
          /** @var IDBConnection */
      Severity: Minor
      Found in lib/private/AllConfig.php - About 2 hrs to fix

        Manager has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Manager extends PublicEmitter implements IUserManager {
            use EventEmitterTrait;
            /** @var UserInterface[] $backends */
            private $backends = [];
        
        
        Severity: Minor
        Found in lib/private/User/Manager.php - About 2 hrs to fix

          Function filter has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              filter: function(query) {
                  // FIXME: the caller doesn't properly set the "this" context
                  var self = OC.Settings.Apps;
                  self._filterQuery = query;
          
          
          Severity: Major
          Found in settings/js/admin-apps.js - About 2 hrs to fix

            Method create has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function create(\OCP\Share\IShare $share) {
                    $this->validate($share);
                    $qb = $this->dbConn->getQueryBuilder();
            
                    $qb->insert('share');
            Severity: Major
            Found in lib/private/Share20/DefaultShareProvider.php - About 2 hrs to fix

              Method getStorageInfo has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getStorageInfo($path, $rootInfo = null) {
                      // return storage info without adding mount points
                      $includeExtStorage = \OC::$server->getSystemConfig()->getValue('quota_include_external_storage', false);
              
                      if (!$rootInfo) {
              Severity: Major
              Found in lib/private/legacy/helper.php - About 2 hrs to fix

                Method saveColumn has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static function saveColumn($column, $xml) {
                        $xml->addChild('name', $column->getName());
                        switch ($column->getType()) {
                            case 'SmallInt':
                            case 'Integer':
                Severity: Major
                Found in lib/private/DB/MDB2SchemaWriter.php - About 2 hrs to fix

                  Method auth has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function auth(IRequest $request) {
                          if (!isset($request->server['PHP_AUTH_USER'], $request->server['PHP_AUTH_PW'])) {
                              return null;
                          }
                          if ($this->session->exists('app_password')) {
                  Severity: Major
                  Found in lib/private/User/BasicAuthModule.php - About 2 hrs to fix

                    Method configure has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function configure() {
                            parent::configure();
                            $this
                                ->setName('user:setting')
                                ->setDescription('Read and modify user settings.')
                    Severity: Major
                    Found in core/Command/User/Setting.php - About 2 hrs to fix

                      File Notifications.php has 263 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * @author Björn Schießle <bjoern@schiessle.org>
                       * @author Joas Schilling <coding@schilljs.com>
                       * @author Lukas Reschke <lukas@statuscode.ch>
                      Severity: Minor
                      Found in apps/federatedfilesharing/lib/Notifications.php - About 2 hrs to fix

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

                                        for (var i = 0; i < files.length; i++) {
                                            var deleteAction = this.findFileEl(files[i]).children("td.date").children(".action.delete");
                                            deleteAction.removeClass('icon-delete').addClass('icon-loading-small');
                                        }
                        Severity: Major
                        Found in apps/files_trashbin/js/filelist.js and 1 other location - About 2 hrs to fix
                        apps/files_trashbin/js/filelist.js on lines 252..255

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

                        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

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

                                        for (var i = 0; i < files.length; i++) {
                                            var deleteAction = this.findFileEl(files[i]).children("td.date").children(".action.delete");
                                            deleteAction.removeClass('icon-delete').addClass('icon-loading-small');
                                        }
                        Severity: Major
                        Found in apps/files_trashbin/js/filelist.js and 1 other location - About 2 hrs to fix
                        apps/files_trashbin/js/filelist.js on lines 198..201

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

                        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

                            var TEMPLATE_AUTOCOMPLETE_ITEM =
                                '<li class="{{shareTypeClass}}">' +
                                    '<a>' +
                                        '<div class="share-autocomplete-item">' +
                                            '{{#if showAvatar}}' +
                        Severity: Major
                        Found in core/js/sharedialogview.js and 1 other location - About 2 hrs to fix
                        apps/files/js/mainfileinfodetailview.js on lines 12..31

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

                        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

                            var TEMPLATE =
                                '<div class="thumbnailContainer"><a href="#" class="thumbnail action-default"><div class="stretcher"/></a></div>' +
                                '<div class="file-details-container">' +
                                '<div class="fileName">' +
                                    '<h3 title="{{name}}" class="ellipsis">{{name}}</h3>' +
                        Severity: Major
                        Found in apps/files/js/mainfileinfodetailview.js and 1 other location - About 2 hrs to fix
                        core/js/sharedialogview.js on lines 51..70

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

                        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

                                    fileList._getWebdavProperties = function() {
                                        var props = oldGetWebdavProperties.apply(this, arguments);
                                        props.push(OC.Files.Client.PROPERTY_TAGS);
                                        props.push(OC.Files.Client.PROPERTY_FAVORITE);
                                        return props;
                        Severity: Major
                        Found in apps/files/js/tagsplugin.js and 1 other location - About 2 hrs to fix
                        apps/files_sharing/js/share.js on lines 104..109

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

                        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

                                    fileList._getWebdavProperties = function() {
                                        var props = oldGetWebdavProperties.apply(this, arguments);
                                        props.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME);
                                        props.push(OC.Files.Client.PROPERTY_SHARE_TYPES);
                                        return props;
                        Severity: Major
                        Found in apps/files_sharing/js/share.js and 1 other location - About 2 hrs to fix
                        apps/files/js/tagsplugin.js on lines 175..180

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

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

                        var RollingQueue = function (functionList, queueWindow, callback) {
                            this.queueWindow = queueWindow || 1;
                            this.functionList = functionList;
                            this.callback = callback;
                            this.counter = 0;
                        Severity: Major
                        Found in apps/files_external/js/rollingqueue.js - About 2 hrs to fix

                          Method translateLong has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function translateLong($text, IL10N $l, array $params) {
                                  switch ($text) {
                                      case self::SUBJECT_REMOTE_SHARE_RECEIVED:
                                          if (\sizeof($params) > 1) {
                                              // New activity ownCloud 8.2+
                          Severity: Major
                          Found in apps/files_sharing/lib/Activity.php - About 2 hrs to fix

                            Method updateShareState has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function updateShareState($id, $state) {
                                    $eventName = '';
                                    if ($state === Share::STATE_ACCEPTED) {
                                        $eventName = 'accept';
                                    } elseif ($state === Share::STATE_REJECTED) {
                            Severity: Major
                            Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language