owncloud/core

View on GitHub

Showing 3,235 of 4,503 total issues

OC_Image has 34 functions (exceeds 20 allowed). Consider refactoring.
Open

class OC_Image implements \OCP\IImage {
    /** @var false|resource */
    protected $resource = false; // tmp resource.
    /** @var int */
    protected $imageType = IMAGETYPE_PNG; // Default to png if file type isn't evident.
Severity: Minor
Found in lib/private/legacy/image.php - About 4 hrs to fix

    File public.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * Copyright (c) 2014
     *
     * This file is licensed under the Affero General Public License version 3
     * or later.
    Severity: Minor
    Found in apps/files_sharing/js/public.js - About 4 hrs to fix

      File mk.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      OC.L10N.register(
          "core",
          {
          "Please select a file." : "Изберете датотека.",
          "File is too big" : "Датотеката е пре голема",
      Severity: Minor
      Found in core/l10n/mk.js - About 4 hrs to fix

        File oc-backbone-webdav.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*
         * Copyright (c) 2015
         *
         * This file is licensed under the Affero General Public License version 3
         * or later.
        Severity: Minor
        Found in core/js/oc-backbone-webdav.js - About 4 hrs to fix

          Function updateShare has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public function updateShare(\OCP\Share\IShare $share, $skipExpirationValidation = false) {
                  $expirationDateUpdated = false;
          
                  $this->canShare($share);
          
          
          Severity: Minor
          Found in lib/private/Share20/Manager.php - About 4 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 mergeResponses has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function mergeResponses($responses) {
                  // Sort into shipped and third-party
                  $shipped = [
                      'succeeded' => [],
                      'failed' => [],
          Severity: Minor
          Found in lib/private/legacy/api.php - About 4 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 upsert has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public function upsert($table, $input, $compare) {
                  $this->conn->beginTransaction();
                  $done = false;
          
                  if (empty($compare)) {
          Severity: Minor
          Found in lib/private/DB/Adapter.php - About 4 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 setLanguageFromRequest has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

              public function setLanguageFromRequest($app = null) {
                  $header = $this->request->getHeader('ACCEPT_LANGUAGE');
                  if ($header) {
                      $available = $this->findAvailableLanguages($app);
          
          
          Severity: Minor
          Found in lib/private/L10N/Factory.php - About 4 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 nl.js has 343 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          OC.L10N.register(
              "settings",
              {
              "No user supplied" : "Geen gebruiker opgegeven",
              "Authentication error" : "Authenticatie fout",
          Severity: Minor
          Found in settings/l10n/nl.js - About 4 hrs to fix

            File hu_HU.js has 343 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            OC.L10N.register(
                "core",
                {
                "Please select a file." : "Kérjük, válasszon ki egy fájlt.",
                "File is too big" : "A fájl túl nagy",
            Severity: Minor
            Found in core/l10n/hu_HU.js - About 4 hrs to fix

              Function initialize has 105 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      initialize: function() {
              
                          var self = this;
              
                          this.fileAppLoaded = function() {
              Severity: Major
              Found in apps/files/js/search.js - About 4 hrs to fix

                Method getRemote has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getRemote($search) {
                        $this->result['remotes'] = $this->result['exact']['remotes'] = $users = [];
                
                        if (\strlen(\trim($search)) === 0 && $this->userSearch->getSearchMinLength() > 0) {
                            $this->result['remotes'] = [];
                Severity: Major
                Found in apps/files_sharing/lib/Controller/ShareesController.php - About 4 hrs to fix

                  Method index has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function index($dir = '', $view = '', $fileid = null, $details = null) {
                          $fileNotFound = false;
                          if ($fileid !== null) {
                              try {
                                  return $this->showFile($fileid, $details);
                  Severity: Major
                  Found in apps/files/lib/Controller/ViewController.php - About 4 hrs to fix

                    Method loadField has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function loadField($table, $xml) {
                            $options = ['notnull' => false];
                            $primary = null;
                            foreach ($xml->children() as $child) {
                                /**
                    Severity: Major
                    Found in lib/private/DB/MDB2SchemaReader.php - About 4 hrs to fix

                      File pl.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      OC.L10N.register(
                          "settings",
                          {
                          "Wrong current password" : "Podano złe hasło",
                          "The new password cannot be the same as the previous one" : "Nowe hasło nie może być takie samo jak poprzednie",
                      Severity: Minor
                      Found in settings/l10n/pl.js - About 4 hrs to fix

                        Root has 33 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Root extends Folder implements IRootFolder {
                            /**
                             * @var \OC\Files\Mount\Manager $mountManager
                             */
                            private $mountManager;
                        Severity: Minor
                        Found in lib/private/Files/Node/Root.php - About 4 hrs to fix

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

                          abstract class Node implements FilesNode {
                              /** @var IStorage */
                              protected $storage;
                          
                              /** @var string $path relativ to the storage root */
                          Severity: Minor
                          Found in lib/private/Files/Storage/Node.php - About 4 hrs to fix

                            Cache has 33 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Cache implements ICache {
                                use MoveFromCacheTrait {
                                    MoveFromCacheTrait::moveFromCache as moveFromCacheFallback;
                                }
                            
                            
                            Severity: Minor
                            Found in lib/private/Files/Cache/Cache.php - About 4 hrs to fix

                              Db has 33 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class Db implements IDb {
                                  /**
                                   * @var IDBConnection
                                   */
                                  protected $connection;
                              Severity: Minor
                              Found in lib/private/AppFramework/Db/Db.php - About 4 hrs to fix

                                Method updateShare has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function updateShare(\OCP\Share\IShare $share, $skipExpirationValidation = false) {
                                        $expirationDateUpdated = false;
                                
                                        $this->canShare($share);
                                
                                
                                Severity: Major
                                Found in lib/private/Share20/Manager.php - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language