owncloud/core

View on GitHub

Showing 4,503 of 4,503 total issues

Server has 87 functions (exceeds 20 allowed). Consider refactoring.
Open

class Server extends ServerContainer implements IServerContainer, IServiceLoader {
    use EventEmitterTrait;
    /** @var string */
    private $webRoot;

Severity: Major
Found in lib/private/Server.php - About 1 day to fix

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

    OC.L10N.register(
        "files_external",
        {
        "Step 1 failed. Exception: %s" : "Чекор 1 Неуспешен: %s",
        "Step 2 failed. Exception: %s" : "Чекор 2 Неуспешен: %s",
    Severity: Major
    Found in apps/files_external/l10n/mk.js and 2 other locations - About 1 day to fix
    apps/files_external/l10n/uk.js on lines 1..61
    settings/l10n/zh_HK.js on lines 1..61

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

    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_external",
        {
        "Step 1 failed. Exception: %s" : "1-й крок невдалий. Виключення: %s",
        "Step 2 failed. Exception: %s" : "2-й крок невдалий. Виключення: %s",
    Severity: Major
    Found in apps/files_external/l10n/uk.js and 2 other locations - About 1 day to fix
    apps/files_external/l10n/mk.js on lines 1..61
    settings/l10n/zh_HK.js on lines 1..61

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

    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",
        {
        "Saved" : "已儲存",
        "test email settings" : "測試電子郵件設定",
    Severity: Major
    Found in settings/l10n/zh_HK.js and 2 other locations - About 1 day to fix
    apps/files_external/l10n/mk.js on lines 1..61
    apps/files_external/l10n/uk.js on lines 1..61

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

    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

    View has 85 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class View {
        use EventEmitterTrait;
        /** @var string */
        private $fakeRoot = '';
    
    
    Severity: Major
    Found in lib/private/Files/View.php - About 1 day to fix

      File kernel.php has 698 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @author Adam Williamson <awilliam@redhat.com>
       * @author Andreas Fischer <bantu@owncloud.com>
       * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
      Severity: Major
      Found in lib/kernel.php - About 1 day to fix

        File FederatedShareProvider.php has 697 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * @author Björn Schießle <bjoern@schiessle.org>
         * @author Robin Appelman <icewind@owncloud.com>
         * @author Roeland Jago Douma <rullzer@owncloud.com>
        Severity: Major
        Found in apps/federatedfilesharing/lib/FederatedShareProvider.php - About 1 day to fix

          Function multiSelect has 311 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.multiSelect=function(options) {
                  multiSelectId++;
                  var settings = {
                      'createCallback':false,
                      'createText':false,
          Severity: Major
          Found in core/js/multiselect.js - About 1 day to fix

            File Trashbin.php has 683 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * @author Bart Visscher <bartv@thisnet.nl>
             * @author Bastien Ho <bastienho@urbancube.fr>
             * @author Björn Schießle <bjoern@schiessle.org>
            Severity: Major
            Found in apps/files_trashbin/lib/Trashbin.php - About 1 day to fix

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

                      _createFileActions: function() {
                          // inherit file actions from the files app
                          var fileActions = new OCA.Files.FileActions();
                          // note: not merging the legacy actions because legacy apps are not
                          // compatible with the sharing overview and need to be adapted first
              Severity: Major
              Found in apps/files/js/favoritesplugin.js and 2 other locations - About 1 day to fix
              apps/files_sharing/js/app.js on lines 163..188
              apps/systemtags/js/app.js on lines 46..70

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

              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

                      _createFileActions: function() {
                          // inherit file actions from the files app
                          var fileActions = new OCA.Files.FileActions();
                          // note: not merging the legacy actions because legacy apps are not
                          // compatible with the sharing overview and need to be adapted first
              Severity: Major
              Found in apps/systemtags/js/app.js and 2 other locations - About 1 day to fix
              apps/files/js/favoritesplugin.js on lines 75..99
              apps/files_sharing/js/app.js on lines 163..188

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

              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

                  _createFileActions: function() {
                      // inherit file actions from the files app
                      var fileActions = new OCA.Files.FileActions();
                      // note: not merging the legacy actions because legacy apps are not
                      // compatible with the sharing overview and need to be adapted first
              Severity: Major
              Found in apps/files_sharing/js/app.js and 2 other locations - About 1 day to fix
              apps/files/js/favoritesplugin.js on lines 75..99
              apps/systemtags/js/app.js on lines 46..70

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

              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 oc-dialogs.js has 677 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /**
               * ownCloud
               *
               * @author Bartek Przybylski, Christopher Schäpers, Thomas Tanghus
               * @copyright Copyright (c) 2012 Bartek Przybylski bartek@alefzero.eu
              Severity: Major
              Found in core/js/oc-dialogs.js - About 1 day to fix

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

                OC.L10N.register(
                    "files_external",
                    {
                    "External storage" : "Malena memorilo",
                    "Personal" : "Persona",
                Severity: Major
                Found in apps/files_external/l10n/eo.js and 1 other location - About 1 day to fix
                apps/files_sharing/l10n/sr.js on lines 1..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 278.

                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(
                    "files_sharing",
                    {
                    "Server to server sharing is not enabled on this server" : "Дељење између сервера није укључено на овом серверу",
                    "The mountpoint name contains invalid characters." : "Назив тачке монтирања садржи неисправне знакове.",
                Severity: Major
                Found in apps/files_sharing/l10n/sr.js and 1 other location - About 1 day to fix
                apps/files_external/l10n/eo.js on lines 1..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 278.

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

                    public function createShare() {
                        $share = $this->shareManager->newShare();
                
                        if (!$this->shareManager->shareApiEnabled()) {
                            return new Result(null, 404, $this->l->t('Share API is disabled'));
                Severity: Minor
                Found in apps/files_sharing/lib/Controller/Share20OcsController.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 imagebmp has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
                Open

                    function imagebmp($im, $fileName = '', $bit = 24, $compression = 0) {
                        if (!\in_array($bit, [1, 4, 8, 16, 24, 32])) {
                            $bit = 24;
                        } elseif ($bit == 32) {
                            $bit = 24;
                Severity: Minor
                Found in lib/private/legacy/image.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 Preview.php has 665 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * @author Björn Schießle <bjoern@schiessle.org>
                 * @author Frank Karlitschek <frank@karlitschek.de>
                 * @author Georg Ehrke <georg@owncloud.com>
                Severity: Major
                Found in lib/private/Preview.php - About 1 day to fix

                  File app.php has 664 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                   * @author Bart Visscher <bartv@thisnet.nl>
                   * @author Bernhard Posselt <dev@bernhard-posselt.com>
                  Severity: Major
                  Found in lib/private/legacy/app.php - About 1 day to fix

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

                            initialize: function($searchBox, $searchResults) {
                    
                                var self = this;
                    
                                /**
                    Severity: Major
                    Found in core/search/js/search.js - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language