owncloud/core

View on GitHub
lib/private/Encryption/DecryptAll.php

Summary

Maintainability
C
1 day
Test Coverage

Function decryptUsersFiles has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    protected function decryptUsersFiles($uid, ProgressBar $progress, $userCount) {
        $this->setupUserFS($uid);
        $directories = [];
        $directories[] = '/' . $uid . '/files';

Severity: Minor
Found in lib/private/Encryption/DecryptAll.php - About 4 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

Method decryptAllUsersFiles has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function decryptAllUsersFiles($user = '') {
        $this->output->writeln("\n");

        $progress = new ProgressBar($this->output);
        $progress->setFormat(" %message% \n [%bar%]");
Severity: Minor
Found in lib/private/Encryption/DecryptAll.php - About 1 hr to fix

    Method decryptUsersFiles has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function decryptUsersFiles($uid, ProgressBar $progress, $userCount) {
            $this->setupUserFS($uid);
            $directories = [];
            $directories[] = '/' . $uid . '/files';
    
    
    Severity: Minor
    Found in lib/private/Encryption/DecryptAll.php - About 1 hr to fix

      Function decryptAllUsersFiles has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function decryptAllUsersFiles($user = '') {
              $this->output->writeln("\n");
      
              $progress = new ProgressBar($this->output);
              $progress->setFormat(" %message% \n [%bar%]");
      Severity: Minor
      Found in lib/private/Encryption/DecryptAll.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 decryptAll has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function decryptAll(InputInterface $input, OutputInterface $output, $user = '') {
              $this->input = $input;
              $this->output = $output;
      
              if ($user !== '' && $this->userManager->userExists($user) === false) {
      Severity: Minor
      Found in lib/private/Encryption/DecryptAll.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 decryptAll has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function decryptAll(InputInterface $input, OutputInterface $output, $user = '') {
              $this->input = $input;
              $this->output = $output;
      
              if ($user !== '' && $this->userManager->userExists($user) === false) {
      Severity: Minor
      Found in lib/private/Encryption/DecryptAll.php - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status