owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

File Directory.php has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
 * @author Bart Visscher <bartv@thisnet.nl>
 * @author Björn Schießle <bjoern@schiessle.org>
Severity: Minor
Found in apps/dav/lib/Connector/Sabre/Directory.php - About 3 hrs to fix

    File fi_FI.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    OC.L10N.register(
        "settings",
        {
        "No user supplied" : "Käyttäjää ei määritetty",
        "Authentication error" : "Tunnistautumisvirhe",
    Severity: Minor
    Found in settings/l10n/fi_FI.js - About 3 hrs to fix

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

                      if(self.menuDirection === 'down') {
                          button.parent().children('ul').slideUp(slideDuration,function() {
                              button.parent().children('ul').remove();
                              button.removeClass('active down');
                              $(self).trigger($.Event('dropdownclosed', settings));
      Severity: Major
      Found in core/js/multiselect.js and 1 other location - About 3 hrs to fix
      core/js/multiselect.js on lines 82..94

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

      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 2 locations. Consider refactoring.
      Open

                      if(self.menuDirection === 'down') {
                          button.parent().children('ul').slideUp(slideDuration,function() {
                              button.parent().children('ul').remove();
                              button.removeClass('active down');
                              $(self).trigger($.Event('dropdownclosed', settings));
      Severity: Major
      Found in core/js/multiselect.js and 1 other location - About 3 hrs to fix
      core/js/multiselect.js on lines 102..114

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

      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

          $('#mail_general_settings_form').change(function () {
              OC.msg.startSaving('#mail_settings_msg');
              var post = $("#mail_general_settings_form").serialize();
              $.post(OC.generateUrl('/settings/admin/mailsettings'), post, function (data) {
                  OC.msg.finishedSaving('#mail_settings_msg', data);
      Severity: Major
      Found in settings/js/panels/mail.js and 1 other location - About 3 hrs to fix
      settings/js/panels/mail.js on lines 58..64

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

      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

          $('#mail_credentials_settings_submit').click(function () {
              OC.msg.startSaving('#mail_settings_msg');
              var post = $("#mail_credentials_settings").serialize();
              $.post(OC.generateUrl('/settings/admin/mailsettings/credentials'), post, function (data) {
                  OC.msg.finishedSaving('#mail_settings_msg', data);
      Severity: Major
      Found in settings/js/panels/mail.js and 1 other location - About 3 hrs to fix
      settings/js/panels/mail.js on lines 50..56

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

      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

      Function _promptFileName has 76 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _promptFileName: function($target) {
                  var self = this;
                  if (!OCA.Files.NewFileMenu._TEMPLATE_FORM) {
                      OCA.Files.NewFileMenu._TEMPLATE_FORM = Handlebars.compile(TEMPLATE_FILENAME_FORM);
                  }
      Severity: Major
      Found in apps/files/js/newfilemenu.js - About 3 hrs to fix

        Function _onSend has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                _onSend: function (e, data) {
                    if (!data.submit) {
                        this._addConvenienceMethods(e, data);
                    }
                    var that = this,
        Severity: Major
        Found in apps/files/js/jquery.fileupload.js - About 3 hrs to fix

          File MailNotifications.php has 293 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /**
           * @author Björn Schießle <bjoern@schiessle.org>
           * @author Joas Schilling <coding@schilljs.com>
           * @author Lukas Reschke <lukas@statuscode.ch>
          Severity: Minor
          Found in lib/private/Share/MailNotifications.php - About 3 hrs to fix

            File app.js has 292 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Copyright (c) 2014 Vincent Petry <pvince81@owncloud.com>
             *
             * This file is licensed under the Affero General Public License version 3
             * or later.
            Severity: Minor
            Found in apps/files_sharing/js/app.js - About 3 hrs to fix

              Method getFileInfo has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getFileInfo($path) {
                      $this->log('enter: '.__FUNCTION__."($path)");
                      $path = $this->buildPath($path);
                      if (!isset($this->statCache[$path])) {
                          try {
              Severity: Major
              Found in apps/files_external/lib/Lib/Storage/SMB.php - About 3 hrs to fix

                Share has 26 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Share extends \OC\Share\Constants {
                    /**
                     * Register a sharing backend class that implements OCP\Share_Backend for an item type
                     * @param string $itemType Item type
                     * @param string $class Backend class
                Severity: Minor
                Found in lib/public/Share.php - About 3 hrs to fix

                  CacheJail has 26 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class CacheJail extends CacheWrapper {
                      /**
                       * @var string
                       */
                      protected $root;
                  Severity: Minor
                  Found in lib/private/Files/Cache/Wrapper/CacheJail.php - About 3 hrs to fix

                    Tags has 26 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Tags implements \OCP\ITags {
                        /**
                         * Tags
                         *
                         * @var array
                    Severity: Minor
                    Found in lib/private/Tags.php - About 3 hrs to fix

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

                      class Manager implements IManager {
                          /** @var IRequest */
                          protected $request;
                      
                          /** @var IUserSession */
                      Severity: Minor
                      Found in lib/private/Activity/Manager.php - About 3 hrs to fix

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

                            public function changeSchema(Schema $schema, array $options) {
                                $prefix = $options['tablePrefix'];
                                if (!$schema->hasTable("{$prefix}share")) {
                                    $table = $schema->createTable("{$prefix}share");
                                    $table->addColumn('id', 'integer', [
                        Severity: Major
                        Found in core/Migrations/Version20170315173825.php - About 3 hrs to fix

                          File ast.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          OC.L10N.register(
                              "core",
                              {
                              "Please select a file." : "Por favor esbilla un ficheru.",
                              "File is too big" : "Ficheru ye demasiáu grande",
                          Severity: Minor
                          Found in core/l10n/ast.js - About 3 hrs to fix

                            Function afterCall has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        var afterCall = function(data, statusText, xhr) {
                                            var messages = [];
                                            if (xhr.status === 200 && data) {
                                                if (!data.serverHasInternetConnection) {
                                                    messages.push({
                            Severity: Major
                            Found in core/js/setupchecks.js - About 2 hrs to fix

                              File SFTP.php has 290 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              <?php
                              /**
                               * @author Andreas Fischer <bantu@owncloud.com>
                               * @author Bart Visscher <bartv@thisnet.nl>
                               * @author hkjolhede <hkjolhede@gmail.com>
                              Severity: Minor
                              Found in apps/files_external/lib/Lib/Storage/SFTP.php - About 2 hrs to fix

                                Method basicOperation has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function basicOperation($operation, $path, $hooks = [], $extraParam = null) {
                                        $postFix = (\substr($path, -1, 1) === '/') ? '/' : '';
                                        $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
                                        if (Filesystem::isValidPath($path)
                                            and !Filesystem::isForbiddenFileOrDir($path)
                                Severity: Major
                                Found in lib/private/Files/View.php - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language