owncloud/core

View on GitHub

Showing 3,235 of 4,503 total issues

Function add has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    add: function (user) {
        if (this.currentGid && this.currentGid !== '_everyone' && user.groups[this.currentGid] === undefined) {
            return;
        }

Severity: Major
Found in settings/js/users/users.js - About 4 hrs to fix

    Method fopen has 103 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function fopen($path, $mode) {
            // check if the file is stored in the array cache, this means that we
            // copy a file over to the versions folder, in this case we don't want to
            // decrypt it
            if ($this->arrayCache->hasKey('encryption_copy_version_' . $path)) {
    Severity: Major
    Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 4 hrs to fix

      File systemtagsinputfield.js has 338 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/systemtags/systemtagsinputfield.js - About 4 hrs to fix

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

        OC.L10N.register(
            "core",
            {
            "Please select a file." : "Selecteer een bestand.",
            "File is too big" : "Bestand te groot",
        Severity: Minor
        Found in core/l10n/nl.js - About 4 hrs to fix

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

          OC.L10N.register(
              "core",
              {
              "Please select a file." : "Vennligst velg en fil.",
              "File is too big" : "Filen er for stor",
          Severity: Minor
          Found in core/l10n/nb_NO.js - About 4 hrs to fix

            Function getAssignableAndRemovableGroups has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getAssignableAndRemovableGroups() {
                    $assignableGroups = [];
                    $removableGroups = [];
            
                    $currentUser = $this->userSession->getUser();
            Severity: Minor
            Found in settings/Controller/GroupsController.php - About 4 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 getDenormalizedData has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getDenormalizedData($calendarData) {
                    $vObject = Reader::read($calendarData);
                    $componentType = null;
                    $component = null;
                    $firstOccurrence = null;
            Severity: Minor
            Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 4 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 28 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function execute(InputInterface $input, OutputInterface $output): int {
                    $user = $input->getOption('user');
                    $path = $input->getArgument('path');
                    if ($path === '-') {
                        $json = \file_get_contents('php://stdin');
            Severity: Minor
            Found in apps/files_external/lib/Command/Import.php - About 4 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 changeUserPassword has 102 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function changeUserPassword($args) {
                    // Check if we are an user
                    \OC_JSON::callCheck();
                    \OC_JSON::checkLoggedIn();
            
            
            Severity: Major
            Found in settings/ChangePassword/Controller.php - About 4 hrs to fix

              Method rename has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function rename($path1, $path2) {
                      return $this->emittingCall(function () use (&$path1, &$path2) {
                          $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
                          $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
                          $result = false;
              Severity: Major
              Found in lib/private/Files/View.php - About 4 hrs to fix

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

                    public function changeSchema(Schema $schema, array $options) {
                        $prefix = $options['tablePrefix'];
                        if (!$schema->hasTable("{$prefix}external_mounts")) {
                            $table = $schema->createTable("{$prefix}external_mounts");
                            $table->addColumn('mount_id', 'bigint', [
                Severity: Major
                Found in core/Migrations/Version20170111103310.php - About 4 hrs to fix

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

                  OC.L10N.register(
                      "core",
                      {
                      "Please select a file." : "Silakan pilih sebuah berkas.",
                      "File is too big" : "Berkas terlalu besar",
                  Severity: Minor
                  Found in core/l10n/id.js - About 4 hrs to fix

                    AbstractNode has 32 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    abstract class AbstractNode implements \OCP\Files\Node {
                        /**
                         * @inheritdoc
                         */
                        public function getMimePart() {
                    Severity: Minor
                    Found in lib/private/Files/Node/AbstractNode.php - About 4 hrs to fix

                      FileInfo has 32 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
                          /**
                           * @var array $data
                           */
                          private $data;
                      Severity: Minor
                      Found in lib/private/Files/FileInfo.php - About 4 hrs to fix

                        Encryption has 32 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Encryption extends Wrapper {
                            use LocalTempFileTrait;
                        
                            /** @var string */
                            private $mountPoint;
                        Severity: Minor
                        Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 4 hrs to fix

                          OC_User has 32 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class OC_User {
                              /**
                               * @return \OC\User\Session
                               */
                              public static function getUserSession() {
                          Severity: Minor
                          Found in lib/private/legacy/user.php - About 4 hrs to fix

                            Notification has 32 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Notification implements INotification {
                                /** @var string */
                                protected $app;
                            
                                /** @var string */
                            Severity: Minor
                            Found in lib/private/Notification/Notification.php - About 4 hrs to fix

                              User has 32 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class User implements IUser {
                                  use EventEmitterTrait;
                              
                                  /** @var Account */
                                  private $account;
                              Severity: Minor
                              Found in lib/private/User/User.php - About 4 hrs to fix

                                File DIContainer.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                <?php
                                /**
                                 * @author Bernhard Posselt <dev@bernhard-posselt.com>
                                 * @author Christoph Wurst <christoph@owncloud.com>
                                 * @author Joas Schilling <coding@schilljs.com>
                                Severity: Minor
                                Found in lib/private/AppFramework/DependencyInjection/DIContainer.php - About 4 hrs to fix

                                  File share.js has 332 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: Minor
                                  Found in apps/files_sharing/js/share.js - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language