owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

        template: function(data) {
            if (!OCA.Files.FileActionsMenu._TEMPLATE) {
                OCA.Files.FileActionsMenu._TEMPLATE = Handlebars.compile(TEMPLATE_MENU);
            }
            return OCA.Files.FileActionsMenu._TEMPLATE(data);
Severity: Major
Found in apps/files/js/fileactionsmenu.js and 2 other locations - About 2 hrs to fix
apps/files/js/fileactionsapplicationselectmenu.js on lines 53..58
apps/files/js/newfilemenu.js on lines 83..88

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

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

        template: function(data) {
            if (!OCA.Files.FileActionsApplicationSelectMenu._TEMPLATE) {
                OCA.Files.FileActionsApplicationSelectMenu._TEMPLATE = Handlebars.compile(TEMPLATE_MENU);
            }
            return OCA.Files.FileActionsApplicationSelectMenu._TEMPLATE(data);
Severity: Major
Found in apps/files/js/fileactionsapplicationselectmenu.js and 2 other locations - About 2 hrs to fix
apps/files/js/fileactionsmenu.js on lines 51..56
apps/files/js/newfilemenu.js on lines 83..88

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

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

        template: function(data) {
            if (!OCA.Files.NewFileMenu._TEMPLATE) {
                OCA.Files.NewFileMenu._TEMPLATE = Handlebars.compile(TEMPLATE_MENU);
            }
            return OCA.Files.NewFileMenu._TEMPLATE(data);
Severity: Major
Found in apps/files/js/newfilemenu.js and 2 other locations - About 2 hrs to fix
apps/files/js/fileactionsapplicationselectmenu.js on lines 53..58
apps/files/js/fileactionsmenu.js on lines 51..56

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

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

        apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
            return app.id.toLowerCase().indexOf(query) !== -1;
        }));
Severity: Major
Found in settings/js/admin-apps.js and 1 other location - About 2 hrs to fix
settings/js/admin-apps.js on lines 526..528

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

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

        apps = apps.concat(_.filter(OC.Settings.Apps.State.apps, function (app) {
            return app.description.toLowerCase().indexOf(query) !== -1;
        }));
Severity: Major
Found in settings/js/admin-apps.js and 1 other location - About 2 hrs to fix
settings/js/admin-apps.js on lines 521..523

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

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

Method wrap has 17 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $source,
        $internalPath,
        $fullPath,
        array $header,
        $uid,
Severity: Major
Found in lib/private/Files/Stream/Encryption.php - About 2 hrs to fix

    File et_EE.js has 255 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    OC.L10N.register(
        "settings",
        {
        "Wrong current password" : "Vale praegune parool",
        "No user supplied" : "Kasutajat ei sisestatud",
    Severity: Minor
    Found in settings/l10n/et_EE.js - About 2 hrs to fix

      Function display has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              display: function (parent, triggerEvent, fileList) {
                  if (!fileList) {
                      console.warn('FileActions.display() MUST be called with a OCA.Files.FileList instance');
                      return;
                  }
      Severity: Major
      Found in apps/files/js/fileactions.js - About 2 hrs to fix

        Function _extendFileList has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _extendFileList: function(fileList) {
                    // extend row prototype
                    fileList.$el.addClass('has-favorites');
                    var oldCreateRow = fileList._createRow;
                    fileList._createRow = function(fileData) {
        Severity: Major
        Found in apps/files/js/tagsplugin.js - About 2 hrs to fix

          Function render has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  render: function() {
                      var self = this;
          
                      // render shares list in a container
                      this.$el.html(this.template({
          Severity: Major
          Found in core/js/sharedialogshareelistview.js - About 2 hrs to fix

            Function addConflict has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    var addConflict = function($conflicts, original, replacement) {
            
                        var $conflict = $conflicts.find('.template').clone().removeClass('template').addClass('conflict');
                        var $originalDiv = $conflict.find('.original');
                        var $replacementDiv = $conflict.find('.replacement');
            Severity: Major
            Found in core/js/oc-dialogs.js - About 2 hrs to fix

              Method getAssignableAndRemovableGroups has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getAssignableAndRemovableGroups() {
                      $assignableGroups = [];
                      $removableGroups = [];
              
                      $currentUser = $this->userSession->getUser();
              Severity: Major
              Found in settings/Controller/GroupsController.php - About 2 hrs to fix

                Method getTrashFiles has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getTrashFiles($dir, $user, $sortAttribute = '', $sortDescending = false, $addExtraData = true) {
                        $result = [];
                        $timestamp = null;
                
                        $view = new \OC\Files\View('/' . $user . '/files_trashbin/files');
                Severity: Major
                Found in apps/files_trashbin/lib/Helper.php - About 2 hrs to fix

                  Method restore has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function restore($filename, $targetLocation = null) {
                          $user = User::getUser();
                          $view = new View('/' . $user);
                          $nameOfFile = \basename($filename);
                          $dirOfFile = \dirname($filename);
                  Severity: Major
                  Found in apps/files_trashbin/lib/Trashbin.php - About 2 hrs to fix

                    Method changeSchema has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function changeSchema(Schema $schema, array $options) {
                            $prefix = $options['tablePrefix'];
                            if (!$schema->hasTable("{$prefix}files_trash")) {
                                $table = $schema->createTable("{$prefix}files_trash");
                                $table->addColumn('auto_id', 'bigint', [
                    Severity: Major
                    Found in apps/files_trashbin/appinfo/Migrations/Version20170804201125.php - About 2 hrs to fix

                      Method buildPolicy has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function buildPolicy() {
                              $policy = "default-src 'none';manifest-src 'self';";
                      
                              if (!empty($this->allowedScriptDomains) || $this->inlineScriptAllowed || $this->evalScriptAllowed) {
                                  $policy .= 'script-src ';
                      Severity: Major
                      Found in lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php - About 2 hrs to fix

                        Method triggerChangeHooks has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function triggerChangeHooks(IStorageConfig $oldStorage, IStorageConfig $newStorage) {
                                // if mount point changed, it's like a deletion + creation
                                if ($oldStorage->getMountPoint() !== $newStorage->getMountPoint()) {
                                    $this->triggerHooks($oldStorage, Filesystem::signal_delete_mount);
                                    $this->triggerHooks($newStorage, Filesystem::signal_create_mount);
                        Severity: Major
                        Found in lib/private/Files/External/Service/GlobalStoragesService.php - About 2 hrs to fix

                          Method main has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function main($controllerName, $methodName, DIContainer $container, array $urlParams = null) {
                                  if ($urlParams !== null) {
                                      $container['OCP\\IRequest']->setUrlParameters($urlParams);
                                  } elseif (isset($container['urlParams']) && $container['urlParams'] !== null) {
                                      $container['OCP\\IRequest']->setUrlParameters($container['urlParams']);
                          Severity: Major
                          Found in lib/private/AppFramework/App.php - About 2 hrs to fix

                            Method loadApps has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function loadApps($types = null) {
                                    if (\is_array($types) && !\array_diff($types, self::$loadedTypes)) {
                                        return true;
                                    }
                                    if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) {
                            Severity: Major
                            Found in lib/private/legacy/app.php - About 2 hrs to fix

                              File MigrationService.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * @author Thomas Müller <thomas.mueller@tmit.eu>
                               * @author Vincent Petry <pvince81@owncloud.com>
                               *
                              Severity: Minor
                              Found in lib/private/DB/MigrationService.php - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language