owncloud/core

View on GitHub

Showing 3,230 of 4,482 total issues

File filelist.js has 2297 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 6 days to fix

    File Share.php has 2250 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 6 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,
      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 js.js has 2043 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 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

          Function _generateHTML has a Cognitive Complexity of 220 (exceeds 5 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: Minor
          Found in core/js/js.js - About 4 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 View.php has 1478 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 761 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 Manager.php has 1180 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 3 days to fix

                File jquery.fileupload.js has 1170 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 3 days to fix

                  File Server.php has 1168 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 3 days to fix

                    File settings.js has 1138 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_external/js/settings.js - 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 UsersController.php has 974 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        /**
                         * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                         * @author Clark Tomlinson <fallen013@gmail.com>
                         * @author Joas Schilling <coding@schilljs.com>
                        Severity: Major
                        Found in settings/Controller/UsersController.php - About 2 days to fix

                          File util.php has 965 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 CalDavBackend.php has 957 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 file-upload.js has 941 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

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

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

                                /**
                                 * Copyright (c) 2014, Arthur Schiwon <blizzz@owncloud.com>
                                 * Copyright (c) 2014, Raghu Nayyar <beingminimal@gmail.com>
                                 * Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
                                 * This file is licensed under the Affero General Public License version 3 or later.
                                Severity: Major
                                Found in settings/js/users/users.js - 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

                                  File Share20OcsController.php has 872 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  <?php
                                  /**
                                   * @author Viktar Dubiniuk <dubiniuk@owncloud.com>
                                   *
                                   * @copyright Copyright (c) 2019, ownCloud GmbH
                                  Severity: Major
                                  Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 2 days to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language