owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

prototype has 23 functions (exceeds 20 allowed). Consider refactoring.
Open

OC.Uploader.prototype = _.extend({
    /**
     * @type Array<OC.FileUpload>
     */
    _uploads: {},
Severity: Minor
Found in apps/files/js/file-upload.js - About 2 hrs to fix

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

    class Manager {
        public const STORAGE = '\OCA\Files_Sharing\External\Storage';
    
        /**
         * @var string
    Severity: Minor
    Found in apps/files_sharing/lib/External/Manager.php - About 2 hrs to fix

      Node has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class Node implements \Sabre\DAV\INode {
          /**
           * @var \OC\Files\View
           */
          protected $fileView;
      Severity: Minor
      Found in apps/dav/lib/Connector/Sabre/Node.php - About 2 hrs to fix

        OC has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class OC {
            /**
             * Associative array for autoloading. classname => filename
             */
            public static $CLASSPATH = [];
        Severity: Minor
        Found in lib/kernel.php - About 2 hrs to fix

          FailedCache has 23 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class FailedCache implements ICache {
              /** @var bool whether to show the failed storage in the ui */
              private $visible;
          
              /**
          Severity: Minor
          Found in lib/private/Files/Cache/FailedCache.php - About 2 hrs to fix

            StoragesService has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            abstract class StoragesService implements IStoragesService {
                /** @var IStoragesBackendService */
                protected $backendService;
            
                /**
            Severity: Minor
            Found in lib/private/Files/External/Service/StoragesService.php - About 2 hrs to fix

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

                          td.append($('<span></span>').attr({
                              "class": "modified",
                              "title": formatted,
                              "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')'
                          }).text(text)
              Severity: Major
              Found in apps/files/js/filelist.js and 1 other location - About 2 hrs to fix
              apps/files_sharing/js/sharedfilelist.js on lines 126..132

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

              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

                              td.append($('<span></span>').attr({
                                      "class": "modified",
                                      "title": formatted,
                                      "style": 'color:rgb(' + modifiedColor + ',' + modifiedColor + ',' + modifiedColor + ')'
                                  }).text(text)
              Severity: Major
              Found in apps/files_sharing/js/sharedfilelist.js and 1 other location - About 2 hrs to fix
              apps/files/js/filelist.js on lines 1309..1315

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

              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

                                  self.addAndFetchFileInfo(targetPath, '', {scrollTo:true}).then(function(status, data) {
                                      deferred.resolve(status, data);
                                  }, function() {
                                      OC.Notification.show(t('files', 'Could not create folder "{dir}"',
                                          {dir: name}), {type: 'error'}
              Severity: Major
              Found in apps/files/js/filelist.js and 1 other location - About 2 hrs to fix
              apps/files/js/filelist.js on lines 2537..2543

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

              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

                                  self.addAndFetchFileInfo(targetPath, '', {scrollTo: true}).then(function(status, data) {
                                      deferred.resolve(status, data);
                                  }, function() {
                                      OC.Notification.show(t('files', 'Could not create file "{file}"',
                                          {file: name}), {type: 'error'}
              Severity: Major
              Found in apps/files/js/filelist.js and 1 other location - About 2 hrs to fix
              apps/files/js/filelist.js on lines 2587..2593

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

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

                  _registerPendingShareActions: function(fileActions) {
                      var self = this;
              
                      // register pending share actions
                      fileActions.registerAction({
              Severity: Major
              Found in apps/files_sharing/js/app.js - About 2 hrs to fix

                Function initialize has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    initialize: function($el) {
                        OC.Plugins.register('OCA.Search', OC.Settings.Apps.Search);
                        OC.Settings.Apps.loadCategories();
                        OC.Util.History.addOnPopStateHandler(_.bind(this._onPopState, this));
                
                
                Severity: Major
                Found in settings/js/admin-apps.js - About 2 hrs to fix

                  Function _onSubmitComment has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          _onSubmitComment: function(e) {
                              var self = this;
                              var $form = $(e.target);
                              var commentId = $form.closest('.comment').data('id');
                              var currentUser = OC.getCurrentUser();
                  Severity: Major
                  Found in apps/comments/js/commentstabview.js - About 2 hrs to fix

                    Function _setOption has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _setOption: function(key, value) {
                                var self = this;
                                switch (key) {
                                    case 'title':
                                        if (this.$title) {
                    Severity: Major
                    Found in core/js/jquery.ocdialog.js - About 2 hrs to fix

                      Function showPassword has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                               showPassword: function(c) {    
                                  
                                  // Setup callback object
                                  var callback     = {'fn':null,'args':{}}
                                      callback.fn = c;
                      Severity: Major
                      Found in core/js/jquery-showpassword.js - About 2 hrs to fix

                        Method index has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function index($offset = 0, $limit = 10, $gid = '', $pattern = '', $backend = '') {
                                // FIXME: The JS sends the group '_everyone' instead of no GID for the "all users" group.
                                if ($gid === '_everyone') {
                                    $gid = '';
                                }
                        Severity: Major
                        Found in settings/Controller/UsersController.php - About 2 hrs to fix

                          Method retainVersions has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private static function retainVersions($filename, $owner, $ownerPath, $timestamp, $sourceStorage = null, $forceCopy = false) {
                                  if (\OCP\App::isEnabled('files_versions') && !empty($ownerPath)) {
                                      $copyKeysResult = false;
                          
                                      // Temporary
                          Severity: Major
                          Found in apps/files_trashbin/lib/Trashbin.php - About 2 hrs to fix

                            Method getLocalMethods has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function getLocalMethods() {
                                    return [
                                        'OC_L10N::get' => '8.2.0',
                            
                                        'OCP\Activity\IManager::publishActivity' => '8.2.0',
                            Severity: Major
                            Found in lib/private/App/CodeChecker/DeprecationCheck.php - About 2 hrs to fix

                              Function showCredentialsDialog has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  showCredentialsDialog: function (mountPoint, mountData) {
                                      var template = Handlebars.compile(OCA.External.StatusManager.credentialsDialogTemplate);
                                      var dialog = $(template({
                                          credentials_text: t('files_external', 'Please enter the credentials for the {mount} mount', {
                                              'mount': mountPoint
                              Severity: Major
                              Found in apps/files_external/js/statusmanager.js - About 2 hrs to fix

                                Method createCalendarObjectsTable has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function createCalendarObjectsTable(Schema $schema) {
                                        if (!$schema->hasTable("{$this->prefix}calendarobjects")) {
                                            $table = $schema->createTable("{$this->prefix}calendarobjects");
                                            $table->addColumn('id', 'integer', [
                                                'notnull' => true,
                                Severity: Major
                                Found in apps/dav/appinfo/Migrations/Version20170116150538.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language