owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

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

    public function quoteColumnName($string) {
        if ($string instanceof IParameter || $string instanceof ILiteral || $string instanceof IQueryFunction) {
            return (string) $string;
        }

Severity: Minor
Found in lib/private/DB/QueryBuilder/QuoteHelper.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 decrypt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function decrypt($authenticatedCiphertext, $password = '') {
        if ($password === '') {
            $password = $this->config->getSystemValue('secret');
        }

Severity: Minor
Found in lib/private/Security/Crypto.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 setValues has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function setValues($table, array $keys, array $values, array $updatePreconditionValues = []) {
        // Try to insert whole record into the table ($toInsert) if predicate NOT EXISTS ($compare) is satisfied
        $toInsert = \array_merge($keys, $values);
        $compare = \array_keys($keys);
        $tableName = $this->tablePrefix . $table;
Severity: Minor
Found in lib/private/DB/Connection.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(AppManager $appManager, ISession $session, IGroupManager $groupManager, IConfig $config, IRequest $request, ILogger $logger) {
Severity: Minor
Found in lib/private/Authentication/TwoFactorAuth/Manager.php - About 45 mins to fix

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

        public function l($type, $data = null, $options = []) {
            // Use the language of the instance
            $locale = $this->getLanguageCode();
            if ($locale === 'sr@latin') {
                $locale = 'sr_latn';
    Severity: Minor
    Found in lib/private/L10N/L10N.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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function run(UserInterface $backend, \Traversable $userIds, \Closure $callback = null) {
            // update existing and insert new users
            foreach ($userIds as $uid) {
                try {
                    $account = $this->createOrSyncAccount($uid, $backend);
    Severity: Minor
    Found in lib/private/User/SyncService.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 execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output): int {
            $toBeSet = [];
    
            if ($input->getOption('enable')) {
                $toBeSet['log_type'] = 'owncloud';
    Severity: Minor
    Found in core/Command/Log/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 analyzeStream has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function analyzeStream($stream, array $processors = [], int $maxBytes = PHP_INT_MAX) {
            $byteCount = 0;
            $map = [];
            $processorActions = [
                'count' => 'processCountChars',
    Severity: Minor
    Found in lib/private/Utf8Analyzer.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 getNext has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getNext() {
            $query = $this->connection->getQueryBuilder();
            $query->select('*')
                ->from('jobs')
                ->where($query->expr()->lte('reserved_at', $query->createNamedParameter($this->timeFactory->getTime() - 12 * 3600, IQueryBuilder::PARAM_INT)))
    Severity: Minor
    Found in lib/private/BackgroundJob/JobList.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 changeSchema has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function changeSchema(Schema $schema, array $options) {
            $prefix = $options['tablePrefix'];
            if (!$schema->hasTable("{$prefix}account_terms")) {
                $table = $schema->createTable("{$prefix}account_terms");
    
    
    Severity: Minor
    Found in core/Migrations/Version20170516100103.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 (!isset($contact['EMAIL'])) {
                                continue;
                            }
    Severity: Major
    Found in core/ajax/share.php - About 45 mins to fix

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

          protected function execute(InputInterface $input, OutputInterface $output): int {
              $appId = $input->getArgument('app-id');
      
              $checkList = new EmptyCheck();
              foreach ($input->getOption('checker') as $checker) {
      Severity: Minor
      Found in core/Command/App/CheckCode.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 syncSingleUser has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              InputInterface $input,
              OutputInterface $output,
              SyncService $syncService,
              UserInterface $backend,
              $uid,
      Severity: Minor
      Found in core/Command/User/SyncBackend.php - About 45 mins to fix

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

            private function getLegacyThemes() {
                $themes = [];
        
                if (\is_dir(\OC::$SERVERROOT . '/themes/')) {
                    $legacyThemeDirectories = new \DirectoryIterator(\OC::$SERVERROOT . '/themes/');
        Severity: Minor
        Found in core/Command/Maintenance/Mimetype/UpdateJS.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 writeJsFile has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private function writeJsFile($app, $path, $lang, OutputInterface $output, $translations, $plurals) {
        Severity: Minor
        Found in core/Command/L10n/CreateJs.php - About 45 mins to fix

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

              protected function execute(InputInterface $input, OutputInterface $output): int {
                  if ($this->encryptionManager->isEnabled() === false) {
                      throw new \Exception('Server side encryption is not enabled');
                  }
                  $yes = $input->getOption('yes');
          Severity: Minor
          Found in core/Command/Encryption/EncryptAll.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 (isset($contact['isSystemBook'])) {
                                      continue;
                                  }
          Severity: Major
          Found in core/ajax/share.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (!\is_array($emails)) {
                                        $emails = [$emails];
                                    }
            Severity: Major
            Found in core/ajax/share.php - About 45 mins to fix

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

                  protected function execute(InputInterface $input, OutputInterface $output): int {
                      if ($this->encryptionManager->isEnabled()) {
                          $output->writeln('Encryption is already enabled');
                      } else {
                          // TODO add and use api to enable encryption
              Severity: Minor
              Found in core/Command/Encryption/Enable.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($appName, IRequest $request, UserManager $userManager, IProvider $tokenProvider, TwoFactorAuthManager $twoFactorAuthManager, ISecureRandom $secureRandom) {
              Severity: Minor
              Found in core/Controller/TokenController.php - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language