owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

OC.L10N.register(
    "federation",
    {
    "Server added to the list of trusted ownClouds" : "Serveris ir pievienots uzticamo ownCloud serveru sarakstam",
    "Server is already in the list of trusted servers." : "Serveris ir uzticamo serverus sarakstā",
Severity: Major
Found in apps/federation/l10n/lv.js and 18 other locations - About 1 hr to fix
apps/federatedfilesharing/l10n/af_ZA.js on lines 1..15
apps/federatedfilesharing/l10n/lv.js on lines 1..15
apps/files/l10n/hi.js on lines 1..15
apps/files/l10n/ku_IQ.js on lines 1..15
apps/files/l10n/sv_SE.js on lines 1..15
apps/files_external/l10n/cy_GB.js on lines 1..15
apps/files_external/l10n/ms_MY.js on lines 1..15
apps/files_sharing/l10n/cy_GB.js on lines 1..15
apps/files_sharing/l10n/es_CL.js on lines 1..15
apps/files_sharing/l10n/mn.js on lines 1..15
apps/files_sharing/l10n/si.js on lines 1..15
apps/files_sharing/l10n/si_LK.js on lines 1..15
apps/files_trashbin/l10n/bn_IN.js on lines 1..15
apps/files_trashbin/l10n/km.js on lines 1..15
apps/updatenotification/l10n/lb.js on lines 1..15
core/l10n/tr_TR.js on lines 1..15
lib/l10n/nds.js on lines 1..15
settings/l10n/es_ES.js on lines 1..15

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

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

OC.L10N.register(
    "files_trashbin",
    {
    "Couldn't delete %s permanently" : "স্থায়ীভাবে %s গুলি মুছে ফেলা যায়নি",
    "Couldn't restore %s" : "%s পুনরুদ্ধার করা যায়নি",
Severity: Major
Found in apps/files_trashbin/l10n/bn_IN.js and 18 other locations - About 1 hr to fix
apps/federatedfilesharing/l10n/af_ZA.js on lines 1..15
apps/federatedfilesharing/l10n/lv.js on lines 1..15
apps/federation/l10n/lv.js on lines 1..15
apps/files/l10n/hi.js on lines 1..15
apps/files/l10n/ku_IQ.js on lines 1..15
apps/files/l10n/sv_SE.js on lines 1..15
apps/files_external/l10n/cy_GB.js on lines 1..15
apps/files_external/l10n/ms_MY.js on lines 1..15
apps/files_sharing/l10n/cy_GB.js on lines 1..15
apps/files_sharing/l10n/es_CL.js on lines 1..15
apps/files_sharing/l10n/mn.js on lines 1..15
apps/files_sharing/l10n/si.js on lines 1..15
apps/files_sharing/l10n/si_LK.js on lines 1..15
apps/files_trashbin/l10n/km.js on lines 1..15
apps/updatenotification/l10n/lb.js on lines 1..15
core/l10n/tr_TR.js on lines 1..15
lib/l10n/nds.js on lines 1..15
settings/l10n/es_ES.js on lines 1..15

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

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

OC.L10N.register(
    "files",
    {
    "Close" : "دابخه",
    "Favorites" : "دڵخوازەکان",
Severity: Major
Found in apps/files/l10n/ku_IQ.js and 18 other locations - About 1 hr to fix
apps/federatedfilesharing/l10n/af_ZA.js on lines 1..15
apps/federatedfilesharing/l10n/lv.js on lines 1..15
apps/federation/l10n/lv.js on lines 1..15
apps/files/l10n/hi.js on lines 1..15
apps/files/l10n/sv_SE.js on lines 1..15
apps/files_external/l10n/cy_GB.js on lines 1..15
apps/files_external/l10n/ms_MY.js on lines 1..15
apps/files_sharing/l10n/cy_GB.js on lines 1..15
apps/files_sharing/l10n/es_CL.js on lines 1..15
apps/files_sharing/l10n/mn.js on lines 1..15
apps/files_sharing/l10n/si.js on lines 1..15
apps/files_sharing/l10n/si_LK.js on lines 1..15
apps/files_trashbin/l10n/bn_IN.js on lines 1..15
apps/files_trashbin/l10n/km.js on lines 1..15
apps/updatenotification/l10n/lb.js on lines 1..15
core/l10n/tr_TR.js on lines 1..15
lib/l10n/nds.js on lines 1..15
settings/l10n/es_ES.js on lines 1..15

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

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

OC.L10N.register(
    "files_sharing",
    {
    "Uploading..." : "Yn llwytho i fyny...",
    "Cancel" : "Diddymu",
Severity: Major
Found in apps/files_sharing/l10n/cy_GB.js and 18 other locations - About 1 hr to fix
apps/federatedfilesharing/l10n/af_ZA.js on lines 1..15
apps/federatedfilesharing/l10n/lv.js on lines 1..15
apps/federation/l10n/lv.js on lines 1..15
apps/files/l10n/hi.js on lines 1..15
apps/files/l10n/ku_IQ.js on lines 1..15
apps/files/l10n/sv_SE.js on lines 1..15
apps/files_external/l10n/cy_GB.js on lines 1..15
apps/files_external/l10n/ms_MY.js on lines 1..15
apps/files_sharing/l10n/es_CL.js on lines 1..15
apps/files_sharing/l10n/mn.js on lines 1..15
apps/files_sharing/l10n/si.js on lines 1..15
apps/files_sharing/l10n/si_LK.js on lines 1..15
apps/files_trashbin/l10n/bn_IN.js on lines 1..15
apps/files_trashbin/l10n/km.js on lines 1..15
apps/updatenotification/l10n/lb.js on lines 1..15
core/l10n/tr_TR.js on lines 1..15
lib/l10n/nds.js on lines 1..15
settings/l10n/es_ES.js on lines 1..15

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

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

OC.L10N.register(
    "files_trashbin",
    {
    "Couldn't delete %s permanently" : "មិន​អាច​លុប %s ចោល​ជា​អចិន្ត្រៃយ៍​ទេ",
    "Couldn't restore %s" : "មិន​អាច​ស្ដារ %s ឡើង​វិញ​បាន​ទេ",
Severity: Major
Found in apps/files_trashbin/l10n/km.js and 18 other locations - About 1 hr to fix
apps/federatedfilesharing/l10n/af_ZA.js on lines 1..15
apps/federatedfilesharing/l10n/lv.js on lines 1..15
apps/federation/l10n/lv.js on lines 1..15
apps/files/l10n/hi.js on lines 1..15
apps/files/l10n/ku_IQ.js on lines 1..15
apps/files/l10n/sv_SE.js on lines 1..15
apps/files_external/l10n/cy_GB.js on lines 1..15
apps/files_external/l10n/ms_MY.js on lines 1..15
apps/files_sharing/l10n/cy_GB.js on lines 1..15
apps/files_sharing/l10n/es_CL.js on lines 1..15
apps/files_sharing/l10n/mn.js on lines 1..15
apps/files_sharing/l10n/si.js on lines 1..15
apps/files_sharing/l10n/si_LK.js on lines 1..15
apps/files_trashbin/l10n/bn_IN.js on lines 1..15
apps/updatenotification/l10n/lb.js on lines 1..15
core/l10n/tr_TR.js on lines 1..15
lib/l10n/nds.js on lines 1..15
settings/l10n/es_ES.js on lines 1..15

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

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

        $.getJSON(url, {tag: tag}, function(response) {
            if(response.status === 'success') {
                defer.resolve(response.ids);
            } else {
                defer.reject(response);
Severity: Major
Found in core/js/tags.js and 1 other location - About 1 hr to fix
core/js/tags.js on lines 282..288

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

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

    $blacklistedGroups.change(function(ev) {
        var groups = ev.val || [];
        groups = JSON.stringify(groups);
        OC.AppConfig.setValue('files_sharing', $(this).attr('name'), groups);
    });
Severity: Major
Found in apps/files_sharing/js/settings.js and 1 other location - About 1 hr to fix
settings/js/admin.js on lines 6..10

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

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

        $(element).change(function(ev) {
            var groups = ev.val || [];
            groups = JSON.stringify(groups);
            OC.AppConfig.setValue('core', $(this).attr('name'), groups);
        });
Severity: Major
Found in settings/js/admin.js and 1 other location - About 1 hr to fix
apps/files_sharing/js/settings.js on lines 14..18

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

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

        $.post(url, {tags:tags}, function(response) {
            if(response.status === 'success') {
                defer.resolve(response.tags);
            } else {
                defer.reject(response);
Severity: Major
Found in core/js/tags.js and 1 other location - About 1 hr to fix
core/js/tags.js on lines 91..97

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

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

        update: function () {
            if (GroupList.updating) {
                return;
            }
            GroupList.updating = true;
Severity: Minor
Found in settings/js/users/groups.js - About 1 hr to fix

    Function checkExistingFiles has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        checkExistingFiles: function (selection, callbacks) {
            var self = this;
            var fileList = this.fileList;
            var conflicts = [];
            // only keep non-conflicting uploads
    Severity: Minor
    Found in apps/files/js/file-upload.js - About 1 hr to fix

      Function getResponse has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          getResponse: function() {
              var response = this.data.response();
              if (response.errorThrown) {
                  if (response.errorThrown === 'timeout') {
                      return {
      Severity: Minor
      Found in apps/files/js/file-upload.js - About 1 hr to fix

        Function update has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                update: function() {
                    if (!this.$el) {
                        return;
                    }
                    if (!this.summary.totalFiles && !this.summary.totalDirs) {
        Severity: Minor
        Found in apps/files/js/filesummary.js - About 1 hr to fix

          Function parseQueryString has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              parseQueryString: function (queryString) {
                  var parts,
                      pos,
                      components,
                      result = {},
          Severity: Minor
          Found in core/js/js.js - About 1 hr to fix

            Method onReport has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function onReport($reportName, $report, $uri) {
                    $node = $this->server->tree->getNodeForPath($uri);
                    if (!$node instanceof EntityCollection || $reportName !== self::REPORT_NAME) {
                        throw new ReportNotSupported();
                    }
            Severity: Minor
            Found in apps/comments/lib/Dav/CommentsPlugin.php - About 1 hr to fix

              Method handleGetProperties has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function handleGetProperties(
                      PropFind $propFind,
                      \Sabre\DAV\INode $node
                  ) {
                      if (!($node instanceof \OCA\DAV\Connector\Sabre\Node)) {
              Severity: Minor
              Found in apps/dav/lib/Connector/Sabre/TagsPlugin.php - About 1 hr to fix

                Method updateStorageStatus has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function updateStorageStatus(IStorageConfig &$storage, $configInput, OutputInterface $output) {
                        try {
                            try {
                                $this->manipulateStorageConfig($storage);
                            } catch (InsufficientDataForMeaningfulAnswerException $e) {
                Severity: Minor
                Found in apps/files_external/lib/Command/Verify.php - About 1 hr to fix

                  Method getAutoExpireList has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected static function getAutoExpireList($time, $versions) {
                          $size = 0;
                          $toDelete = [];  // versions we want to delete
                  
                          $interval = 1;
                  Severity: Minor
                  Found in apps/files_versions/lib/Storage.php - About 1 hr to fix

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

                        public function execute(InputInterface $input, OutputInterface $output): int {
                            $pathOption = $input->getOption('path');
                            $userName = $input->getOption('user');
                    
                            $scanUserFunction = function (IUser $user) use ($input, $output) {
                    Severity: Minor
                    Found in apps/files/lib/Command/VerifyChecksums.php - About 1 hr to fix

                      Method store has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function store($filename) {
                              if (\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
                                  // if the file gets streamed we need to remove the .part extension
                                  // to get the right target
                                  $ext = \pathinfo($filename, PATHINFO_EXTENSION);
                      Severity: Minor
                      Found in apps/files_versions/lib/Storage.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language