owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method showShare has 98 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function showShare($token, $path = '') {
        \OC_User::setIncognitoMode(true);

        // Check whether share exists
        try {
Severity: Major
Found in apps/files_sharing/lib/Controllers/ShareController.php - About 3 hrs to fix

    File OcmController.php has 330 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @author Viktar Dubiniuk <dubiniuk@owncloud.com>
     *
     * @copyright Copyright (c) 2018, ownCloud GmbH
    Severity: Minor
    Found in apps/federatedfilesharing/lib/Controller/OcmController.php - About 3 hrs to fix

      Method __construct has 98 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct($renderAs, $appId = '') {
              // yes - should be injected ....
              $this->config = \OC::$server->getConfig();
      
              // Decide which page we show
      Severity: Major
      Found in lib/private/TemplateLayout.php - About 3 hrs to fix

        Method imagebmp has 98 lines of code (exceeds 25 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: Major
        Found in lib/private/legacy/image.php - About 3 hrs to fix

          Function writeBack has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function writeBack($tmpFile) {
                  if (isset(self::$tempFiles[$tmpFile])) {
                      $path = self::$tempFiles[$tmpFile];
                      $parentFolder = $this->getDriveFile(\dirname($path));
                      if ($parentFolder) {
          Severity: Minor
          Found in apps/files_external/lib/Lib/Storage/Google.php - About 3 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

          Function getSharesBy has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getSharesBy($userId, $shareType, $path = null, $reshares = false, $limit = 50, $offset = 0) {
                  if ($path !== null &&
                          !($path instanceof \OCP\Files\File) &&
                          !($path instanceof \OCP\Files\Folder)) {
                      throw new \InvalidArgumentException('invalid path');
          Severity: Minor
          Found in lib/private/Share20/Manager.php - About 3 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

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

          OC.L10N.register(
              "files_external",
              {
              "External storage" : "ექსტერნალ საცავი",
              "Personal" : "პირადი",
          Severity: Major
          Found in apps/files_external/l10n/ka_GE.js and 6 other locations - About 3 hrs to fix
          apps/federatedfilesharing/l10n/sk_SK.js on lines 1..24
          apps/files_external/l10n/ug.js on lines 1..24
          apps/systemtags/l10n/eo.js on lines 1..24
          lib/l10n/es_CL.js on lines 1..24
          lib/l10n/ta.js on lines 1..24
          lib/l10n/ta_LK.js on lines 1..24

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

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

          OC.L10N.register(
              "lib",
              {
              "Cannot write into \"config\" directory!" : "No se puede escribir en el directorio \"config\"!",
              "This can usually be fixed by giving the webserver write access to the config directory" : "Generalmente esto se puede resolver otorgando permisos de escritura al servidor web en la carpeta configurada",
          Severity: Major
          Found in lib/l10n/es_CL.js and 6 other locations - About 3 hrs to fix
          apps/federatedfilesharing/l10n/sk_SK.js on lines 1..24
          apps/files_external/l10n/ka_GE.js on lines 1..24
          apps/files_external/l10n/ug.js on lines 1..24
          apps/systemtags/l10n/eo.js on lines 1..24
          lib/l10n/ta.js on lines 1..24
          lib/l10n/ta_LK.js on lines 1..24

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

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

          OC.L10N.register(
              "files_external",
              {
              "External storage" : "سىرتقى ساقلىغۇچ",
              "Personal" : "شەخسىي",
          Severity: Major
          Found in apps/files_external/l10n/ug.js and 6 other locations - About 3 hrs to fix
          apps/federatedfilesharing/l10n/sk_SK.js on lines 1..24
          apps/files_external/l10n/ka_GE.js on lines 1..24
          apps/systemtags/l10n/eo.js on lines 1..24
          lib/l10n/es_CL.js on lines 1..24
          lib/l10n/ta.js on lines 1..24
          lib/l10n/ta_LK.js on lines 1..24

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

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

          OC.L10N.register(
              "lib",
              {
              "today" : "இன்று",
              "yesterday" : "நேற்று",
          Severity: Major
          Found in lib/l10n/ta.js and 6 other locations - About 3 hrs to fix
          apps/federatedfilesharing/l10n/sk_SK.js on lines 1..24
          apps/files_external/l10n/ka_GE.js on lines 1..24
          apps/files_external/l10n/ug.js on lines 1..24
          apps/systemtags/l10n/eo.js on lines 1..24
          lib/l10n/es_CL.js on lines 1..24
          lib/l10n/ta_LK.js on lines 1..24

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

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

          OC.L10N.register(
              "systemtags",
              {
              "Tags" : "Etikedoj",
              "Tagged files" : "Etikeditaj dosieroj",
          Severity: Major
          Found in apps/systemtags/l10n/eo.js and 6 other locations - About 3 hrs to fix
          apps/federatedfilesharing/l10n/sk_SK.js on lines 1..24
          apps/files_external/l10n/ka_GE.js on lines 1..24
          apps/files_external/l10n/ug.js on lines 1..24
          lib/l10n/es_CL.js on lines 1..24
          lib/l10n/ta.js on lines 1..24
          lib/l10n/ta_LK.js on lines 1..24

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

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

          OC.L10N.register(
              "federatedfilesharing",
              {
              "Loading..." : "Načítava sa...",
              "Invalid Federated Cloud ID" : "Neplatné združené Cloud ID",
          Severity: Major
          Found in apps/federatedfilesharing/l10n/sk_SK.js and 6 other locations - About 3 hrs to fix
          apps/files_external/l10n/ka_GE.js on lines 1..24
          apps/files_external/l10n/ug.js on lines 1..24
          apps/systemtags/l10n/eo.js on lines 1..24
          lib/l10n/es_CL.js on lines 1..24
          lib/l10n/ta.js on lines 1..24
          lib/l10n/ta_LK.js on lines 1..24

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

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

          OC.L10N.register(
              "lib",
              {
              "today" : "இன்று",
              "yesterday" : "நேற்று",
          Severity: Major
          Found in lib/l10n/ta_LK.js and 6 other locations - About 3 hrs to fix
          apps/federatedfilesharing/l10n/sk_SK.js on lines 1..24
          apps/files_external/l10n/ka_GE.js on lines 1..24
          apps/files_external/l10n/ug.js on lines 1..24
          apps/systemtags/l10n/eo.js on lines 1..24
          lib/l10n/es_CL.js on lines 1..24
          lib/l10n/ta.js on lines 1..24

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

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

              enableApp:function(appId, active, element, groups) {
                  var self = this;
                  OC.Settings.Apps.hideErrorMessage(appId);
                  groups = groups || [];
                  var appItem = $('div#app-'+appId+'');
          Severity: Major
          Found in settings/js/admin-apps.js - About 3 hrs to fix

            Function _makeFilesFromShares has 97 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _makeFilesFromShares: function(data) {
                        /* jshint camelcase: false */
                        var self = this;
                        var files = data;
            
            
            Severity: Major
            Found in apps/files_sharing/js/sharedfilelist.js - About 3 hrs to fix

              Method createShare has 97 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function createShare(\OCP\Share\IShare $share) {
                      $this->canShare($share);
              
                      // Verify if there are any issues with the path
                      $this->pathCreateChecks($share->getNode());
              Severity: Major
              Found in lib/private/Share20/Manager.php - About 3 hrs to fix

                File TroubleshootTransferOwnership.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * @author Piotr Mrowczynski <piotr@owncloud.com>
                 *
                 * @copyright Copyright (c) 2020, ownCloud GmbH
                Severity: Minor
                Found in apps/files/lib/Command/TroubleshootTransferOwnership.php - About 3 hrs to fix

                  File files.js has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                   * Copyright (c) 2014
                   *
                   * This file is licensed under the Affero General Public License version 3
                   * or later.
                  Severity: Minor
                  Found in apps/files/js/files.js - About 3 hrs to fix

                    File SettingsManager.php has 327 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * @author Tom Needham <tom@owncloud.com>
                     *
                     * @copyright Copyright (c) 2018, ownCloud GmbH
                    Severity: Minor
                    Found in lib/private/Settings/SettingsManager.php - About 3 hrs to fix

                      Method create has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function create($username, $password, array $groups= [], $email='') {
                              $resp = $this->validateString($username, 255);
                              if ($resp) {
                                  return $resp;
                              }
                      Severity: Major
                      Found in settings/Controller/UsersController.php - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language