owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method publishActivity has 10 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function publishActivity($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority) {
Severity: Major
Found in lib/private/Activity/Manager.php - About 1 hr to fix

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

            IManager $shareManager,
            IL10N $l10n,
            IMailer $mailer,
            IConfig $config,
            ILogger $logger,
    Severity: Major
    Found in lib/private/Share/MailNotifications.php - About 1 hr to fix

      Function getTempBaseDir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getTempBaseDir(): string {
              if ($this->tmpBaseDir) {
                  return $this->tmpBaseDir;
              }
      
      
      Severity: Minor
      Found in lib/private/TempManager.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 publish has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function publish(IEvent $event) {
              if (!$event->getApp()) {
                  throw new \BadMethodCallException('App not set', 10);
              }
              if (!$event->getType()) {
      Severity: Minor
      Found in lib/private/Activity/Manager.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 addStep has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addStep($repairStep) {
              if (\is_string($repairStep)) {
                  try {
                      $s = \OC::$server->query($repairStep);
                  } catch (QueryException $e) {
      Severity: Minor
      Found in lib/private/Repair.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 populateStorageConfigWithLegacyOptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function populateStorageConfigWithLegacyOptions(
              &$storageConfig,
              $mountType,
              $applicable,
              $storageOptions
      Severity: Minor
      Found in lib/private/Files/External/Service/LegacyStoragesService.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 getBackendStatus has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getBackendStatus($class, $options, $isPersonal, $testOnly = true) {
              if (self::$skipTest) {
                  return StorageNotAvailableException::STATUS_SUCCESS;
              }
              $user = \OC::$server->getUserSession()->getUser();
      Severity: Minor
      Found in lib/private/Files/External/LegacyUtil.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

      Method put has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $itemType,
              $itemSource,
              $shareType,
              $shareWith,
              $uidOwner,
      Severity: Major
      Found in lib/private/Share/Share.php - About 1 hr to fix

        Function readData has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            private function readData() {
                // Default config should always get loaded
                $configFiles = [$this->configFilePath];
        
                // Add all files in the config dir ending with the same file name
        Severity: Minor
        Found in lib/private/Config.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 updateForRecipient has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function updateForRecipient(\OCP\Share\IShare $share, $recipient) {
                if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
                    if ($share->getSharedWith() !== $recipient) {
                        throw new ProviderException('Recipient does not match');
                    }
        Severity: Minor
        Found in lib/private/Share20/DefaultShareProvider.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 isCached has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function isCached() {
                $fileId = $this->getFile()->getId();
                if ($fileId === null) {
                    return false;
                }
        Severity: Minor
        Found in lib/private/Preview.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 isAppDirWritable has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function isAppDirWritable($appId) {
                $path = self::getAppPath($appId);
                // Check if the parent directory is marked as writable in config.php
                if ($path !== false) {
                    $appDir = \substr($path, 0, -\strlen("/$appId"));
        Severity: Minor
        Found in lib/private/legacy/app.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 canEnableTheme has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function canEnableTheme($appId) {
                $info = $this->getAppInfo($appId);
                if (
                    isset($info['types'])
                    && \is_array($info['types'])
        Severity: Minor
        Found in lib/private/App/AppManager.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 analyzeOC has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            private function analyzeOC(array $dependencies, array $appInfo) {
                $missing = [];
                $minVersion = null;
                if (isset($dependencies['owncloud']['@attributes']['min-version'])) {
                    $minVersion = $dependencies['owncloud']['@attributes']['min-version'];
        Severity: Minor
        Found in lib/private/App/DependencyAnalyzer.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 html_select_options has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        function html_select_options($options, $selected, $params= []) {
            if (!\is_array($selected)) {
                $selected= [$selected];
            }
            if (isset($params['combine']) && $params['combine']) {
        Severity: Minor
        Found in lib/private/legacy/template/functions.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 emit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function emit($signalClass, $signalName, $params = []) {
                // Return false if no hook handlers are listening to this
                // emitting class
                if (!\array_key_exists($signalClass, self::$registered)) {
                    return false;
        Severity: Minor
        Found in lib/private/legacy/hook.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 getAccessList has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getAccessList($path) {
                // Make sure that a share key is generated for the owner too
                list($owner, $ownerPath) = $this->util->getUidAndFilename($path);
        
                // always add owner to the list of users with access to the file
        Severity: Minor
        Found in lib/private/Encryption/File.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 isAuthorised has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function isAuthorised($action) {
                $level = $action['authlevel'];
                switch ($level) {
                    case API::GUEST_AUTH:
                        // Anyone can access
        Severity: Minor
        Found in lib/private/legacy/api.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 getFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getFile($size) {
                $ext = $this->getExtension();
        
                $basePath = "{$this->path}/avatar.$ext";
        
        
        Severity: Minor
        Found in lib/private/Avatar.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 getProviders has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getProviders(IUser $user) {
                $allApps = $this->appManager->getEnabledAppsForUser($user);
                $providers = [];
        
                foreach ($allApps as $appId) {
        Severity: Minor
        Found in lib/private/Authentication/TwoFactorAuth/Manager.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