owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        render: function() {
            var defaultExpireMessage = '';
            var defaultExpireDays = this.configModel.get('defaultExpireDate');
            var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');

Severity: Minor
Found in core/js/sharedialoglinkexpirationview.js - About 1 hr to fix

    Method getPanel has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getPanel() {
            // create htaccess test file
            $util = new \OC_Util();
            $util->createHtaccessTestFile($this->config);
    
    
    Severity: Minor
    Found in settings/Panels/Admin/SecurityWarning.php - About 1 hr to fix

      Method resendInvitation has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function resendInvitation($userId) {
              $user = $this->userManager->get($userId);
              $currentUser = $this->userSession->getUser();
      
              if ($user === null || $this->userTypeHelper->isGuestUser($userId) === true) {
      Severity: Minor
      Found in settings/Controller/UsersController.php - About 1 hr to fix

        Method execute has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output): int {
                $mountId = $input->getArgument('mount_id');
                try {
                    $mount = $this->globalService->getStorage($mountId);
                } catch (NotFoundException $e) {
        Severity: Minor
        Found in apps/files_external/lib/Command/Applicable.php - About 1 hr to fix

          Method collectUsersShares has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function collectUsersShares(InputInterface $input, OutputInterface $output) {
                  $output->writeln("Collecting all share information for files and folder of $this->sourceUser ...");
          
                  $skipped = 0;
                  $progress = new ProgressBar($output, \count($this->shares));
          Severity: Minor
          Found in apps/files/lib/Command/TransferOwnership.php - About 1 hr to fix

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

                public function rename($source, $target) {
                    $this->log("enter: rename('$source', '$target')", Util::DEBUG);
            
                    if ($this->isRootDir($source) || $this->isRootDir($target)) {
                        $this->log("refusing to rename \"$source\" to \"$target\"");
            Severity: Minor
            Found in apps/files_external/lib/Lib/Storage/SMB.php - About 1 hr to fix

              Method getChildrenWithFilter has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function getChildrenWithFilter($fileId, $mimetypeFilter = null) {
                      if ($fileId > -1) {
                          $qb = $this->connection->getQueryBuilder();
                          $qb->select(
                              'fileid',
              Severity: Minor
              Found in lib/private/Files/Cache/Cache.php - About 1 hr to fix

                Method getStorageConfigFromDBMount has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getStorageConfigFromDBMount(array $mount) {
                        $applicableUsers = \array_filter($mount['applicable'], function ($applicable) {
                            return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_USER;
                        });
                        $applicableUsers = \array_map(function ($applicable) {
                Severity: Minor
                Found in lib/private/Files/External/Service/StoragesService.php - About 1 hr to fix

                  Method delete has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function delete($names) {
                          if (!\is_array($names)) {
                              $names = [$names];
                          }
                  
                  
                  Severity: Minor
                  Found in lib/private/Tags.php - About 1 hr to fix

                    Method getRepairSteps has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function getRepairSteps() {
                            return [
                                new RepairMimeTypes(\OC::$server->getConfig()),
                                new RepairMismatchFileCachePath(
                                    \OC::$server->getDatabaseConnection(),
                    Severity: Minor
                    Found in lib/private/Repair.php - About 1 hr to fix

                      Method process has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function process(bool $all = false, int $chunkSize = 1000, \Closure $progress = null): int {
                              $root = \OC::$server->getLazyRootFolder();
                              $count = 0;
                      
                              $qb = $this->connection->getQueryBuilder();
                      Severity: Minor
                      Found in lib/private/PreviewCleanup.php - About 1 hr to fix

                        Method normalizeVersion has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function normalizeVersion($version, $fullVersion = null) {
                                $version = \trim($version);
                                if ($fullVersion === null) {
                                    $fullVersion = $version;
                                }
                        Severity: Minor
                        Found in lib/private/App/PlatformRepository.php - About 1 hr to fix

                          Method loadIndex has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function loadIndex($table, $xml) {
                                  $name = null;
                                  $fields = [];
                                  foreach ($xml->children() as $child) {
                                      /**
                          Severity: Minor
                          Found in lib/private/DB/MDB2SchemaReader.php - About 1 hr to fix

                            Method createUser has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function createUser($uid, $password) {
                                    return $this->emittingCall(function () use (&$uid, &$password) {
                                        $l = \OC::$server->getL10N('lib');
                            
                                        // Check the name for bad characters
                            Severity: Minor
                            Found in lib/private/User/Manager.php - About 1 hr to fix

                              Method configure has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function configure() {
                                      $this
                                          ->setName('user:sync')
                                          ->setDescription('Synchronize users from a given backend to the accounts table.')
                                          ->addArgument(
                              Severity: Minor
                              Found in core/Command/User/SyncBackend.php - About 1 hr to fix

                                Function getShares has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function getShares($includingPending = false) {
                                        $shares = [];
                                        $groupExternalManager = null;
                                
                                        foreach ($this->externalManager->getAcceptedShares() as $shareInfo) {
                                Severity: Minor
                                Found in apps/files_sharing/lib/Controller/RemoteOcsController.php - About 1 hr 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 doDelete has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private function doDelete($path, $method) {
                                        if (self::$disableTrash
                                            || !\OC_App::isEnabled('files_trashbin')
                                            || (\pathinfo($path, PATHINFO_EXTENSION) === 'part')
                                            || $this->shouldMoveToTrash($path) === false
                                Severity: Minor
                                Found in apps/files_trashbin/lib/Storage.php - About 1 hr 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 checkQuota has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function checkQuota($path, $length = null, $extraSpace = 0) {
                                        if ($length === null) {
                                            $length = $this->getLength();
                                        }
                                        if ($length !== null) {
                                Severity: Minor
                                Found in apps/dav/lib/Connector/Sabre/QuotaPlugin.php - About 1 hr 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 restoreShares has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private function restoreShares(OutputInterface $output) {
                                        $output->writeln("Restoring shares ...");
                                        $progress = new ProgressBar($output, \count($this->shares));
                                        $status = 0;
                                
                                
                                Severity: Minor
                                Found in apps/files/lib/Command/TransferOwnership.php - About 1 hr 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 findRegisteredSections has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    protected function findRegisteredSections($type) {
                                        $sections = [];
                                        foreach ($this->appManager->getEnabledAppsForUser($this->userSession->getUser()) as $app) {
                                            if (isset($this->appManager->getAppInfo($app)['settings-sections'])) {
                                                foreach ($this->appManager->getAppInfo($app)['settings-sections'] as $t => $section) {
                                Severity: Minor
                                Found in lib/private/Settings/SettingsManager.php - About 1 hr 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