owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

            return $.ajax({
                type: 'PUT',
                url: this._getUrl('shares/' + encodeURIComponent(shareId)),
                data: JSON.stringify(properties),
                dataType: 'json',
Severity: Major
Found in core/js/shareitemmodel.js and 1 other location - About 4 hrs to fix
core/js/shareitemmodel.js on lines 272..295

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

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

File zh_TW.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
Open

OC.L10N.register(
    "core",
    {
    "Please select a file." : "請選擇一個檔案",
    "File is too big" : "檔案太大",
Severity: Minor
Found in core/l10n/zh_TW.js - About 4 hrs to fix

    File gl.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    OC.L10N.register(
        "core",
        {
        "Please select a file." : "Seleccione un ficheiro.",
        "File is too big" : "O ficheiro é grande de máis",
    Severity: Minor
    Found in core/l10n/gl.js - About 4 hrs to fix

      File he.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      OC.L10N.register(
          "core",
          {
          "Please select a file." : "יש לבחור קובץ.",
          "File is too big" : "הקובץ גדול מדי",
      Severity: Minor
      Found in core/l10n/he.js - About 4 hrs to fix

        SharedStorage has 36 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
            /** @var \OCP\Share\IShare */
            private $superShare;
        
            /** @var \OCP\Share\IShare[] */
        Severity: Minor
        Found in apps/files_sharing/lib/SharedStorage.php - About 4 hrs to fix

          DAV has 36 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class DAV extends Common {
              /** @var string */
              protected $password;
              /** @var string */
              protected $user;
          Severity: Minor
          Found in lib/private/Files/Storage/DAV.php - About 4 hrs to fix

            File ar.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            OC.L10N.register(
                "core",
                {
                "Please select a file." : "يُرجى تحديد ملف.",
                "File is too big" : "الملف كبير للغاية",
            Severity: Minor
            Found in core/l10n/ar.js - About 4 hrs to fix

              File is.js has 361 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              OC.L10N.register(
                  "core",
                  {
                  "Please select a file." : "Veldu einhverja skrá.",
                  "File is too big" : "Skrá er of stór",
              Severity: Minor
              Found in core/l10n/is.js - About 4 hrs to fix

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

                OC.L10N.register(
                    "files_external",
                    {
                    "Personal" : "Անձնական",
                    "Generate keys" : "Գեներացնել բանալի",
                Severity: Major
                Found in apps/files_external/l10n/hy.js and 2 other locations - About 4 hrs to fix
                settings/l10n/cy_GB.js on lines 1..27
                settings/l10n/ur_PK.js on lines 1..27

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

                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" : "Gwall dilysu",
                    "Email sent" : "Anfonwyd yr e-bost",
                Severity: Major
                Found in settings/l10n/cy_GB.js and 2 other locations - About 4 hrs to fix
                apps/files_external/l10n/hy.js on lines 1..27
                settings/l10n/ur_PK.js on lines 1..27

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

                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",
                    {
                    "Email sent" : "ارسال شدہ ای میل ",
                    "Delete" : "حذف کریں",
                Severity: Major
                Found in settings/l10n/ur_PK.js and 2 other locations - About 4 hrs to fix
                apps/files_external/l10n/hy.js on lines 1..27
                settings/l10n/cy_GB.js on lines 1..27

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

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

                    public function __construct() {
                        parent::__construct('federatedfilesharing');
                        $container = $this->getContainer();
                        $server = $container->getServer();
                
                
                Severity: Major
                Found in apps/federatedfilesharing/lib/AppInfo/Application.php - About 4 hrs to fix

                  Method log has 115 lines of code (exceeds 25 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: Major
                  Found in lib/private/Log.php - About 4 hrs to fix

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

                            updateEmptyContent: function() {
                                var dir = this.getCurrentDirectory();
                                if (dir === '/') {
                                    // root has special permissions
                                    this.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty);
                    Severity: Major
                    Found in apps/files_external/js/mountsfilelist.js and 1 other location - About 4 hrs to fix
                    apps/files/js/favoritesfilelist.js on lines 47..57

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

                    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

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

                                updateEmptyContent: function() {
                                    var dir = this.getCurrentDirectory();
                                    if (dir === '/') {
                                        // root has special permissions
                                        this.$el.find('#emptycontent').toggleClass('hidden', !this.isEmpty);
                    Severity: Major
                    Found in apps/files/js/favoritesfilelist.js and 1 other location - About 4 hrs to fix
                    apps/files_external/js/mountsfilelist.js on lines 63..73

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

                    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

                    $(document).ready(function() {
                        function saveSettings() {
                            var postData = {};
                            postData[$(this).attr('name')] = $(this).is(":checked") ? "yes" : "no";
                            $.post(OC.generateUrl('apps/federatedfilesharing/personalsettings/setuserconfig'), postData);
                    Severity: Major
                    Found in apps/federatedfilesharing/js/settings-personal-sharing.js and 1 other location - About 4 hrs to fix
                    apps/files_sharing/js/settings-personal.js on lines 1..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 127.

                    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

                    $(document).ready(function() {
                        function saveSettings() {
                            var postData = {};
                            postData[$(this).attr('name')] = $(this).is(":checked") ? "yes" : "no";
                            $.post(OC.generateUrl('apps/files_sharing/personalsettings/setuserconfig'), postData);
                    Severity: Major
                    Found in apps/files_sharing/js/settings-personal.js and 1 other location - About 4 hrs to fix
                    apps/federatedfilesharing/js/settings-personal-sharing.js on lines 1..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 127.

                    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

                    File cs_CZ.js has 358 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    OC.L10N.register(
                        "settings",
                        {
                        "Wrong current password" : "Chybné heslo",
                        "The new password cannot be the same as the previous one" : "Nové heslo nemůže být stejné jako to předchozí",
                    Severity: Minor
                    Found in settings/l10n/cs_CZ.js - About 4 hrs to fix

                      File RepairMismatchFileCachePath.php has 358 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * @author Vincent Petry <pvince81@owncloud.com>
                       *
                       * @copyright Copyright (c) 2018, ownCloud GmbH
                      Severity: Minor
                      Found in lib/private/Repair/RepairMismatchFileCachePath.php - About 4 hrs to fix

                        Function downloadShare has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function downloadShare($token, $files = null, $path = '', $downloadStartSecret = '') {
                                \OC_User::setIncognitoMode(true);
                        
                                $share = $this->shareManager->getShareByToken($token);
                        
                        
                        Severity: Minor
                        Found in apps/files_sharing/lib/Controllers/ShareController.php - About 4 hrs 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