owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method execute has 69 lines of code (exceeds 25 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: Major
Found in apps/files_external/lib/Command/Import.php - About 2 hrs to fix

    Method copyBetweenStorage has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function copyBetweenStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
            // for versions we have nothing to do, because versions should always use the
            // key from the original file. Just create a 1:1 copy and done
            if ($this->isVersion($targetInternalPath) ||
                $this->isVersion($sourceInternalPath)) {
    Severity: Major
    Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 2 hrs to fix

      Method getAllStorages has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getAllStorages() {
              $mountPoints = $this->readLegacyConfig();
              /**
               * Here is the how the horribly messy mount point array looks like
               * from the mount.json file:
      Severity: Major
      Found in lib/private/Files/External/Service/LegacyStoragesService.php - About 2 hrs to fix

        Method run has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function run(IOutput $output) {
                if ($this->config->getSystemValue('has_internet_connection', true) !== true) {
                    $link = $this->defaults->buildDocLinkToKey('admin-marketplace-apps');
                    $output->info('No internet connection available - no app updates will be taken from the marketplace.');
                    $output->info("How to update apps in such situation please see $link");
        Severity: Major
        Found in lib/private/Repair/Apps.php - About 2 hrs to fix

          Method enterNode has 69 lines of code (exceeds 25 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: Major
          Found in lib/private/App/CodeChecker/NodeVisitor.php - About 2 hrs to fix

            Method listAllApps has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function listAllApps(bool $listEveryApp = false) {
                    $installedApps = OC_App::getAllApps();
            
                    //TODO which apps do we want to blacklist and how do we integrate
                    // blacklisting with the multi apps folder feature?
            Severity: Major
            Found in lib/private/legacy/app.php - About 2 hrs to fix

              Function add has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  add: function (user) {
                      if (this.currentGid && this.currentGid !== '_everyone' && user.groups[this.currentGid] === undefined) {
                          return;
                      }
              
              
              Severity: Minor
              Found in settings/js/users/users.js - About 2 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 getGroups has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function getGroups($search) {
                      $this->result['groups'] = $this->result['exact']['groups'] = [];
              
                      if (\strlen(\trim($search)) === 0 && $this->userSearch->getSearchMinLength() > 0) {
                          $this->result['groups'] = [];
              Severity: Minor
              Found in apps/files_sharing/lib/Controller/ShareesController.php - About 2 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 getTrashFiles has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getTrashFiles($dir, $user, $sortAttribute = '', $sortDescending = false, $addExtraData = true) {
                      $result = [];
                      $timestamp = null;
              
                      $view = new \OC\Files\View('/' . $user . '/files_trashbin/files');
              Severity: Minor
              Found in apps/files_trashbin/lib/Helper.php - About 2 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 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function fopen($path, $mode) {
                      $pos = \strrpos($path, '.');
                      if ($pos !== false) {
                          $ext = \substr($path, $pos);
                      } else {
              Severity: Minor
              Found in apps/files_external/lib/Lib/Storage/Google.php - About 2 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 getAutoExpireList has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected static function getAutoExpireList($time, $versions) {
                      $size = 0;
                      $toDelete = [];  // versions we want to delete
              
                      $interval = 1;
              Severity: Minor
              Found in apps/files_versions/lib/Storage.php - About 2 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 searchCommon has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function searchCommon($method, $args) {
                      $files = [];
                      $rootLength = \strlen($this->fakeRoot);
              
                      $mount = $this->getMount('');
              Severity: Minor
              Found in lib/private/Files/View.php - About 2 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 calculateFolderSize has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function calculateFolderSize($path, $entry = null) {
                      $totalSize = 0;
                      if ($entry === null or !isset($entry['fileid'])) {
                          $entry = $this->get($path);
                      }
              Severity: Minor
              Found in lib/private/Files/Cache/Cache.php - About 2 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 getAllSharedWith has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getAllSharedWith($userId, $node) {
                      // Create array of sharedWith objects (target user -> $userId or group of which user is a member
                      $user = $this->userManager->get($userId);
              
                      // Check if user is member of some groups and chunk them
              Severity: Minor
              Found in lib/private/Share20/DefaultShareProvider.php - About 2 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 getSingleFile has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  private static function getSingleFile($view, $dir, $name, $params) {
                      $filename = "{$dir}/{$name}";
                      OC_Util::obEnd();
                      $view->lockFile($filename, ILockingProvider::LOCK_SHARED);
              
              
              Severity: Minor
              Found in lib/private/legacy/files.php - About 2 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 auth has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function auth(IRequest $request) {
                      if (!isset($request->server['PHP_AUTH_USER'], $request->server['PHP_AUTH_PW'])) {
                          return null;
                      }
                      if ($this->session->exists('app_password')) {
              Severity: Minor
              Found in lib/private/User/BasicAuthModule.php - About 2 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 _createRow has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _createRow: function(fileData) {
                          // TODO: hook earlier and render the whole row here
                          var $tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments);
                          var td;
                          var formatted;
              Severity: Major
              Found in apps/files_sharing/js/sharedfilelist.js - About 2 hrs to fix

                File ca.js has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                OC.L10N.register(
                    "core",
                    {
                    "Please select a file." : "Si us plau, selecciona un fitxer",
                    "File is too big" : "El fitxer és massa gran",
                Severity: Minor
                Found in core/l10n/ca.js - About 2 hrs to fix

                  Method getDenormalizedData has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getDenormalizedData($calendarData) {
                          $vObject = Reader::read($calendarData);
                          $componentType = null;
                          $component = null;
                          $firstOccurrence = null;
                  Severity: Major
                  Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 2 hrs to fix

                    Method propFind has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function propFind(PropFind $propFind, INode $node) {
                            // properties about the share
                            if ($node instanceof PublicSharedRootNode) {
                                $propFind->handle(self::PUBLIC_LINK_ITEM_TYPE, static function () use ($node) {
                                    return $node->getShare()->getNodeType();
                    Severity: Major
                    Found in apps/dav/lib/Files/PublicFiles/PublicFilesPlugin.php - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language