owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

        IUserSession $userSession = null,
        IAppConfig $appConfig = null,
        IGroupManager $groupManager = null,
        ICacheFactory $memCacheFactory,
        EventDispatcherInterface $dispatcher,
Severity: Minor
Found in lib/private/App/AppManager.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            for ($k = 8 - $bit; $k >= $limit; $k -= $bit) {
                                $index = \imagecolorat($im, $i, $j);
                                $bin |= $index << $k;
                                $i++;
                            }
    Severity: Major
    Found in lib/private/legacy/image.php - About 45 mins to fix

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

          public function __construct(IConfig $config, ILogger $logger, IL10N $l10n, View $rootView, Util $util, ArrayCache $arrayCache) {
      Severity: Minor
      Found in lib/private/Encryption/Manager.php - About 45 mins to fix

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

            public static function respond($result, $format='xml') {
                $request = \OC::$server->getRequest();
        
                // Send 401 headers if unauthorised
                if ($result->getStatusCode() === API::RESPOND_UNAUTHORISED) {
        Severity: Minor
        Found in lib/private/legacy/api.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 checkDatabaseVersion has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function checkDatabaseVersion() {
                $l = \OC::$server->getL10N('lib');
                $errors = [];
                $dbType = \OC::$server->getSystemConfig()->getValue('dbtype', 'sqlite');
                if ($dbType === 'pgsql') {
        Severity: Minor
        Found in lib/private/legacy/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 generateToken has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function generateToken($token, $uid, $loginName, $password, $name, $type = IToken::TEMPORARY_TOKEN) {
        Severity: Minor
        Found in lib/private/Authentication/Token/DefaultTokenProvider.php - About 45 mins to fix

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

                  IConfig $config,
                  IniGetWrapper $iniWrapper,
                  IL10N $l10n,
                  \OC_Defaults $defaults,
                  ILogger $logger,
          Severity: Minor
          Found in lib/private/Setup.php - About 45 mins to fix

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

                public function generateToken($token, $uid, $loginName, $password, $name, $type = IToken::TEMPORARY_TOKEN);
            Severity: Minor
            Found in lib/private/Authentication/Token/IProvider.php - About 45 mins to fix

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

                  public function executeStep($version) {
                      $this->logger->debug("Migrations: starting $version from app {$this->appName}", ['app' => 'core']);
                      $instance = $this->createInstance($version);
                      if ($instance instanceof ISimpleMigration) {
                          $instance->run($this->output);
              Severity: Minor
              Found in lib/private/DB/MigrationService.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 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
                  Severity
                  Category
                  Status
                  Source
                  Language