owncloud/core

View on GitHub

Showing 3,009 of 14,289 total issues

File Share20OCSTest.php has 2783 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @author Björn Schießle <bjoern@schiessle.org>
 * @author Michael Jobst <mjobst+github@tecratech.de>
 * @author Roeland Jago Douma <rullzer@owncloud.com>
Severity: Major
Found in apps/files_sharing/tests/API/Share20OCSTest.php - About 1 wk to fix

    File filelistSpec.js has 2643 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
    * ownCloud
    *
    * @author Vincent Petry
    * @copyright Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
    Severity: Major
    Found in apps/files/tests/js/filelistSpec.js - About 1 wk to fix

      File UsersTest.php has 2361 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
       * @author Joas Schilling <coding@schilljs.com>
       * @author Lukas Reschke <lukas@statuscode.ch>
      Severity: Major
      Found in apps/provisioning_api/tests/UsersTest.php - About 6 days to fix

        File filelist.js has 2064 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: Major
        Found in apps/files/js/filelist.js - About 5 days to fix

          Function getItems has a Cognitive Complexity of 275 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getItems($itemType, $item = null, $shareType = null, $shareWith = null,
                                              $uidOwner = null, $format = self::FORMAT_NONE, $parameters = null, $limit = -1,
                                              $includeCollections = false, $itemShareWithBySource = false, $checkExpireDate  = true) {
                  if (!self::isEnabled()) {
                      return [];
          Severity: Minor
          Found in lib/private/Share/Share.php - About 5 days 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 Share.php has 1983 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 Reiter <ockham@raz.or.at>
          Severity: Major
          Found in lib/private/Share/Share.php - About 5 days to fix

            Method changeSchema has 984 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function changeSchema(Schema $schema, array $options) {
                    $prefix = $options['tablePrefix'];
            
                    if (!$schema->hasTable("${prefix}addressbookchanges")) {
                        $addressBookChangesTable = $schema->createTable("${prefix}addressbookchanges");
            Severity: Major
            Found in core/Migrations/Version20170101010100.php - About 4 days to fix

              File ShareesTest.php has 1568 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 Roeland Jago Douma <rullzer@owncloud.com>
              Severity: Major
              Found in apps/files_sharing/tests/API/ShareesTest.php - About 4 days to fix

                File View.php has 1406 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 lib/private/Files/View.php - About 3 days to fix

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

                      public function __construct($webRoot, \OC\Config $config) {
                          parent::__construct();
                          $this->webRoot = $webRoot;
                  
                          $this->registerService('SettingsManager', function (Server $c) {
                  Severity: Major
                  Found in lib/private/Server.php - About 3 days to fix

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

                    /**
                     * Disable console output unless DEBUG mode is enabled.
                     * Add
                     *      'debug' => true,
                     * To the definition of $CONFIG in config/config.php to enable debug mode.
                    Severity: Major
                    Found in core/js/js.js - About 3 days to fix

                      File jquery.fileupload.js has 1122 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*
                       * jQuery File Upload Plugin
                       * https://github.com/blueimp/jQuery-File-Upload
                       *
                       * Copyright 2010, Sebastian Tschan
                      Severity: Major
                      Found in apps/files/js/jquery.fileupload.js - About 2 days to fix

                        File ApiTest.php has 1099 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 Morris Jobke <hey@morrisjobke.de>
                        Severity: Major
                        Found in apps/files_sharing/tests/ApiTest.php - About 2 days to fix

                          File Server.php has 1091 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/Server.php - About 2 days to fix

                            File FileTest.php has 1082 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * @author Joas Schilling <coding@schilljs.com>
                             * @author Robin Appelman <icewind@owncloud.com>
                             * @author Thomas Müller <thomas.mueller@tmit.eu>
                            Severity: Major
                            Found in apps/dav/tests/unit/Connector/Sabre/FileTest.php - About 2 days to fix

                              File Version20170101010100.php has 993 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * @author Philipp Schaffrath <pschaffrath@owncloud.com>
                               *
                               * @copyright Copyright (c) 2018, ownCloud GmbH
                              Severity: Major
                              Found in core/Migrations/Version20170101010100.php - About 2 days to fix

                                File coreSpec.js has 963 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /**
                                * ownCloud
                                *
                                * @author Vincent Petry
                                * @copyright Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
                                Severity: Major
                                Found in core/js/tests/specs/coreSpec.js - About 2 days to fix

                                  File CalDavBackend.php has 956 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  <?php
                                  /**
                                   * @author Joas Schilling <coding@schilljs.com>
                                   * @author Stefan Weil <sw@weilnetz.de>
                                   * @author Thomas Citharel <tcit@tcit.fr>
                                  Severity: Major
                                  Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 2 days to fix

                                    File Manager.php has 892 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 Joas Schilling <coding@schilljs.com>
                                    Severity: Major
                                    Found in lib/private/Share20/Manager.php - About 2 days to fix

                                      Function shareItem has a Cognitive Complexity of 106 (exceeds 5 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: Minor
                                      Found in lib/private/Share/Share.php - About 2 days 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