owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Function tryAuthModuleLogin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function tryAuthModuleLogin(IRequest $request) {
        foreach ($this->getAuthModules(false) as $authModule) {
            $user = $authModule->auth($request);
            if ($user !== null) {
                if (!$user->isEnabled()) {
Severity: Minor
Found in lib/private/User/Session.php - About 55 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 searchInUnicode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function searchInUnicode($unicodePoint) {
        $left = 0;
        $right = \count($this->unicodeRanges) - 1;
        while ($left <= $right) {
            $midpoint = \intval(($left + $right) / 2, 10);
Severity: Minor
Found in lib/private/Utf8Analyzer.php - About 55 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 preLoginNameUsedAsUserName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function preLoginNameUsedAsUserName($param) {
        if (!isset($param['uid'])) {
            throw new \Exception('key uid is expected to be set in $param');
        }

Severity: Minor
Found in lib/private/User/Database.php - About 55 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 handleRepairFeedBack has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function handleRepairFeedBack($event) {
        if (!$event instanceof GenericEvent) {
            return;
        }
        switch ($event->getSubject()) {
Severity: Minor
Found in core/Command/Maintenance/Repair.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int {
        $uid = $input->getArgument('uid');
        $key = $input->getArgument('key');
        $value = $input->getArgument('value');

Severity: Minor
Found in core/Command/User/Modify.php - About 55 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 mergeArrayValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function mergeArrayValue(array $configNames, $existingValues, $value, $updateOnly) {
        $configName = \array_shift($configNames);
        if (!\is_array($existingValues)) {
            $existingValues = [];
        }
Severity: Minor
Found in core/Command/Config/System/SetConfig.php - About 55 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 removeSubValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function removeSubValue($keys, $currentValue, $throwError) {
        $nextKey = \array_shift($keys);

        if (\is_array($currentValue)) {
            if (isset($currentValue[$nextKey])) {
Severity: Minor
Found in core/Command/Config/System/DeleteConfig.php - About 55 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 beforeController has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function beforeController($controller, $methodName) {
        if ($controller instanceof LoginController && $methodName === 'logout') {
            // Don't block the logout page, to allow canceling the 2FA
            return;
        }
Severity: Minor
Found in core/Middleware/TwoFactorMiddleware.php - About 55 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 message has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    message:function(content, title, dialogType, buttons, callback, modal, cssClass) {
Severity: Major
Found in core/js/oc-dialogs.js - About 50 mins to fix

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

            $AppName,
            IRequest $request,
            IUserSession $userSession,
            ILogger $logger,
            IURLGenerator $urlGenerator,
    Severity: Major
    Found in settings/Controller/CorsController.php - About 50 mins to fix

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

              $appName,
              IRequest $request,
              IProvider $tokenProvider,
              IUserManager $userManager,
              ISession $session,
      Severity: Major
      Found in settings/Controller/AuthSettingsController.php - About 50 mins to fix

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

                $AppName,
                IRequest $request,
                IConfig $config,
                IClientService $clientService,
                IURLGenerator $urlGenerator,
        Severity: Major
        Found in settings/Controller/CheckSetupController.php - About 50 mins to fix

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

                  DbHandler $dbHandler,
                  IClientService $httpClientService,
                  ILogger $logger,
                  IJobList $jobList,
                  ISecureRandom $secureRandom,
          Severity: Major
          Found in apps/federation/lib/TrustedServers.php - About 50 mins to fix

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

                    $appName,
                    IRequest $request,
                    ISecureRandom $secureRandom,
                    IJobList $jobList,
                    TrustedServers $trustedServers,
            Severity: Major
            Found in apps/federation/lib/Controller/OCSAuthAPIController.php - About 50 mins to fix

              Method publishActivity has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $affectedUser,
                      $subject,
                      $subjectParams,
                      $objectType,
                      $objectId,
              Severity: Major
              Found in apps/federatedfilesharing/lib/FedShareManager.php - About 50 mins to fix

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

                        $id,
                        $name,
                        ICommentsManager $commentsManager,
                        IUserManager $userManager,
                        IUserSession $userSession,
                Severity: Major
                Found in apps/comments/lib/Dav/EntityCollection.php - About 50 mins to fix

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

                          $name,
                          ICommentsManager $commentsManager,
                          IUserManager $userManager,
                          IUserSession $userSession,
                          EventDispatcherInterface $dispatcher,
                  Severity: Major
                  Found in apps/comments/lib/Dav/EntityTypeCollection.php - About 50 mins to fix

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

                            IGroupManager $groupManager,
                            IManager $activityManager,
                            IUserSession $session,
                            ISystemTagManager $tagManager,
                            IAppManager $appManager,
                    Severity: Major
                    Found in apps/systemtags/lib/Activity/Listener.php - About 50 mins to fix

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

                              FederatedShareProvider $federatedShareProvider,
                              Notifications $notifications,
                              IUserManager $userManager,
                              ActivityManager $activityManager,
                              NotificationManager $notificationManager,
                      Severity: Major
                      Found in apps/federatedfilesharing/lib/FedShareManager.php - About 50 mins to fix

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

                                ISession $session,
                                Session $userSession,
                                IRequest $request,
                                Manager $twoFactorManager,
                                AccountModuleManager $accountModuleManager,
                        Severity: Major
                        Found in apps/dav/lib/Connector/Sabre/Auth.php - About 50 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language