owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

File filelist.js has 277 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_trashbin/js/filelist.js - About 2 hrs to fix

    Function setupGroupsSelect has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        setupGroupsSelect: function($elements, extraOptions, options) {
            var self = this;
            options = options || {};
            if ($elements.length > 0) {
                // note: settings are saved through a "change" event registered
    Severity: Major
    Found in settings/js/settings.js - About 2 hrs to fix

      Function loadCategory has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          loadCategory: function(categoryId) {
              var self = this;
              if (OC.Settings.Apps.State.currentCategory === categoryId) {
                  return;
              }
      Severity: Major
      Found in settings/js/admin-apps.js - About 2 hrs to fix

        Function loadPreview has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                loadPreview: function(path, mime, etag, $iconDiv, $container, isImage) {
                    var maxImageWidth  = $container.parent().width() + 50;  // 50px for negative margins
                    var maxImageHeight = maxImageWidth / (16/9);
                    var smallPreviewSize = 75;
        
        
        Severity: Major
        Found in apps/files/js/mainfileinfodetailview.js - About 2 hrs to fix

          Method validate has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function validate(IStorageConfig $storage) {
                  $mountPoint = $storage->getMountPoint();
                  if ($mountPoint === '' || $mountPoint === '/') {
                      return new DataResponse(
                          [
          Severity: Major
          Found in apps/files_external/lib/Controller/StoragesController.php - About 2 hrs to fix

            Method writeBack has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function writeBack($tmpFile) {
                    if (isset(self::$tempFiles[$tmpFile])) {
                        $path = self::$tempFiles[$tmpFile];
                        $parentFolder = $this->getDriveFile(\dirname($path));
                        if ($parentFolder) {
            Severity: Major
            Found in apps/files_external/lib/Lib/Storage/Google.php - About 2 hrs to fix

              Method fopen has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function fopen($path, $mode) {
                      $this->init();
                      $path = $this->cleanPath($path);
                      switch ($mode) {
                          case 'r':
              Severity: Major
              Found in lib/private/Files/Storage/DAV.php - About 2 hrs to fix

                Method createDBUser has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function createDBUser($connection) {
                        $name = $this->dbUser;
                        $password = $this->dbPassword;
                        $query = 'SELECT * FROM all_users WHERE USERNAME = :un';
                        $stmt = \oci_parse($connection, $query);
                Severity: Major
                Found in lib/private/Setup/OCI.php - About 2 hrs to fix

                  Method validateExpirationDate has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function validateExpirationDate(\OCP\Share\IShare $share, $skipPastDateValidation = false) {
                          $expirationDate = $share->getExpirationDate();
                  
                          if ($expirationDate !== null) {
                              // Set the expiration date to just the date at "zero" time in the day
                  Severity: Major
                  Found in lib/private/Share20/Manager.php - About 2 hrs to fix

                    Method loadCommands has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function loadCommands(InputInterface $input, OutputInterface $output) {
                            // $application is required to be defined in the register_command scripts
                            $application = $this->application;
                            $inputDefinition = $application->getDefinition();
                            $inputDefinition->addOption(
                    Severity: Major
                    Found in lib/private/Console/Application.php - About 2 hrs to fix

                      Function reloadCallback has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              reloadCallback: function(status, result) {
                                  delete this._reloadCall;
                                  this.hideMask();
                      
                                  if (status === 401) {
                      Severity: Major
                      Found in apps/files/js/filelist.js - About 2 hrs to fix

                        File oc.js has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        OC.L10N.register(
                            "core",
                            {
                            "Please select a file." : "Seleccionatz un fichièr.",
                            "File is too big" : "Fichièr tròp voluminós",
                        Severity: Minor
                        Found in core/l10n/oc.js - About 2 hrs to fix

                          Method getSpecialParameterList has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getSpecialParameterList($app, $text) {
                                  if ($app === self::FILES_SHARING_APP) {
                                      switch ($text) {
                                          case self::SUBJECT_REMOTE_SHARE_RECEIVED:
                                          case self::SUBJECT_REMOTE_SHARE_UNSHARED:
                          Severity: Major
                          Found in apps/files_sharing/lib/Activity.php - About 2 hrs to fix

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

                                protected function execute(InputInterface $input, OutputInterface $output): int {
                                    $sourceUserObject = $this->userManager->get($input->getArgument('source-user'));
                                    $destinationUserObject = $this->userManager->get($input->getArgument('destination-user'));
                                    if ($sourceUserObject === null) {
                                        $output->writeln("<error>Unknown source user $this->sourceUser</error>");
                            Severity: Major
                            Found in apps/files/lib/Command/TransferOwnership.php - About 2 hrs to fix

                              Method updateStorage has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function updateStorage(IStorageConfig $updatedStorage) {
                                      $id = $updatedStorage->getId();
                              
                                      $existingMount = $this->dbConfig->getMountById($id);
                              
                              
                              Severity: Major
                              Found in lib/private/Files/External/Service/StoragesService.php - About 2 hrs to fix

                                Method changeSchema has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function changeSchema(Schema $schema, array $options) {
                                        $prefix = $options['tablePrefix'];
                                        $table = $schema->createTable("{$prefix}persistent_locks");
                                        $table->addColumn('id', Type::BIGINT, [
                                            'autoincrement' => true,
                                Severity: Major
                                Found in core/Migrations/Version20180607072706.php - About 2 hrs to fix

                                  Identical blocks of code found in 5 locations. Consider refactoring.
                                  Open

                                              this._client.request(
                                                  operation,
                                                  options.pathIsUrl ? path : this._buildUrl(path),
                                                  headers
                                              ).then(
                                  Severity: Major
                                  Found in core/js/files/client.js and 4 other locations - About 2 hrs to fix
                                  core/js/files/client.js on lines 657..671
                                  core/js/files/client.js on lines 684..696
                                  core/js/files/client.js on lines 762..776
                                  core/js/files/client.js on lines 805..820

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 87.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 5 locations. Consider refactoring.
                                  Open

                                              this._client.request(
                                                  method,
                                                  this._buildUrl(path)
                                              ).then(
                                                  function(result) {
                                  Severity: Major
                                  Found in core/js/files/client.js and 4 other locations - About 2 hrs to fix
                                  core/js/files/client.js on lines 657..671
                                  core/js/files/client.js on lines 726..739
                                  core/js/files/client.js on lines 762..776
                                  core/js/files/client.js on lines 805..820

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 87.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 5 locations. Consider refactoring.
                                  Open

                                              this._client.request(
                                                  'LOCK',
                                                  options.pathIsUrl ? path : this._buildUrl(path),
                                                  {},
                                                  lockBody
                                  Severity: Major
                                  Found in core/js/files/client.js and 4 other locations - About 2 hrs to fix
                                  core/js/files/client.js on lines 657..671
                                  core/js/files/client.js on lines 684..696
                                  core/js/files/client.js on lines 726..739
                                  core/js/files/client.js on lines 805..820

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 87.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Identical blocks of code found in 5 locations. Consider refactoring.
                                  Open

                                              this._client.request(
                                                  'UNLOCK',
                                                  options.pathIsUrl ? path : this._buildUrl(path),
                                                  {
                                                      'Lock-Token': token
                                  Severity: Major
                                  Found in core/js/files/client.js and 4 other locations - About 2 hrs to fix
                                  core/js/files/client.js on lines 657..671
                                  core/js/files/client.js on lines 684..696
                                  core/js/files/client.js on lines 726..739
                                  core/js/files/client.js on lines 762..776

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 87.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language