owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method userDeleted has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function userDeleted($uid, $shareType) {
        $qb = $this->dbConn->getQueryBuilder();

        $qb->delete('share');

Severity: Minor
Found in lib/private/Share20/DefaultShareProvider.php - About 1 hr to fix

    Method getSharedWith has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getSharedWith($userId, $shareType, $node = null, $limit = 50, $offset = 0) {
            $provider = $this->factory->getProviderForType($shareType);
    
            $shares = $provider->getSharedWith($userId, $shareType, $node, $limit, $offset);
    
    
    Severity: Minor
    Found in lib/private/Share20/Manager.php - About 1 hr to fix

      Method __construct has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct(ICheck $list) {
              $this->list = $list;
      
              $this->blackListedClassNames = [];
              foreach ($list->getClasses() as $class => $blackListInfo) {
      Severity: Minor
      Found in lib/private/App/CodeChecker/NodeVisitor.php - About 1 hr to fix

        Method parseHttpRangeHeader has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function parseHttpRangeHeader($rangeHeaderPos, $fileSize) {
                $rArray=\explode(',', $rangeHeaderPos);
                $minOffset = 0;
                $ind = 0;
        
        
        Severity: Minor
        Found in lib/private/legacy/files.php - About 1 hr to fix

          Method execute has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function execute($jobList, ILogger $logger = null) {
                  $jobList->setLastRun($this);
                  try {
                      //storing job start time
                      $jobStartTime = \time();
          Severity: Minor
          Found in lib/private/BackgroundJob/Job.php - About 1 hr to fix

            Method setUserValue has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function setUserValue($userId, $appName, $key, $value, $preCondition = null) {
                    if (!\is_int($value) && !\is_float($value) && !\is_string($value)) {
                        throw new \UnexpectedValueException('Only integers, floats and strings are allowed as value');
                    }
            
            
            Severity: Minor
            Found in lib/private/AllConfig.php - About 1 hr to fix

              Function manageMountPointError has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  manageMountPointError: function (name) {
                      this.getMountStatus($.proxy(function (allMountStatus) {
                          if (allMountStatus.hasOwnProperty(name) && allMountStatus[name].status > 0 && allMountStatus[name].status < 7) {
                              var mountData = allMountStatus[name];
                              if (mountData.type === "system") {
              Severity: Minor
              Found in apps/files_external/js/statusmanager.js - 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 translate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  translate: function(app, text, vars, count, options) {
                      var defaultOptions = {
                              escape: true
                          },
                          allOptions = options || {};
              Severity: Minor
              Found in core/js/l10n.js - 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 execute has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function execute(InputInterface $input, OutputInterface $output): int {
                      $remoteStorages = $this->getRemoteStorages();
              
                      $output->writeln(\count($remoteStorages) . " remote storage(s) need(s) to be checked");
              
              
              Severity: Minor
              Found in apps/files_sharing/lib/Command/CleanupRemoteStorages.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 stats has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function stats() {
                      $userCount = 0;
                      if ($this->isAdmin) {
                          $countByBackend = $this->userManager->countUsers();
              
              
              Severity: Minor
              Found in settings/Controller/UsersController.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 setMailAddress has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function setMailAddress($id, $mailAddress) {
                      $userId = $this->userSession->getUser()->getUID();
                      $user = $this->userManager->get($id);
              
                      if ($userId !== $id
              Severity: Minor
              Found in settings/Controller/UsersController.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 fopen has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function fopen($path, $mode) {
                      if ($source = $this->getSourcePath($path)) {
                          switch ($mode) {
                              case 'r+':
                              case 'rb+':
              Severity: Minor
              Found in apps/files_sharing/lib/SharedStorage.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 parseRetentionObligation has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function parseRetentionObligation() {
                      $splitValues = \explode(',', $this->retentionObligation);
                      if (!isset($splitValues[0])) {
                          $minValue = self::DEFAULT_RETENTION_OBLIGATION;
                      } else {
              Severity: Minor
              Found in apps/files_trashbin/lib/Expiration.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 prepare has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function prepare(INotification $notification, $languageCode) {
                      if ($notification->getApp() !== 'files_sharing') {
                          // Not my app => throw
                          throw new \InvalidArgumentException();
                      }
              Severity: Minor
              Found in apps/federatedfilesharing/lib/Notifier.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 commentEvent has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function commentEvent(CommentsEvent $event) {
                      if ($event->getComment()->getObjectType() !== 'files'
                          || !\in_array($event->getEvent(), [CommentsEvent::EVENT_ADD])
                          || !$this->appManager->isInstalled('activity')) {
                          // Comment not for file, not adding a comment or no activity-app enabled (save the energy)
              Severity: Minor
              Found in apps/comments/lib/Activity/Listener.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 schedule has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function schedule(ITip\Message $iTipMessage) {
                      // Not sending any emails if OC-CalDav-Import header is set
                      if ($this->request->getHeader('OC-CalDav-Import') !== null) {
                          return;
                      }
              Severity: Minor
              Found in apps/dav/lib/CalDAV/Schedule/IMipPlugin.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 processNotification has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function processNotification(
                      $notificationType,
                      $resourceType,
                      $providerId,
                      $notification
              Severity: Minor
              Found in apps/federatedfilesharing/lib/Controller/OcmController.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 buildDateFromContact has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function buildDateFromContact($cardData, $dateField, $summarySymbol) {
                      if (empty($cardData)) {
                          return null;
                      }
                      try {
              Severity: Minor
              Found in apps/dav/lib/CalDAV/BirthdayService.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 ocmDiscover has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function ocmDiscover($remote) {
                      // Check if something is in the cache
                      if ($cacheData = $this->cache->get('OCM' . $remote)) {
                          return \json_decode($cacheData, true);
                      }
              Severity: Minor
              Found in apps/federatedfilesharing/lib/DiscoveryManager.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 convertToSabreException has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function convertToSabreException(\Exception $e) {
                      if ($e instanceof FileContentNotAllowedException) {
                          // the file content is not permitted
                          throw new DAVForbiddenException($e->getMessage(), $e->getRetry(), $e);
                      }
              Severity: Minor
              Found in apps/dav/lib/Connector/Sabre/File.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

              Severity
              Category
              Status
              Source
              Language