owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

        _onClickCollapsedComment: function(ev) {
            var $row = $(ev.target);
            if (!$row.is('.comment')) {
                $row = $row.closest('.comment');
            }
Severity: Major
Found in apps/comments/js/activitytabviewplugin.js and 1 other location - About 1 hr to fix
apps/comments/js/commentstabview.js on lines 311..317

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

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

OC.L10N.register(
    "files_versions",
    {
    "Versions" : "Versionen",
    "File {file} has been reverted and marked as new current version" : "Die Datei {file} wurde in einer älteren Fassung als aktuelle Version markiert.",
Severity: Major
Found in apps/files_versions/l10n/de_DE.js and 4 other locations - About 1 hr to fix
apps/files_versions/l10n/bg_BG.js on lines 1..14
apps/files_versions/l10n/de.js on lines 1..14
apps/files_versions/l10n/en_GB.js on lines 1..14
apps/files_versions/l10n/tr.js on lines 1..14

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

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

OC.L10N.register(
    "files_versions",
    {
    "Versions" : "Versionen",
    "File {file} has been reverted and marked as new current version" : "Die Datei {file} wurde in eine älteren Fassung umgewandelt und als aktuelle Version markiert.",
Severity: Major
Found in apps/files_versions/l10n/de.js and 4 other locations - About 1 hr to fix
apps/files_versions/l10n/bg_BG.js on lines 1..14
apps/files_versions/l10n/de_DE.js on lines 1..14
apps/files_versions/l10n/en_GB.js on lines 1..14
apps/files_versions/l10n/tr.js on lines 1..14

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

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 (files.length === 0) {
                // single one selected without checkbox?
                files = _.map(ui.helper.find('tr'), function(el) {
                    return self.elementToFile($(el));
                });
Severity: Major
Found in apps/files/js/filelist.js and 1 other location - About 1 hr to fix
apps/files/js/files.js on lines 473..478

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

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 (files.length === 0) {
            // single one selected without checkbox?
            files = _.map(ui.helper.find('tr'), function(el) {
                return FileList.elementToFile($(el));
            });
Severity: Major
Found in apps/files/js/files.js and 1 other location - About 1 hr to fix
apps/files/js/filelist.js on lines 895..900

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

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

        icon.each(function () {
            var thisElement = $(this);
            if (thisElement.data('oldImage') === undefined) {
                thisElement.data('oldImage', thisElement.css('background-image'));
            }
Severity: Major
Found in apps/files_external/js/statusmanager.js and 1 other location - About 1 hr to fix
apps/files_external/js/statusmanager.js on lines 488..493

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

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

        trFolder.each(function () {
            var thisElement = $(this);
            if (thisElement.data('oldbgcolor') === undefined) {
                thisElement.data('oldbgcolor', thisElement.css('background-color'));
            }
Severity: Major
Found in apps/files_external/js/statusmanager.js and 1 other location - About 1 hr to fix
apps/files_external/js/statusmanager.js on lines 496..501

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

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

        displayStorageWarnings: function() {
            if (!OC.Notification.isHidden()) {
                return;
            }

Severity: Minor
Found in apps/files/js/files.js - About 1 hr to fix

    Function launchNext has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        this.launchNext = function() {
            var currentCounter = this.counter++;
            if (currentCounter in this.functionList) {
                var funcData = this.functionList[currentCounter];
                if ($.isFunction(funcData.funcName)) {
    Severity: Minor
    Found in apps/files_external/js/rollingqueue.js - About 1 hr to fix

      Function ensureFolderExists has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ensureFolderExists: function(fullPath) {
              if (!fullPath || fullPath === '/') {
                  return $.Deferred().resolve().promise();
              }
      
      
      Severity: Minor
      Found in apps/files/js/file-upload.js - About 1 hr to fix

        Function _onSelectTag has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _onSelectTag: function(e) {
                    var self = this;
                    var tag;
                    if (e.object && e.object.isNew) {
                        // newly created tag, check if existing
        Severity: Minor
        Found in core/js/systemtags/systemtagsinputfield.js - About 1 hr to fix

          Function getModelForFile has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  getModelForFile: function(fileName) {
                      var self = this;
                      var $tr;
                      // jQuery object ?
                      if (fileName.is) {
          Severity: Minor
          Found in apps/files/js/filelist.js - About 1 hr to fix

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

                    initialize: function(options) {
                        var view = this;
            
                        this.model.on('fetchError', function() {
                            OC.Notification.showTemporary(t('core', 'Share details could not be loaded for this item.'));
            Severity: Minor
            Found in core/js/sharedialogview.js - About 1 hr to fix

              Function share has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, expirationDate, callback, errorCallback) {
                      // Add a fallback for old share() calls without expirationDate.
                      // We should remove this in a later version,
                      // after the Apps have been updated.
                      if (typeof callback === 'undefined' &&
              Severity: Minor
              Found in core/js/share.js - About 1 hr to fix

                Function _afterRender has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _afterRender: function () {
                            var _this = this;
                
                            this.$el.find('.emailPrivateLinkForm--emailField').select2({
                                containerCssClass: 'emailPrivateLinkForm--dropDown',
                Severity: Minor
                Found in core/js/sharedialogmailview.js - About 1 hr to fix

                  Function search has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              this.search = function(query, inApps, page, size) {
                                  if (query) {
                                      OC.addStyle('core/search','results');
                                      if (typeof page !== 'number') {
                                          page = 1;
                  Severity: Minor
                  Found in core/search/js/search.js - About 1 hr to fix

                    Method run has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function run($argument) {
                            $target = $argument['url'];
                            $source = $this->urlGenerator->getAbsoluteURL('/');
                            $source = \rtrim($source, '/');
                            $token = $argument['token'];
                    Severity: Minor
                    Found in apps/federation/lib/BackgroundJob/RequestSharedSecret.php - About 1 hr to fix

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

                          public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset) {
                              $qb = $this->dbConnection->getQueryBuilder();
                              $qb->select('*')
                                  ->from($this->shareTable);
                      
                      
                      Severity: Minor
                      Found in apps/federatedfilesharing/lib/FederatedShareProvider.php - About 1 hr to fix

                        Method sql has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function sql(IDBConnection $connection) {
                                $qb = $connection->getQueryBuilder();
                                $qb->select('*')
                                    ->from('properties', 'props')
                                    ->setMaxResults(1);
                        Severity: Minor
                        Found in apps/dav/appinfo/Migrations/Version20170202213905.php - About 1 hr to fix

                          Method getAddressBooksForUser has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getAddressBooksForUser($principalUri) {
                                  $addressBooks = $this->getUsersOwnAddressBooks($principalUri);
                          
                                  // query for shared calendars
                                  $principals = $this->principalBackend->getGroupMembership($principalUri, true);
                          Severity: Minor
                          Found in apps/dav/lib/CardDAV/CardDavBackend.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language