owncloud/core

View on GitHub

Showing 3,235 of 4,503 total issues

File versionstabview.js has 298 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 apps/files_versions/js/versionstabview.js - About 3 hrs to fix

    File Util.php has 297 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: Minor
    Found in lib/public/Util.php - About 3 hrs to fix

      Function _onAdd has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _onAdd: function (e, data) {
                  var that = this,
                      result = true,
                      options = $.extend({}, this.options, data),
                      files = data.files,
      Severity: Major
      Found in apps/files/js/jquery.fileupload.js - About 3 hrs to fix

        Function _parseFileInfo has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _parseFileInfo: function(response) {
                    var path = this._extractPath(response.href);
                    // invalid subpath
                    if (path === null) {
                        return null;
        Severity: Major
        Found in core/js/files/client.js - About 3 hrs to fix

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

              public function __construct() {
                  $config = \OC::$server->getConfig();
                  $random = \OC::$server->getSecureRandom();
                  $db = \OC::$server->getDatabaseConnection();
                  $dispatcher = \OC::$server->getEventDispatcher();
          Severity: Major
          Found in apps/dav/lib/RootCollection.php - About 3 hrs to fix

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

            OC.L10N.register(
                "core",
                {
                "Please select a file." : "Prosím, vyberte súbor.",
                "File is too big" : "Súbor je príliš veľký",
            Severity: Minor
            Found in core/l10n/sk_SK.js - About 3 hrs to fix

              Function filePath has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  filePath: function (app, type, file) {
                      var isCore = OC.coreApps.indexOf(app) !== -1,
                          link = OC.getRootPath();
                      if (file.substring(file.length - 3) === 'php' && !isCore) {
                          link += '/index.php/apps/' + app;
              Severity: Minor
              Found in core/js/js.js - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function enterNode(\PhpParser\Node $node) {
                      if ($this->deprecatedClass) {
                          return;
                      }
              
              
              Severity: Minor
              Found in build/OCPSinceChecker.php - About 3 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 addUser has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function addUser() {
                      $userId = isset($_POST['userid']) ? $_POST['userid'] : null;
                      $password = isset($_POST['password']) ? $_POST['password'] : null;
                      $groups = isset($_POST['groups']) ? $_POST['groups'] : null;
                      $user = $this->userSession->getUser();
              Severity: Minor
              Found in apps/provisioning_api/lib/Users.php - About 3 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 calendarQuery has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function calendarQuery($calendarId, array $filters) {
                      $componentType = null;
                      $requirePostFilter = true;
                      $timeRange = null;
              
              
              Severity: Minor
              Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 3 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 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function execute(InputInterface $input, OutputInterface $output): int {
                      $inputPath = $input->getOption('path');
                      $groups = $input->getOption('groups') ? \explode(',', $input->getOption('groups')) : [];
                      $groups = \array_unique(\array_merge($groups, $input->getOption('group')));
                      $shouldRepairStoragesIndividually = (bool) $input->getOption('repair');
              Severity: Minor
              Found in apps/files/lib/Command/Scan.php - About 3 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 findInvalidShareOwner has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function findInvalidShareOwner(InputInterface $input, OutputInterface $output, $fix, $scopeUid) {
                      $output->writeln([
                          "<info>==========================</info>",
                          "<info>Searching for shares that have invalid uid_owner, meaning share uid_owner that does not match associated file storage id.</info>",
                          "<info>==========================</info>",
              Severity: Minor
              Found in apps/files/lib/Command/TroubleshootTransferOwnership.php - About 3 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 getById has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getById($id, $first = false) {
                      $mounts = $this->root->getMountsIn($this->path);
                      $mounts[] = $this->root->getMount($this->path);
                      // reverse the array so we start with the storage this view is in
                      // which is the most likely to contain the file we're looking for
              Severity: Minor
              Found in lib/private/Files/Node/Folder.php - About 3 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 fopen has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function fopen($path, $mode) {
                      $this->init();
                      $path = $this->cleanPath($path);
                      switch ($mode) {
                          case 'r':
              Severity: Minor
              Found in lib/private/Files/Storage/DAV.php - About 3 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 updateStorage has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function updateStorage(IStorageConfig $updatedStorage) {
                      $id = $updatedStorage->getId();
              
                      $existingMount = $this->dbConfig->getMountById($id);
              
              
              Severity: Minor
              Found in lib/private/Files/External/Service/StoragesService.php - About 3 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 removeSensitiveValue has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function removeSensitiveValue($keysToRemove, $value) {
                      if ($keysToRemove === true) {
                          return IConfig::SENSITIVE_VALUE;
                      }
              
              
              Severity: Minor
              Found in lib/private/SystemConfig.php - About 3 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 getPreview has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getPreview() {
                      if ($this->preview !== null && $this->preview->valid()) {
                          return $this->preview;
                      }
              
              
              Severity: Minor
              Found in lib/private/Preview.php - About 3 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 generatePreview has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function generatePreview() {
                      $file = $this->getFile();
                      $preview = null;
              
                      $previewProviders = \OC::$server->getPreviewManager()
              Severity: Minor
              Found in lib/private/Preview.php - About 3 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 installApp has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function installApp($data = []) {
                      $l = \OC::$server->getL10N('lib');
              
                      list($extractDir, $path) = self::downloadApp($data);
              
              
              Severity: Minor
              Found in lib/private/Installer.php - About 3 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 changeSchema has a Cognitive Complexity of 22 (exceeds 5 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: Minor
              Found in core/Migrations/Version20170101215145.php - About 3 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

              Severity
              Category
              Status
              Source
              Language