owncloud/core

View on GitHub

Showing 3,230 of 4,482 total issues

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

      File Storage.php has 653 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
       * @author Bart Visscher <bartv@thisnet.nl>
       * @author Björn Schießle <bjoern@schiessle.org>
      Severity: Major
      Found in apps/files_versions/lib/Storage.php - About 1 day to fix

        File Encryption.php has 651 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 Lukas Reschke <lukas@statuscode.ch>
        Severity: Major
        Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 1 day to fix

          File DAV.php has 650 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * @author Bart Visscher <bartv@thisnet.nl>
           * @author Björn Schießle <bjoern@schiessle.org>
           * @author Carlos Cerrillo <ccerrillo@gmail.com>
          Severity: Major
          Found in lib/private/Files/Storage/DAV.php - About 1 day to fix

            File shareitemmodel.js has 645 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Copyright (c) 2015
             *
             * This file is licensed under the Affero General Public License version 3
             * or later.
            Severity: Major
            Found in core/js/shareitemmodel.js - About 1 day to fix

              Method shareItem has 287 lines of code (exceeds 25 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: Major
              Found in lib/private/Share/Share.php - About 1 day to fix

                Function fileexists has 280 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    fileexists:function(data, original, replacement, controller) {
                        var self = this;
                        var dialogDeferred = new $.Deferred();
                
                        var getCroppedPreview = function(file) {
                Severity: Major
                Found in core/js/oc-dialogs.js - About 1 day to fix

                  File Cache.php has 627 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * @author Andreas Fischer <bantu@owncloud.com>
                   * @author Björn Schießle <bjoern@schiessle.org>
                   * @author Florin Peter <github@florin-peter.de>
                  Severity: Major
                  Found in lib/private/Files/Cache/Cache.php - About 1 day to fix

                    File Google.php has 612 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * @author Adam Williamson <awilliam@redhat.com>
                     * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                     * @author Bart Visscher <bartv@thisnet.nl>
                    Severity: Major
                    Found in apps/files_external/lib/Lib/Storage/Google.php - About 1 day to fix

                      Function initCore has 267 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function initCore() {
                          // setup tooltip
                          $('.section .icon-info').tooltip({placement: 'right'});
                      
                          /**
                      Severity: Major
                      Found in core/js/js.js - About 1 day to fix

                        Filesystem has 71 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Filesystem {
                            /**
                             * @var Mount\Manager $mounts
                             */
                            private static $mounts;
                        Severity: Major
                        Found in lib/private/Files/Filesystem.php - About 1 day to fix

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

                              public function __construct($appName, $urlParams = []) {
                                  parent::__construct();
                                  $this['AppName'] = $appName;
                                  $this['urlParams'] = $urlParams;
                          
                          
                          Severity: Major
                          Found in lib/private/AppFramework/DependencyInjection/DIContainer.php - About 1 day to fix

                            File SMB.php has 600 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                             * @author Jesús Macias <jmacias@solidgear.es>
                             * @author Jörn Friedrich Dreyer <jfd@butonic.de>
                            Severity: Major
                            Found in apps/files_external/lib/Lib/Storage/SMB.php - About 1 day to fix

                              File CardDavBackend.php has 591 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: Major
                              Found in apps/dav/lib/CardDAV/CardDavBackend.php - About 1 day to fix

                                Manager has 69 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class Manager implements IManager {
                                    /** @var IProviderFactory */
                                    private $factory;
                                    /** @var ILogger */
                                    private $logger;
                                Severity: Major
                                Found in lib/private/Share20/Manager.php - About 1 day to fix

                                  Function basicOperation has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      private function basicOperation($operation, $path, $hooks = [], $extraParam = null) {
                                          $postFix = (\substr($path, -1, 1) === '/') ? '/' : '';
                                          $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
                                          if (Filesystem::isValidPath($path)
                                              and !Filesystem::isForbiddenFileOrDir($path)
                                  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

                                  Function checkServer has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public static function checkServer(\OCP\IConfig $config) {
                                          $l = \OC::$server->getL10N('lib');
                                          $errors = [];
                                          $CONFIG_DATADIRECTORY = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data');
                                  
                                  
                                  Severity: Minor
                                  Found in lib/private/legacy/util.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 client.js has 583 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /*
                                   * Copyright (c) 2015
                                   *
                                   * This file is licensed under the Affero General Public License version 3
                                   * or later.
                                  Severity: Major
                                  Found in core/js/files/client.js - About 1 day to fix

                                    Function _generateHTML has 240 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        $.datepicker._generateHTML = function( inst ) {
                                            var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
                                                controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
                                                monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
                                                selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
                                    Severity: Major
                                    Found in core/js/js.js - About 1 day to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language