owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

    public function setSubject($subject, array $parameters = []) {
        if (!\is_string($subject) || $subject === '' || isset($subject[64])) {
            throw new \InvalidArgumentException('The given subject is invalid');
        }
        $this->subject = $subject;
Severity: Major
Found in lib/private/Notification/Notification.php and 1 other location - About 1 hr to fix
lib/private/Notification/Notification.php on lines 269..280

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

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

    public function setMessage($message, array $parameters = []) {
        if (!\is_string($message) || $message === '' || isset($message[64])) {
            throw new \InvalidArgumentException('The given message is invalid');
        }
        $this->message = $message;
Severity: Major
Found in lib/private/Notification/Notification.php and 1 other location - About 1 hr to fix
lib/private/Notification/Notification.php on lines 211..222

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

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

        template: function (data) {
            if (!this._template) {
                this._template = Handlebars.compile(TEMPLATE);
            }
            return this._template(data);
Severity: Major
Found in core/js/sharedialoglinkshareview.js and 7 other locations - About 1 hr to fix
apps/files_sharing/js/PublicUploadView.js on lines 124..129
apps/files_sharing/js/PublicUploadView.js on lines 135..140
core/js/sharedialoglinkexpirationview.js on lines 166..171
core/js/sharedialoglinklistview.js on lines 297..302
core/js/sharedialoglinksocialview.js on lines 99..104
core/js/sharedialogmailview.js on lines 251..256
core/js/sharedialogshareelistview.js on lines 364..369

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

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

        template: function (data) {
            if (!this._template) {
                this._template = Handlebars.compile(TEMPLATE);
            }
            return this._template(data);
Severity: Major
Found in core/js/sharedialogshareelistview.js and 7 other locations - About 1 hr to fix
apps/files_sharing/js/PublicUploadView.js on lines 124..129
apps/files_sharing/js/PublicUploadView.js on lines 135..140
core/js/sharedialoglinkexpirationview.js on lines 166..171
core/js/sharedialoglinklistview.js on lines 297..302
core/js/sharedialoglinkshareview.js on lines 374..379
core/js/sharedialoglinksocialview.js on lines 99..104
core/js/sharedialogmailview.js on lines 251..256

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

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

        template: function (data) {
            if (!this._template) {
                this._template = Handlebars.compile(TEMPLATE);
            }
            return this._template(data);
Severity: Major
Found in core/js/sharedialoglinklistview.js and 7 other locations - About 1 hr to fix
apps/files_sharing/js/PublicUploadView.js on lines 124..129
apps/files_sharing/js/PublicUploadView.js on lines 135..140
core/js/sharedialoglinkexpirationview.js on lines 166..171
core/js/sharedialoglinkshareview.js on lines 374..379
core/js/sharedialoglinksocialview.js on lines 99..104
core/js/sharedialogmailview.js on lines 251..256
core/js/sharedialogshareelistview.js on lines 364..369

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

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

        template: function(data) {
            if (!this._template) {
                this._template = Handlebars.compile(TEMPLATE);
            }
            return this._template(data);
Severity: Major
Found in core/js/sharedialoglinksocialview.js and 7 other locations - About 1 hr to fix
apps/files_sharing/js/PublicUploadView.js on lines 124..129
apps/files_sharing/js/PublicUploadView.js on lines 135..140
core/js/sharedialoglinkexpirationview.js on lines 166..171
core/js/sharedialoglinklistview.js on lines 297..302
core/js/sharedialoglinkshareview.js on lines 374..379
core/js/sharedialogmailview.js on lines 251..256
core/js/sharedialogshareelistview.js on lines 364..369

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

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

        template: function (data) {
            if (!this._template) {
                this._template = Handlebars.compile(TEMPLATE);
            }
            return this._template(data);
Severity: Major
Found in apps/files_sharing/js/PublicUploadView.js and 7 other locations - About 1 hr to fix
apps/files_sharing/js/PublicUploadView.js on lines 135..140
core/js/sharedialoglinkexpirationview.js on lines 166..171
core/js/sharedialoglinklistview.js on lines 297..302
core/js/sharedialoglinkshareview.js on lines 374..379
core/js/sharedialoglinksocialview.js on lines 99..104
core/js/sharedialogmailview.js on lines 251..256
core/js/sharedialogshareelistview.js on lines 364..369

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

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

        template: function (data) {
            if (!this._template) {
                this._template = Handlebars.compile(TEMPLATE);
            }
            return this._template(data);
Severity: Major
Found in core/js/sharedialoglinkexpirationview.js and 7 other locations - About 1 hr to fix
apps/files_sharing/js/PublicUploadView.js on lines 124..129
apps/files_sharing/js/PublicUploadView.js on lines 135..140
core/js/sharedialoglinklistview.js on lines 297..302
core/js/sharedialoglinkshareview.js on lines 374..379
core/js/sharedialoglinksocialview.js on lines 99..104
core/js/sharedialogmailview.js on lines 251..256
core/js/sharedialogshareelistview.js on lines 364..369

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

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

        template: function(data) {
            if (!this._template) {
                this._template = Handlebars.compile(TEMPLATE);
            }
            return this._template(data);
Severity: Major
Found in core/js/sharedialogmailview.js and 7 other locations - About 1 hr to fix
apps/files_sharing/js/PublicUploadView.js on lines 124..129
apps/files_sharing/js/PublicUploadView.js on lines 135..140
core/js/sharedialoglinkexpirationview.js on lines 166..171
core/js/sharedialoglinklistview.js on lines 297..302
core/js/sharedialoglinkshareview.js on lines 374..379
core/js/sharedialoglinksocialview.js on lines 99..104
core/js/sharedialogshareelistview.js on lines 364..369

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

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

        itemTemplate: function (data) {
            if (!this._itemTemplate) {
                this._itemTemplate = Handlebars.compile(ITEM_TEMPLATE);
            }
            return this._itemTemplate(data);
Severity: Major
Found in apps/files_sharing/js/PublicUploadView.js and 7 other locations - About 1 hr to fix
apps/files_sharing/js/PublicUploadView.js on lines 124..129
core/js/sharedialoglinkexpirationview.js on lines 166..171
core/js/sharedialoglinklistview.js on lines 297..302
core/js/sharedialoglinkshareview.js on lines 374..379
core/js/sharedialoglinksocialview.js on lines 99..104
core/js/sharedialogmailview.js on lines 251..256
core/js/sharedialogshareelistview.js on lines 364..369

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

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

            reload: function () {
                if (!this._systemTagIds.length) {
                    // don't reload
                    this.updateEmptyContent();
                    this.setFiles([]);
Severity: Minor
Found in apps/systemtags/js/systemtagsfilelist.js - About 1 hr to fix

    Function apply has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            var apply = function () {
                var username = dialog.find('[name=username]').val();
                var password = dialog.find('[name=password]').val();
                var endpoint = OC.generateUrl('apps/files_external/userglobalstorages/{id}', {
                    id: mountData.id
    Severity: Minor
    Found in apps/files_external/js/statusmanager.js - About 1 hr to fix

      Function registerAction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              registerAction: function (action) {
                  var mime = action.mime;
                  var name = action.name;
                  var actionSpec = {
                      action: action.actionHandler,
      Severity: Minor
      Found in apps/files/js/fileactions.js - About 1 hr to fix

        Function highlightFiles has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                highlightFiles: function(files, highlightFunction) {
                    // Detection of the uploaded element
                    var filename = files[files.length - 1];
                    var $fileRow = this.findFileEl(filename);
        
        
        Severity: Minor
        Found in apps/files/js/filelist.js - About 1 hr to fix

          Function _onClickDownloadSelected has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _onClickDownloadSelected: function(event) {
                      var files;
                      var dir = this.getCurrentDirectory();
                      if (this.isAllSelected() && this.getSelectedFiles().length > 1) {
                          files = OC.basename(dir);
          Severity: Minor
          Found in apps/files/js/filelist.js - About 1 hr to fix

            Function getTypeForMethod has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function getTypeForMethod(method, model) {
                    var type = methodMap[method];
            
                    if (!type) {
                        // return method directly
            Severity: Minor
            Found in core/js/oc-backbone-webdav.js - About 1 hr to fix

              Function jqxhr has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          var jqxhr = $.get(OC.filePath(props.appid, '', props.scriptName), function (data) {
                              popup.html(data).ready(function () {
                                  popup.prepend('<span class="arrow ' + arrowclass + '"></span><h2>' + t('core', 'Settings') + '</h2><a class="close"></a>').show();
                                  popup.find('.close').bind('click', function () {
                                      popup.remove();
              Severity: Minor
              Found in core/js/js.js - About 1 hr to fix

                Function _show has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _show: function (container, dir, leafname, leaflink) {
                        var self = this;
                
                        this._clear(container);
                
                
                Severity: Minor
                Found in core/js/js.js - About 1 hr to fix

                  Function generateUrl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      generateUrl: function (url, params, options) {
                          var defaultOptions = {
                                  escape: true
                              },
                              allOptions = options || {};
                  Severity: Minor
                  Found in core/js/js.js - About 1 hr to fix

                    Method execute has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function execute(InputInterface $input, OutputInterface $output): int {
                            $remoteStorages = $this->getRemoteStorages();
                    
                            $output->writeln(\count($remoteStorages) . " remote storage(s) need(s) to be checked");
                    
                    
                    Severity: Minor
                    Found in apps/files_sharing/lib/Command/CleanupRemoteStorages.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language