owncloud/core

View on GitHub

Showing 3,236 of 4,502 total issues

Function expire has a Cognitive Complexity of 46 (exceeds 5 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: Minor
Found in apps/files_versions/lib/Storage.php - About 7 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 enterNode has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

    public function enterNode(Node $node) {
        if ($this->checkEqualOperatorUsage && $node instanceof Node\Expr\BinaryOp\Equal) {
            $this->errors[]= [
                'disallowedToken' => '==',
                'errorCode' => CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED,
Severity: Minor
Found in lib/private/App/CodeChecker/NodeVisitor.php - About 7 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 execute has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        if ($output->getVerbosity() === OutputInterface::VERBOSITY_NORMAL
            && !$input->hasParameterOption('--verbose=0', true)) {
            // set to more verbose on upgrade if no explicit verbosity was set
            $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
Severity: Minor
Found in core/Command/Upgrade.php - About 7 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

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

    public function changeSchema(Schema $schema, array $options) {
        $prefix = $options['tablePrefix'];

        if (!$schema->hasTable("{$prefix}authtoken")) {
            $authTokenTable = $schema->createTable("{$prefix}authtoken");
Severity: Major
Found in core/Migrations/Version20170101215145.php - About 6 hrs to fix

    Function initialize has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        initialize: function ($el) {
            var self = this;
            var fileActions;
            if (this._initialized) {
                return;
    Severity: Minor
    Found in apps/files_sharing/js/public.js - About 6 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 setPermissions has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) {
            $l = \OC::$server->getL10N('lib');
            $connection = \OC::$server->getDatabaseConnection();
    
            $intArrayToLiteralArray = function ($intArray, $eb) {
    Severity: Minor
    Found in lib/private/Share/Share.php - About 6 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

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

        public function __construct(array $urlParams= []) {
            parent::__construct('core', $urlParams);
    
            $container = $this->getContainer();
            $server = $container->getServer();
    Severity: Major
    Found in core/Application.php - About 6 hrs to fix

      File Version20170116150538.php has 453 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @author Viktar Dubiniuk <dubiniuk@owncloud.com>
       *
       * @copyright Copyright (c) 2018, ownCloud GmbH
      Severity: Minor
      Found in apps/dav/appinfo/Migrations/Version20170116150538.php - About 6 hrs to fix

        File AppManager.php has 452 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /**
         * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
         * @author Christoph Schaefer <christophł@wolkesicher.de>
         * @author Christoph Wurst <christoph@owncloud.com>
        Severity: Minor
        Found in lib/private/App/AppManager.php - About 6 hrs to fix

          Jail has 49 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Jail extends Wrapper { /* implements IVersionedStorage */
              /**
               * @var string
               */
              protected $rootPath;
          Severity: Minor
          Found in lib/private/Files/Storage/Wrapper/Jail.php - About 6 hrs to fix

            File ObjectStoreStorage.php has 451 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * @author Joas Schilling <coding@schilljs.com>
             * @author Jörn Friedrich Dreyer <jfd@butonic.de>
             * @author Morris Jobke <hey@morrisjobke.de>
            Severity: Minor
            Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php - About 6 hrs to fix

              Function attach has 169 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      attach: function(fileList) {
                          // core sharing is disabled/not loaded
                          if (!OC.Share) {
                              return;
                          }
              Severity: Major
              Found in apps/files_sharing/js/share.js - About 6 hrs to fix

                Method getUsersSharingFile has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
                        $userManager = \OC::$server->getUserManager();
                        $userObject = $userManager->get($ownerUser);
                
                        if ($userObject === null) {
                Severity: Major
                Found in lib/private/Share/Share.php - About 6 hrs to fix

                  File Request.php has 442 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * @author Bart Visscher <bartv@thisnet.nl>
                   * @author Bernhard Posselt <dev@bernhard-posselt.com>
                   * @author Joas Schilling <coding@schilljs.com>
                  Severity: Minor
                  Found in lib/private/AppFramework/Http/Request.php - About 6 hrs to fix

                    Function opendir has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function opendir($path) {
                            $folder = $this->getDriveFile($path);
                            if ($folder) {
                                $files = [];
                                $duplicates = [];
                    Severity: Minor
                    Found in apps/files_external/lib/Lib/Storage/Google.php - About 6 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 __construct has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function __construct($renderAs, $appId = '') {
                            // yes - should be injected ....
                            $this->config = \OC::$server->getConfig();
                    
                            // Decide which page we show
                    Severity: Minor
                    Found in lib/private/TemplateLayout.php - About 6 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

                    Method listMounts has 164 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function listMounts($userId, array $mounts, InputInterface $input, OutputInterface $output) {
                            $outputType = $input->getOption('output');
                            $outputIsJson = ($outputType === self::OUTPUT_FORMAT_JSON) || ($outputType === self::OUTPUT_FORMAT_JSON_PRETTY);
                            $shortView = $input->getOption('short');
                            $importableView = $input->getOption('importable-format');
                    Severity: Major
                    Found in apps/files_external/lib/Command/ListCommand.php - About 6 hrs to fix

                      Function extend has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                      Open

                      jQuery.extend = jQuery.fn.extend = function() {
                          var options, name, src, copy, copyIsArray, clone,
                              target = arguments[0] || {},
                              i = 1,
                              length = arguments.length,
                      Severity: Minor
                      Found in core/js/js.js - About 6 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 getShares has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getShares() {
                              if (!$this->shareManager->shareApiEnabled()) {
                                  return new Result();
                              }
                      
                      
                      Severity: Minor
                      Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 6 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 sharedialogshareelistview.js has 432 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: Minor
                      Found in core/js/sharedialogshareelistview.js - About 6 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language