owncloud/core

View on GitHub

Showing 3,235 of 4,503 total issues

Function newStorage has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    newStorage: function(storageConfig, onCompletion) {
        var mountPoint = storageConfig.mountPoint;
        var backend = this._allBackends[storageConfig.backend];
        var isInvalidAuth = false;

Severity: Major
Found in apps/files_external/js/settings.js - About 4 hrs to fix

    File ja.js has 356 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    OC.L10N.register(
        "settings",
        {
        "Wrong current password" : "現在のパスワードが間違っています",
        "The new password cannot be the same as the previous one" : "新しいパスワードは前のパスワードと同じにできません",
    Severity: Minor
    Found in settings/l10n/ja.js - About 4 hrs to fix

      File SystemTagManager.php has 355 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @author Joas Schilling <coding@schilljs.com>
       * @author Vincent Petry <pvince81@owncloud.com>
       *
      Severity: Minor
      Found in lib/private/SystemTag/SystemTagManager.php - About 4 hrs to fix

        Trashbin has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Trashbin {
            /**
             * @var IURLGenerator
             */
            private $urlGenerator;
        Severity: Minor
        Found in apps/files_trashbin/lib/Trashbin.php - About 4 hrs to fix

          AppManager has 35 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class AppManager implements IAppManager {
              /**
               * Apps with these types can not be enabled for certain groups only
               * @var string[]
               */
          Severity: Minor
          Found in lib/private/App/AppManager.php - About 4 hrs to fix

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

            OC.L10N.register(
                "settings",
                {
                "Wrong current password" : "Rangt núverandi lykilorð",
                "The new password cannot be the same as the previous one" : "Nýja lykilorðið má ekki vera eins og það fyrra",
            Severity: Minor
            Found in settings/l10n/is.js - About 4 hrs to fix

              Function setupUploadEvents has 112 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      setupUploadEvents: function(uploader) {
                          var self = this;
              
                          self._uploads = {};
              
              
              Severity: Major
              Found in apps/files/js/filelist.js - About 4 hrs to fix

                Method expire has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function expire($filename, $uid) {
                        $config = \OC::$server->getConfig();
                        $expiration = self::getExpiration();
                
                        if ($config->getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' && $expiration->isEnabled()) {
                Severity: Major
                Found in apps/files_versions/lib/Storage.php - About 4 hrs to fix

                  Method getDirectoryContent has 112 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    File commentstabview.js has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

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

                      File Availability.php has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * @author Robin Appelman <icewind@owncloud.com>
                       * @author Robin McCorkell <robin@mccorkell.me.uk>
                       *
                      Severity: Minor
                      Found in lib/private/Files/Storage/Wrapper/Availability.php - About 4 hrs to fix

                        File ConvertType.php has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                         * @author Andreas Fischer <bantu@owncloud.com>
                         * @author Bart Visscher <bartv@thisnet.nl>
                         * @author Joas Schilling <coding@schilljs.com>
                        Severity: Minor
                        Found in core/Command/Db/ConvertType.php - About 4 hrs to fix

                          Method updateShare has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function updateShare($id) {
                                  if (!$this->shareManager->shareApiEnabled()) {
                                      return new Result(null, 404, $this->l->t('Share API is disabled'));
                                  }
                          
                          
                          Severity: Major
                          Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 4 hrs to fix

                            Function init has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function init() {
                                    if ($this->init) {
                                        return;
                                    }
                                    $this->init = true;
                            Severity: Minor
                            Found in lib/private/NavigationManager.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

                            Function match has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function match($url) {
                                    if (\substr($url, 0, 6) === '/apps/') {
                                        // empty string / 'apps' / $app / rest of the route
                                        list(, , $app, ) = \explode('/', $url, 4);
                            
                            
                            Severity: Minor
                            Found in lib/private/Route/Router.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

                            File ShareController.php has 349 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                             * @author Björn Schießle <bjoern@schiessle.org>
                             * @author Georg Ehrke <georg@owncloud.com>
                            Severity: Minor
                            Found in apps/files_sharing/lib/Controllers/ShareController.php - About 4 hrs to fix

                              Function addSelect2 has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function addSelect2 ($elements, userListLimit) {
                                  if (!$elements.length) {
                                      return;
                                  }
                                  $elements.select2({
                              Severity: Major
                              Found in apps/files_external/js/settings.js - About 4 hrs to fix

                                File is.js has 348 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

                                  Local has 34 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class Local extends Common {
                                      protected $datadir;
                                  
                                      protected $dataDirLength;
                                  
                                  
                                  Severity: Minor
                                  Found in lib/private/Files/Storage/Local.php - About 4 hrs to fix

                                    Request has 34 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    class Request implements ArrayAccess, Countable, IRequest {
                                        public const USER_AGENT_IE = '/(MSIE)|(Trident)/';
                                        public const USER_AGENT_IE_8 = '/MSIE 8.0/';
                                        // Microsoft Edge User Agent from https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx
                                        public const USER_AGENT_MS_EDGE = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+ Edge\/[0-9.]+$/';
                                    Severity: Minor
                                    Found in lib/private/AppFramework/Http/Request.php - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language