owncloud/core

View on GitHub

Showing 4,502 of 4,502 total issues

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

OC.L10N.register(
    "files_sharing",
    {
    "Server to server sharing is not enabled on this server" : "Interservila kunhavo ne kapabliĝis en ĉi tiu servilo",
    "Not allowed to create a federated share with the same user server" : "Ne kreeblas federa kunhavo per la sama uzantoservilo",
Severity: Major
Found in apps/files_sharing/l10n/eo.js and 3 other locations - About 2 days to fix
apps/files_external/l10n/sk_SK.js on lines 1..79
apps/files_sharing/l10n/et_EE.js on lines 1..79
apps/files_sharing/l10n/hu_HU.js on lines 1..79

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

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

OC.L10N.register(
    "files_sharing",
    {
    "Server to server sharing is not enabled on this server" : "Serverist serverisse jagamine pole antud serveris lubatud",
    "The mountpoint name contains invalid characters." : "Ühenduspunkti nimes on vigaseid märke.",
Severity: Major
Found in apps/files_sharing/l10n/et_EE.js and 3 other locations - About 2 days to fix
apps/files_external/l10n/sk_SK.js on lines 1..79
apps/files_sharing/l10n/eo.js on lines 1..79
apps/files_sharing/l10n/hu_HU.js on lines 1..79

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

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

OC.L10N.register(
    "files_sharing",
    {
    "Server to server sharing is not enabled on this server" : "A kiszolgálók közötti megosztás nincs engedélyezve ezen a kiszolgálón",
    "The mountpoint name contains invalid characters." : "A csatlakozási pont neve érvénytelen karaktereket tartalmaz ",
Severity: Major
Found in apps/files_sharing/l10n/hu_HU.js and 3 other locations - About 2 days to fix
apps/files_external/l10n/sk_SK.js on lines 1..79
apps/files_sharing/l10n/eo.js on lines 1..79
apps/files_sharing/l10n/et_EE.js on lines 1..79

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

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

OC.L10N.register(
    "settings",
    {
    "Unable to change password" : "Չկարողացա փոխել գաղտնաբառը",
    "Unable to delete group." : "Չկարողացա ջնջել խումբը",
Severity: Major
Found in settings/l10n/hy.js and 1 other location - About 2 days to fix
settings/l10n/km.js on lines 1..78

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

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

OC.L10N.register(
    "settings",
    {
    "Authentication error" : "កំហុស​ការ​ផ្ទៀង​ផ្ទាត់​ភាព​ត្រឹម​ត្រូវ",
    "Saved" : "បាន​រក្សាទុក",
Severity: Major
Found in settings/l10n/km.js and 1 other location - About 2 days to fix
settings/l10n/hy.js on lines 1..78

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

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 shareItem has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring.
Open

    public static function shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName = null, \DateTime $expirationDate = null, $passwordChanged = null) {
        $backend = self::getBackend($itemType);
        $l = \OC::$server->getL10N('lib');

        if ($backend->isShareTypeAllowed($shareType) === false) {
Severity: Minor
Found in lib/private/Share/Share.php - About 2 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

File Share20OcsController.php has 872 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @author Viktar Dubiniuk <dubiniuk@owncloud.com>
 *
 * @copyright Copyright (c) 2019, ownCloud GmbH
Severity: Major
Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 2 days to fix

    File DefaultShareProvider.php has 866 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @author Björn Schießle <bjoern@schiessle.org>
     * @author Joas Schilling <coding@schilljs.com>
     * @author phisch <git@philippschaffrath.de>
    Severity: Major
    Found in lib/private/Share20/DefaultShareProvider.php - About 2 days to fix

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

      OC.L10N.register(
          "files_sharing",
          {
          "Server to server sharing is not enabled on this server" : "Berbagi server ke server tidak diaktifkan pada server ini",
          "The mountpoint name contains invalid characters." : "Nama mount point berisi karakter yang tidak sah.",
      Severity: Major
      Found in apps/files_sharing/l10n/id.js and 2 other locations - About 1 day to fix
      apps/files_sharing/l10n/lt_LT.js on lines 1..72
      settings/l10n/ka_GE.js on lines 1..72

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

      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

      OC.L10N.register(
          "settings",
          {
          "Authentication error" : "ავთენტიფიკაციის შეცდომა",
          "Email sent" : "იმეილი გაიგზავნა",
      Severity: Major
      Found in settings/l10n/ka_GE.js and 2 other locations - About 1 day to fix
      apps/files_sharing/l10n/id.js on lines 1..72
      apps/files_sharing/l10n/lt_LT.js on lines 1..72

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

      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

      OC.L10N.register(
          "files_sharing",
          {
          "Server to server sharing is not enabled on this server" : "Serveris - serveris dalinimasis neįjungtas šiame serveryje",
          "The mountpoint name contains invalid characters." : "Prijungimo taškas su neleistinais simboliais.",
      Severity: Major
      Found in apps/files_sharing/l10n/lt_LT.js and 2 other locations - About 1 day to fix
      apps/files_sharing/l10n/id.js on lines 1..72
      settings/l10n/ka_GE.js on lines 1..72

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

      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 init has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring.
      Open

          init: function($uploadEl, options) {
              var self = this;
              options = options || {};
      
              this._uploads = {};
      Severity: Minor
      Found in apps/files/js/file-upload.js - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function scanFile has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

          public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true) {
              // only proceed if $file is not a partial file nor a blacklisted file
              if (!self::isPartialFile($file) and !Filesystem::isFileBlacklisted($file)) {
                  //acquire a lock
                  if ($lock && $this->storage->instanceOfStorage(ILockingStorage::class)) {
      Severity: Minor
      Found in lib/private/Files/Cache/Scanner.php - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function getUsersSharingFile has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
              $userManager = \OC::$server->getUserManager();
              $userObject = $userManager->get($ownerUser);
      
              if ($userObject === null) {
      Severity: Minor
      Found in lib/private/Share/Share.php - About 1 day to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      File Session.php has 775 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
       * @author Bernhard Posselt <dev@bernhard-posselt.com>
       * @author Christoph Wurst <christoph@owncloud.com>
      Severity: Major
      Found in lib/private/User/Session.php - About 1 day to fix

        Function init has 358 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            init: function($uploadEl, options) {
                var self = this;
                options = options || {};
        
                this._uploads = {};
        Severity: Major
        Found in apps/files/js/file-upload.js - About 1 day to fix

          File image.php has 761 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * @author Andreas Fischer <bantu@owncloud.com>
           * @author Bartek Przybylski <bart.p.pl@gmail.com>
           * @author Bart Visscher <bartv@thisnet.nl>
          Severity: Major
          Found in lib/private/legacy/image.php - About 1 day to fix

            Method getItems has 344 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function getItems(
                    $itemType,
                    $item = null,
                    $shareType = null,
                    $shareWith = null,
            Severity: Major
            Found in lib/private/Share/Share.php - About 1 day to fix

              Function log has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function log($level, $message, array $context = []) {
                      $minLevel = \min($this->config->getValue('loglevel', Util::WARN), Util::FATAL);
                      $logConditions = $this->config->getValue('log.conditions', []);
                      if (empty($logConditions)) {
                          $logConditions[] = $this->config->getValue('log.condition', []);
              Severity: Minor
              Found in lib/private/Log.php - About 1 day to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function getDirectoryContent has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getDirectoryContent($directory, $mimetype_filter = '') {
                      $this->assertPathLength($directory);
                      if (!Filesystem::isValidPath($directory)) {
                          return [];
                      }
              Severity: Minor
              Found in lib/private/Files/View.php - About 1 day to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language