owncloud/core

View on GitHub

Showing 2,948 of 14,133 total issues

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

/**
* ownCloud
*
* @author Vincent Petry
* @copyright 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 2364 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 Share20OCSTest.php has 2251 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 6 days to fix

        Function getItems has a Cognitive Complexity of 288 (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 filelist.js has 2012 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

          File Share.php has 1979 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 1538 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 1343 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

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

                    Function shareItem has a Cognitive Complexity of 162 (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');
                    
                    
                    Severity: Minor
                    Found in lib/private/Share/Share.php - About 3 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

                    Method __construct has 649 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 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 1094 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 1029 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 Version20170101010100.php has 993 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * @author Philipp Schaffrath <pschaffrath@owncloud.com>
                             *
                             * @copyright Copyright (c) 2017, 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 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 949 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 util.php has 868 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/private/legacy/util.php - About 2 days to fix

                                    File FileTest.php has 849 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
                                      Severity
                                      Category
                                      Status
                                      Source