owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        $AppName,
        IRequest $request,
        IL10N $l10n,
        IUserGlobalStoragesService $userGlobalStoragesService,
        IUserSession $userSession,
Severity: Minor
Found in apps/files_external/lib/Controller/UserGlobalStoragesController.php - About 45 mins to fix

    Function updateTags has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private function updateTags($fileId, $tags) {
            $tagger = $this->getTagger();
            $currentTags = $this->getTags($fileId);
    
            $newTags = \array_diff($tags, $currentTags);
    Severity: Minor
    Found in apps/dav/lib/Connector/Sabre/TagsPlugin.php - About 45 mins 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 scanFiles has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function scanFiles($user, $path, $verbose, OutputInterface $output, $backgroundScan = false, $shouldRepair = false) {
    Severity: Minor
    Found in apps/files/lib/Command/Scan.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (self::metaEnabled()) {
                                  $versionFileInfo = $view->getFileInfo("$dir/$entryName");
                                  if ($versionFileInfo) {
                                      $versionMetadata = self::$metaData->getVersionMetadata($versionFileInfo);
      
      
      Severity: Major
      Found in apps/files_versions/lib/Storage.php - About 45 mins to fix

        Method userScan has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected function userScan($users, $inputPath, $shouldRepairStoragesIndividually, $input, $output, $verbose) {
        Severity: Minor
        Found in apps/files/lib/Command/Scan.php - About 45 mins to fix

          Function dependencyMessage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function dependencyMessage($backends) {
                  $l = \OC::$server->getL10N('files_external');
                  $message = '';
                  $dependencyGroups = [];
          
          
          Severity: Minor
          Found in apps/files_external/lib/config.php - About 45 mins 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 touch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function touch($path, $mtime = null) {
                  $file = $this->getDriveFile($path);
                  $toUpdate = new DriveFile();
                  $result = false;
                  if ($file) {
          Severity: Minor
          Found in apps/files_external/lib/Lib/Storage/Google.php - About 45 mins 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 delete has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function delete($path) {
                  $deletedFile = self::$deletedFiles[$path];
                  $uid = $deletedFile['uid'];
                  $filename = $deletedFile['filename'];
          
          
          Severity: Minor
          Found in apps/files_versions/lib/Storage.php - About 45 mins 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 scanFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function scanFiles($user, $path, $verbose, OutputInterface $output, $backgroundScan = false, $shouldRepair = false) {
                  $connection = $this->reconnectToDatabase($output);
                  $scanner = new \OC\Files\Utils\Scanner($user, $connection, \OC::$server->getLogger());
                  if ($shouldRepair) {
                      $scanner->listen('\OC\Files\Utils\Scanner', 'beforeScanStorage', function ($storage) use ($output, $connection) {
          Severity: Minor
          Found in apps/files/lib/Command/Scan.php - About 45 mins 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 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  IUserManager $userManager,
                  IManager $shareManager,
                  IMountManager $mountManager,
                  IRootFolder $rootFolder,
                  Manager $encryptionManager,
          Severity: Minor
          Found in apps/files/lib/Command/TransferOwnership.php - About 45 mins to fix

            Function processUserChunks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function processUserChunks($input, $output, $users, $inputPath, $shouldRepairStoragesIndividually, $group = null) {
                    # no messaging level option means: no full printout but statistics
                    # $quiet   means no print at all
                    # $verbose means full printout including statistics
                    # -q    -v    full    stat
            Severity: Minor
            Found in apps/files/lib/Command/Scan.php - About 45 mins 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 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    IUserManager $userManager,
                    IGroupManager $groupManager,
                    ILockingProvider $lockingProvider,
                    IMimeTypeLoader $mimeTypeLoader,
                    ILogger $logger,
            Severity: Minor
            Found in apps/files/lib/Command/Scan.php - About 45 mins to fix

              Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function __construct($params) {
                      // extract context path from host if specified
                      // (owncloud install path on host)
                      $host = $params['host'];
                      // strip protocol
              Severity: Minor
              Found in apps/files_external/lib/Lib/Storage/OwnCloud.php - About 45 mins 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 readMetaFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function readMetaFile(string $diskPath) {
                      if (!\file_exists($diskPath)) {
                          return [];
                      }
              
              
              Severity: Minor
              Found in apps/files_versions/lib/MetaStorage.php - About 45 mins 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 processUserChunks has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  protected function processUserChunks($input, $output, $users, $inputPath, $shouldRepairStoragesIndividually, $group = null) {
              Severity: Minor
              Found in apps/files/lib/Command/Scan.php - About 45 mins to fix

                Method getItemsSharedWithUser has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $itemType,
                        $user,
                        $format = self::FORMAT_NONE,
                        $parameters = null,
                        $limit = -1,
                Severity: Minor
                Found in lib/public/Share.php - About 45 mins to fix

                  Function getStatusInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function getStatusInfo($includeVersion = false, $serverHide = false, $hostnameShort = false) {
                          $systemConfig = \OC::$server->getSystemConfig();
                  
                          $installed = (bool) $systemConfig->getValue('installed', false);
                          $maintenance = (bool) $systemConfig->getValue('maintenance', false);
                  Severity: Minor
                  Found in lib/public/Util.php - About 45 mins 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 getSharesBy has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function getSharesBy($userId, $shareType, $path = null, $reshares = false, $limit = 50, $offset = 0);
                  Severity: Minor
                  Found in lib/public/Share/IManager.php - About 45 mins to fix

                    Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function __construct(IFactory $languageFactory, IURLGenerator $URLGenerator, IManager $activityManager, ActivityHelper $helper, IDBConnection $connection, IConfig $config) {
                    Severity: Minor
                    Found in apps/files/lib/Activity.php - About 45 mins to fix

                      Method translate has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode);
                      Severity: Minor
                      Found in lib/public/Activity/IManager.php - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language