owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

File DBConfigService.php has 266 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @author Joas Schilling <coding@schilljs.com>
 * @author Jörn Friedrich Dreyer <jfd@butonic.de>
 * @author Robin Appelman <icewind@owncloud.com>
Severity: Minor
Found in lib/private/Files/External/Service/DBConfigService.php - About 2 hrs to fix

    Function loadStorages has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        loadStorages: function() {
            var self = this;
            var ajaxRequests = [];
    
            if (this._isPersonal) {
    Severity: Major
    Found in apps/files_external/js/settings.js - About 2 hrs to fix

      Function attach has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              attach: function(fileList) {
                  var self = this;
                  if (this.ignoreLists.indexOf(fileList.id) >= 0) {
                      return;
                  }
      Severity: Major
      Found in apps/comments/js/filesplugin.js - About 2 hrs to fix

        Method getInternalDriveFile has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getInternalDriveFile($path) {
                // Remove leading and trailing slashes
                $path = \trim($path, '/');
                if ($path === '.') {
                    $path = '';
        Severity: Major
        Found in apps/files_external/lib/Lib/Storage/Google.php - About 2 hrs to fix

          Method writeExtra has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function writeExtra($app, $message, $level, $conditionalLogFile, $extraFields = []) {
                  $config = \OC::$server->getSystemConfig();
          
                  // default to ISO8601
                  $format = $config->getValue('logdateformat', 'c');
          Severity: Major
          Found in lib/private/Log/Owncloud.php - About 2 hrs to fix

            Method delete has 59 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function delete($parent, $excludeParent = false, $uidOwner = null, $newParent = null, $excludeGroupChildren = false) {
                    $ids = [$parent];
                    $deletedItems = [];
                    $changeParent = [];
                    $parents = [$parent];
            Severity: Major
            Found in lib/private/Share/Helper.php - About 2 hrs to fix

              Method castValue has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function castValue($value, $type) {
                      switch ($type) {
                          case 'integer':
                          case 'int':
                              if (!\is_numeric($value)) {
              Severity: Major
              Found in core/Command/Config/System/SetConfig.php - About 2 hrs to fix

                Method validateInput has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function validateInput(InputInterface $input, OutputInterface $output, $supportedDatabases) {
                        $db = \strtolower($input->getOption('database'));
                
                        if (!\in_array($db, $supportedDatabases)) {
                            throw new InvalidArgumentException("Database <$db> is not supported.");
                Severity: Major
                Found in core/Command/Maintenance/Install.php - About 2 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          $(document).on('click', '.app-description-toggle-hide', function () {
                              $(this).addClass('hidden');
                              $(this).siblings('.app-description-toggle-show').removeClass('hidden');
                              $(this).siblings('.app-description-container').slideUp();
                          });
                  Severity: Major
                  Found in settings/js/admin-apps.js and 1 other location - About 2 hrs to fix
                  settings/js/admin-apps.js on lines 598..602

                  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 82.

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      exports.Apps.showAppSidebar = function($el) {
                          var $appSidebar = $el || $('#app-sidebar');
                          $appSidebar.removeClass('disappear');
                          $('#app-content').addClass('with-app-sidebar').trigger(new $.Event('appresized'));
                  
                  
                  Severity: Major
                  Found in core/js/apps.js and 1 other location - About 2 hrs to fix
                  core/js/apps.js on lines 41..45

                  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 82.

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if (ev.action) {
                                  this._fileList.fileActions.registerAction(ev.action);
                              } else if (ev.defaultAction) {
                                  this._fileList.fileActions.setDefault(
                                      ev.defaultAction.mime,
                  Severity: Major
                  Found in apps/systemtags/js/app.js and 1 other location - About 2 hrs to fix
                  apps/files/js/favoritesplugin.js on lines 102..109

                  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 82.

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          $(document).on('click', '.app-description-toggle-show', function () {
                              $(this).addClass('hidden');
                              $(this).siblings('.app-description-toggle-hide').removeClass('hidden');
                              $(this).siblings('.app-description-container').slideDown();
                          });
                  Severity: Major
                  Found in settings/js/admin-apps.js and 1 other location - About 2 hrs to fix
                  settings/js/admin-apps.js on lines 603..607

                  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 82.

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                      exports.Apps.hideAppSidebar = function($el) {
                          var $appSidebar = $el || $('#app-sidebar');
                          $appSidebar.addClass('disappear');
                          $('#app-content').removeClass('with-app-sidebar').trigger(new $.Event('appresized'));
                      };
                  Severity: Major
                  Found in core/js/apps.js and 1 other location - About 2 hrs to fix
                  core/js/apps.js on lines 28..33

                  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 82.

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if (ev.action) {
                                  this.favoritesFileList.fileActions.registerAction(ev.action);
                              } else if (ev.defaultAction) {
                                  this.favoritesFileList.fileActions.setDefault(
                                      ev.defaultAction.mime,
                  Severity: Major
                  Found in apps/files/js/favoritesplugin.js and 1 other location - About 2 hrs to fix
                  apps/systemtags/js/app.js on lines 77..84

                  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 82.

                  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

                  File setupchecks.js has 264 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 core/js/setupchecks.js - About 2 hrs to fix

                    File user.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * @author Aldo "xoen" Giambelluca <xoen@xoen.org>
                     * @author Andreas Fischer <bantu@owncloud.com>
                     * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                    Severity: Minor
                    Found in lib/private/legacy/user.php - About 2 hrs to fix

                      File Manager.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
                       * @author Joas Schilling <coding@schilljs.com>
                       * @author Jörn Friedrich Dreyer <jfd@butonic.de>
                      Severity: Minor
                      Found in lib/private/User/Manager.php - About 2 hrs to fix

                        EmptyContentSecurityPolicy has 22 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class EmptyContentSecurityPolicy {
                            /** @var bool Whether inline JS snippets are allowed */
                            protected $inlineScriptAllowed = null;
                            /**
                             * @var bool Whether eval in JS scripts is allowed
                        Severity: Minor
                        Found in lib/public/AppFramework/Http/EmptyContentSecurityPolicy.php - About 2 hrs to fix

                          Manager has 22 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class Manager extends PublicEmitter implements IGroupManager {
                              /**
                               * @var GroupInterface[] $backends
                               */
                              private $backends = [];
                          Severity: Minor
                          Found in lib/private/Group/Manager.php - About 2 hrs to fix

                            Event has 22 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Event implements IEvent {
                                /** @var array */
                                protected $data = [
                                    'app' => null,
                                    'type' => null,
                            Severity: Minor
                            Found in lib/private/Activity/Event.php - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language