owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Function checkPassword has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPassword($loginName, $password) {
        $loginName = \str_replace("\0", '', $loginName);
        $password = \str_replace("\0", '', $password);

        if (empty($this->backends)) {
Severity: Minor
Found in lib/private/User/Manager.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete(): bool {
        if ($this->emitter) {
            $this->emitter->emit('\OC\User', 'preDelete', [$this]);
        }
        // get the home now because it won't return it after user deletion
Severity: Minor
Found in lib/private/User/User.php - About 35 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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        // collate config setting to the end, to avoid partial configuration
        $toBeSet = [];

        if ($backend = $input->getOption('backend')) {
Severity: Minor
Found in core/Command/Log/Manage.php - About 35 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 validateAppsArray has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function validateAppsArray($array) {
        foreach ($array as $app => $configs) {
            foreach ($configs as $name => $value) {
                if (!\is_int($value) && !\is_string($value) && $value !== null) {
                    throw new \UnexpectedValueException('Invalid app config value for "' . $app . '":"' . $name . '". Only integers, strings and null (delete) are allowed.');
Severity: Minor
Found in core/Command/Config/Import.php - About 35 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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function run($post) {
        // Check for autosetup:
        $post = $this->loadAutoConfig($post);
        $opts = $this->setupHelper->getSystemInfo();

Severity: Minor
Found in core/Controller/SetupController.php - About 35 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 openWithWeb has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function openWithWeb(?string $file_id, ?string $app_name): DataResponse {
        $userAgent = $this->request->getHeader('User-Agent') ?? '-';
        $this->logger->info("openWithWeb($file_id, $app_name) - $userAgent");
        $fileId = $this->extractFileId($file_id);
        $nodes = $this->rootFolder->getById($fileId, true);
Severity: Minor
Found in core/Controller/AppRegistryController.php - About 35 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 too many return statements within this function.
Open

            return true;
Severity: Major
Found in apps/files_trashbin/js/filelist.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return true;
    Severity: Major
    Found in apps/files_trashbin/js/filelist.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                              return -1;
      Severity: Major
      Found in settings/js/users/groups.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                return 1;
        Severity: Major
        Found in settings/js/users/groups.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return UserList.alphanum(
                              $(a).find('a span').text(),
                              $(b).find('a span').text()
                          );
          Severity: Major
          Found in settings/js/users/groups.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            return false;
            Severity: Major
            Found in apps/files_trashbin/js/filelist.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return true;
              Severity: Major
              Found in apps/files/js/filelist.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return false;
                Severity: Major
                Found in apps/files/js/filelist.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return response;
                  Severity: Major
                  Found in apps/files/js/file-upload.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return false;
                    Severity: Major
                    Found in apps/files/js/file-upload.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return true;
                      Severity: Major
                      Found in apps/files/js/file-upload.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return true;
                        Severity: Major
                        Found in apps/files/js/filelist.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return icon.split('-')[0];
                          Severity: Major
                          Found in core/js/mimetype.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return icon;
                            Severity: Major
                            Found in core/js/mimetype.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language