owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

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

    public static function getFullDomain($url) {
        $parts = \parse_url($url);
        if ($parts === false) {
            throw new \InvalidArgumentException('Invalid url "' . $url . '"');
        }
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

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

    public function loadPanels($type) {
        // If already loaded just return
        if (!empty($this->panels[$type])) {
            return $this->panels[$type];
        }
Severity: Minor
Found in lib/private/Settings/SettingsManager.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 begin has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function begin($path, $user, $mode, array $header, array $accessList, $sourceFileOfRename);
Severity: Minor
Found in lib/public/Encryption/IEncryptionModule.php - About 45 mins to fix

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

        public static function checkConfig() {
            $l = \OC::$server->getL10N('lib');
    
            // Create config if it does not already exist
            $configFilePath = self::$configDir .'/config.php';
    Severity: Minor
    Found in lib/kernel.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

            IAppManager $appManager = null,
            IURLGenerator $urlGenerator = null,
            IFactory $l10nFac = null,
            IUserSession $userSession = null,
            IGroupManager $groupManager = null,
    Severity: Minor
    Found in lib/private/NavigationManager.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/IExtension.php - About 45 mins to fix

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

            public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset);
        Severity: Minor
        Found in lib/public/Share/IShareProvider.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 apps/files/lib/Activity.php - About 45 mins to fix

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

                public static function sendMail(
                    $toaddress,
                    $toname,
                    $subject,
                    $mailtext,
            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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function __construct($gid, $backends, $userManager, EventDispatcherInterface $eventDispatcher, $emitter = null, $displayName = null) {
            Severity: Minor
            Found in lib/private/Group/Group.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ($user !== null && \in_array($user->getUID(), $logCondition['users'], true)) {
                                              $this->logConditionSatisfied = true;
                                              if (!empty($logCondition['logfile'])) {
                                                  $logConditionFile = $logCondition['logfile'];
                                              }
              Severity: Major
              Found in lib/private/Log.php - About 45 mins to fix

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

                    private function getCacheEntry($storage, $internalPath, $relativePath) {
                        $cache = $storage->getCache($internalPath);
                        $data = $cache->get($internalPath);
                        $watcher = $storage->getWatcher($internalPath);
                
                
                Severity: Minor
                Found in lib/private/Files/View.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 getSourcePath has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getSourcePath($path) {
                        $fullPath = $this->datadir . $path;
                        if ($this->allowSymlinks || $path === '') {
                            return $fullPath;
                        }
                Severity: Minor
                Found in lib/private/Files/Storage/Local.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

                    public function __construct($path, $storage, $internalPath, $data, $mount, $owner= null) {
                Severity: Minor
                Found in lib/private/Files/FileInfo.php - About 45 mins to fix

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

                      private function runHooks($hooks, $path, $post = false) {
                          if (empty($hooks)) {
                              return true;
                          }
                          $relativePath = $path;
                  Severity: Minor
                  Found in lib/private/Files/View.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

                  Avoid deeply nested control flow statements.
                  Open

                                              if ($extOnly && $subStorage instanceof \OCA\Files_Sharing\SharedStorage) {
                                                  continue;
                                              }
                  Severity: Major
                  Found in lib/private/Files/View.php - About 45 mins to fix

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

                        protected function searchInDir($query, $dir = '') {
                            $files = [];
                            $physicalDir = $this->getSourcePath($dir);
                            foreach (\scandir($physicalDir) as $item) {
                                if (\OC\Files\Filesystem::isIgnoredDir($item)) {
                    Severity: Minor
                    Found in lib/private/Files/Storage/Local.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

                    Avoid deeply nested control flow statements.
                    Open

                                                if ($first) {
                                                    break;
                                                }
                    Severity: Major
                    Found in lib/private/Files/Node/Folder.php - About 45 mins to fix

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

                          public function clear($prefix = '') {
                              $prefix = $this->getNamespace() . $prefix;
                              $allKeys = self::$cache->getAllKeys();
                              if ($allKeys === false) {
                                  // newer Memcached doesn't like getAllKeys(), flush everything
                      Severity: Minor
                      Found in lib/private/Memcache/Memcached.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

                      Avoid deeply nested control flow statements.
                      Open

                                                  if (\hash_equals($logCondition['shared_secret'], $q['log_secret'] ?? '')) {
                                                      $this->logConditionSatisfied = true;
                                                      if (!empty($logCondition['logfile'])) {
                                                          $logConditionFile = $logCondition['logfile'];
                                                      }
                      Severity: Major
                      Found in lib/private/Log.php - About 45 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language