owncloud/core

View on GitHub
core/ajax/share.php

Summary

Maintainability
B
6 hrs
Test Coverage

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 (!isset($contact['EMAIL'])) {
                                continue;
                            }
    Severity: Major
    Found in core/ajax/share.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ((!isset($_GET['itemShares'])
                                  || !\is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])
                                  || !\in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]))
                                  && $uid != OC_User::getUser()) {
                                  $shareWith[] = [
      Severity: Major
      Found in core/ajax/share.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if (isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) &&
                                \is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])) {
                                $sharedGroups = $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP];
                            }
        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

            Avoid deeply nested control flow statements.
            Open

                                if (\substr_count((string)$_GET['search'], '@') >= 1) {
                                    $shareWith[] = [
                                        'label' => (string)$_GET['search'],
                                        'value' => [
                                            'shareType' => \OCP\Share::SHARE_TYPE_REMOTE,
            Severity: Major
            Found in core/ajax/share.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if (\in_array($uid, $sharedUsers)) {
                                          continue;
                                      }
              Severity: Major
              Found in core/ajax/share.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                    if (isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) &&
                                        \is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) {
                                        $sharedUsers = $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER];
                                    }
                Severity: Major
                Found in core/ajax/share.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (isset($contact['CLOUD'])) {
                                              foreach ($contact['CLOUD'] as $cloudId) {
                                                  $shareWith[] = [
                                                      'label' => $contact['FN'] . ' (' . $cloudId . ')',
                                                      'value' => [
                  Severity: Major
                  Found in core/ajax/share.php - About 45 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status