owncloud/core

View on GitHub

Showing 3,235 of 4,503 total issues

Method install has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function install($options) {
        $l = $this->l10n;

        $error = [];
        $dbType = $options['dbtype'];
Severity: Major
Found in lib/private/Setup.php - About 5 hrs to fix

    File zh_TW.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    OC.L10N.register(
        "settings",
        {
        "Wrong current password" : "當前密碼錯誤",
        "The new password cannot be the same as the previous one" : "新密碼不能與上一個密碼重複.",
    Severity: Minor
    Found in settings/l10n/zh_TW.js - About 5 hrs to fix

      File Checker.php has 393 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * @author Lukas Reschke <lukas@statuscode.ch>
       * @author Roeland Jago Douma <rullzer@owncloud.com>
       * @author Thomas Müller <thomas.mueller@tmit.eu>
      Severity: Minor
      Found in lib/private/IntegrityCheck/Checker.php - About 5 hrs to fix

        Function copyBetweenStorage has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            private function copyBetweenStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
                // for versions we have nothing to do, because versions should always use the
                // key from the original file. Just create a 1:1 copy and done
                if ($this->isVersion($targetInternalPath) ||
                    $this->isVersion($sourceInternalPath)) {
        Severity: Minor
        Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 5 hrs 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 checkReshare has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function checkReshare($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, $itemSourceName, $expirationDate) {
                $backend = self::getBackend($itemType);
        
                $l = \OC::$server->getL10N('lib');
                $result = [];
        Severity: Minor
        Found in lib/private/Share/Share.php - About 5 hrs 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 analyse has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            public function analyse($appId) {
                $appPath = $this->appManager->getAppPath($appId);
                if ($appPath === false) {
                    throw new \RuntimeException("No app with given id <$appId> known.");
                }
        Severity: Minor
        Found in lib/private/App/CodeChecker/InfoChecker.php - About 5 hrs 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 parse has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
        Open

            public function parse($file) {
                if (!\is_file($file)) {
                    throw new AppNotFoundException(
                        \sprintf('%s does not exist', $file)
                    );
        Severity: Minor
        Found in lib/private/App/InfoParser.php - About 5 hrs 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

        Node has 40 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Node implements \OCP\Files\Node {
            /**
             * @var \OC\Files\View $view
             */
            protected $view;
        Severity: Minor
        Found in lib/private/Files/Node/Node.php - About 5 hrs to fix

          Method processNotification has 133 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function processNotification(
                  $notificationType,
                  $resourceType,
                  $providerId,
                  $notification
          Severity: Major
          Found in apps/federatedfilesharing/lib/Controller/OcmController.php - About 5 hrs to fix

            Method setPermissions has 133 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) {
                    $l = \OC::$server->getL10N('lib');
                    $connection = \OC::$server->getDatabaseConnection();
            
                    $intArrayToLiteralArray = function ($intArray, $eb) {
            Severity: Major
            Found in lib/private/Share/Share.php - About 5 hrs to fix

              File gl.js has 387 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              OC.L10N.register(
                  "settings",
                  {
                  "Wrong current password" : "O contrasinal actual é incorrecto",
                  "The new password cannot be the same as the previous one" : "O novo contrasinal non pode ser o mesmo que o anterior",
              Severity: Minor
              Found in settings/l10n/gl.js - About 5 hrs to fix

                File he.js has 386 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                OC.L10N.register(
                    "settings",
                    {
                    "Wrong current password" : "סיסמא נוכחית שגויה",
                    "The new password cannot be the same as the previous one" : "הסיסמא החדשה אינה יכולה להיות זהה לסיסמא הקודמת",
                Severity: Minor
                Found in settings/l10n/he.js - About 5 hrs to fix

                  Function restoreVersionsFromTrashbin has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static function restoreVersionsFromTrashbin(View $view, $filename, $targetLocation) {
                          if (\OCP\App::isEnabled('files_versions')) {
                              $user = User::getUser();
                              $rootView = new View('/');
                  
                  
                  Severity: Minor
                  Found in apps/files_trashbin/lib/Trashbin.php - About 5 hrs 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 editUser has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function editUser($parameters) {
                          /** @var string $targetUserId */
                          $targetUserId = $parameters['userid'];
                  
                          // Check if user is logged in
                  Severity: Minor
                  Found in apps/provisioning_api/lib/Users.php - About 5 hrs 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 init has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function init() {
                          // calculate the root directories
                          OC::$SERVERROOT = \str_replace("\\", '/', \substr(__DIR__, 0, -4));
                  
                          // register autoloader
                  Severity: Minor
                  Found in lib/kernel.php - About 5 hrs 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 process has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function process(bool $all = false, int $chunkSize = 1000, \Closure $progress = null): int {
                          $root = \OC::$server->getLazyRootFolder();
                          $count = 0;
                  
                          $qb = $this->connection->getQueryBuilder();
                  Severity: Minor
                  Found in lib/private/PreviewCleanup.php - About 5 hrs 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 loadApps has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function loadApps($types = null) {
                          if (\is_array($types) && !\array_diff($types, self::$loadedTypes)) {
                              return true;
                          }
                          if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) {
                  Severity: Minor
                  Found in lib/private/legacy/app.php - About 5 hrs 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 getShippedApps has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected static function getShippedApps() {
                          $shippedApps = [];
                          foreach (\OC::$APPSROOTS as $app_dir) {
                              if ($dir = \opendir($app_dir['path'])) {
                                  $nodes = \scandir($app_dir['path']);
                  Severity: Minor
                  Found in lib/private/Installer.php - About 5 hrs 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 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function execute(InputInterface $input, OutputInterface $output): int {
                          $username = $input->getArgument('user');
                          $emailLink = $input->getOption('send-email');
                          $displayLink = $input->getOption('output-link');
                  
                  
                  Severity: Minor
                  Found in core/Command/User/ResetPassword.php - About 5 hrs 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

                  File de_CH.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  OC.L10N.register(
                      "settings",
                      {
                      "Wrong current password" : "Das aktuelle Passwort ist falsch.",
                      "The new password cannot be the same as the previous one" : "Das neue Passwort kann nicht identisch zum alten Passwort sein.",
                  Severity: Minor
                  Found in settings/l10n/de_CH.js - About 5 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language