owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

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

        $itemType,
        $user,
        $format = self::FORMAT_NONE,
        $parameters = null,
        $limit = -1,
Severity: Minor
Found in lib/private/Share/Share.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ($item['permissions'] & ~$permissions) {
                                // Add to list of items that need permissions removed
                                $ids[] = $item['id'];
                                $parents[] = $item['id'];
                            }
    Severity: Major
    Found in lib/private/Share/Share.php - About 45 mins to fix

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

              $itemType,
              $itemSource,
              $format = self::FORMAT_NONE,
              $parameters = null,
              $includeCollections = false,
      Severity: Minor
      Found in lib/private/Share/Share.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ($items[$id]['share_type'] != self::SHARE_TYPE_GROUP) {
                                    $items[$id]['share_type'] = self::SHARE_TYPE_GROUP;
                                    $items[$id]['share_with'] = $row['share_with'];
                                }
        Severity: Major
        Found in lib/private/Share/Share.php - About 45 mins to fix

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

              private function fixEntryParent(IOutput $out, $storageId, $fileId, $path, $wrongParentId, $parentIdExists = false) {
          Severity: Minor
          Found in lib/private/Repair/RepairMismatchFileCachePath.php - About 45 mins to fix

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

                public static function getBackend($itemType) {
                    $l = \OC::$server->getL10N('lib');
                    if (isset(self::$backends[$itemType])) {
                        return self::$backends[$itemType];
                    } elseif (isset(self::$backendTypes[$itemType]['class'])) {
            Severity: Minor
            Found in lib/private/Share/Share.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

                    LicenseFetcher $licenseFetcher,
                    MessageService $messageService,
                    IAppManager $appManager,
                    IConfig $config,
                    ITimeFactory $timeFactory,
            Severity: Minor
            Found in lib/private/License/LicenseManager.php - About 45 mins to fix

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

                  public function getSharesBy($userId, $shareType, $path = null, $reshares = false, $limit = 50, $offset = 0) {
              Severity: Minor
              Found in lib/private/Share20/Manager.php - About 45 mins to fix

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

                    public function getSharesBy($userId, $shareType, $node, $reshares, $limit, $offset) {
                Severity: Minor
                Found in lib/private/Share20/DefaultShareProvider.php - About 45 mins to fix

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

                      private function resizeAndStore() {
                          $image = $this->preview;
                          if (!($image instanceof IImage)) {
                              Util::writeLog(
                                  'core',
                  Severity: Minor
                  Found in lib/private/Preview.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 getShareById has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getShareById($id, $recipientId = null) {
                          if (!ctype_digit($id)) {
                              // share id is defined as a field of type integer
                              // if someone calls the API asking for a share id like "abc"
                              // then there is no point trying to query the database,
                  Severity: Minor
                  Found in lib/private/Share20/DefaultShareProvider.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 unscalable has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function unscalable($x, $y) {
                          $maxX = $this->getMaxX();
                          $maxY = $this->getMaxY();
                          $scalingUp = $this->getScalingUp();
                          $maxScaleFactor = $this->getMaxScaleFactor();
                  Severity: Minor
                  Found in lib/private/Preview.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 getDescription has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getDescription($errorCode, $errorObject) {
                          switch ($errorCode) {
                              case CodeChecker::STATIC_CALL_NOT_ALLOWED:
                                  $functions = $this->getLocalFunctions();
                                  $functions = \array_change_key_case($functions, CASE_LOWER);
                  Severity: Minor
                  Found in lib/private/App/CodeChecker/AbstractCheck.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 scale has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function scale($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight) {
                          $scalingUp = $this->getScalingUp();
                          $maxScaleFactor = $this->getMaxScaleFactor();
                  
                          $factorX = $askedWidth / $previewWidth;
                  Severity: Minor
                  Found in lib/private/Preview.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 listNotifiers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function listNotifiers() {
                          if (!empty($this->notifiersInfo)) {
                              return $this->notifiersInfo;
                          }
                  
                  
                  Severity: Minor
                  Found in lib/private/Notification/Manager.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 prepare has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function prepare(INotification $notification, $languageCode) {
                          $notifiers = $this->getNotifiers();
                  
                          foreach ($notifiers as $notifier) {
                              try {
                  Severity: Minor
                  Found in lib/private/Notification/Manager.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 (!$officeFound) {
                                              $whichOpenOffice = \shell_exec('command -v openoffice');
                                              $officeFound = !empty($whichOpenOffice);
                                          }
                  Severity: Major
                  Found in lib/private/PreviewManager.php - About 45 mins to fix

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

                        public function getInsecureServerHost() {
                            $host = 'localhost';
                            if (isset($this->server['HTTP_X_FORWARDED_HOST'])) {
                                if (\strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
                                    $parts = \explode(',', $this->server['HTTP_X_FORWARDED_HOST']);
                    Severity: Minor
                    Found in lib/private/AppFramework/Http/Request.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 ($sameNum != 0) {
                                                    $bmpData .= \chr($sameNum) . \chr($lastIndex);
                                                }
                    Severity: Major
                    Found in lib/private/legacy/image.php - About 45 mins to fix

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

                          public static function getDisplayName($uid = null) {
                              if ($uid) {
                                  $user = \OC::$server->getUserManager()->get($uid);
                                  if ($user) {
                                      return $user->getDisplayName();
                      Severity: Minor
                      Found in lib/private/legacy/user.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

                      Severity
                      Category
                      Status
                      Source
                      Language