owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

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

OC.L10N.register(
    "lib",
    {
    "Unknown filetype" : "Nepoznat tip fajla",
    "Invalid image" : "Neispravna slika",
Severity: Major
Found in lib/l10n/sr@latin.js and 5 other locations - About 3 hrs to fix
apps/comments/l10n/et_EE.js on lines 1..22
apps/federatedfilesharing/l10n/mk.js on lines 1..22
apps/files_external/l10n/de_AT.js on lines 1..22
core/l10n/jv.js on lines 1..22
lib/l10n/kn.js on lines 1..22

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

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

OC.L10N.register(
    "files_external",
    {
    "Step 1 failed. Exception: %s" : "Schritt 1 ist fehlgeschlagen. Ausnahme: %s",
    "Step 2 failed. Exception: %s" : "Schritt 2 ist fehlgeschlagen. Ausnahme: %s",
Severity: Major
Found in apps/files_external/l10n/de_AT.js and 5 other locations - About 3 hrs to fix
apps/comments/l10n/et_EE.js on lines 1..22
apps/federatedfilesharing/l10n/mk.js on lines 1..22
core/l10n/jv.js on lines 1..22
lib/l10n/kn.js on lines 1..22
lib/l10n/sr@latin.js on lines 1..22

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

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

OC.L10N.register(
    "federatedfilesharing",
    {
    "Federated sharing" : "Федерирано споделување",
    "Loading..." : "Вчитување",
Severity: Major
Found in apps/federatedfilesharing/l10n/mk.js and 5 other locations - About 3 hrs to fix
apps/comments/l10n/et_EE.js on lines 1..22
apps/files_external/l10n/de_AT.js on lines 1..22
core/l10n/jv.js on lines 1..22
lib/l10n/kn.js on lines 1..22
lib/l10n/sr@latin.js on lines 1..22

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

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 sl.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
Open

OC.L10N.register(
    "settings",
    {
    "No user supplied" : "Ni navedenega uporabnika",
    "Authentication error" : "Napaka overjanja",
Severity: Minor
Found in settings/l10n/sl.js - About 3 hrs to fix

    Method getCalendarsForUser has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getCalendarsForUser($principalUri) {
            $principalUriOriginal = $principalUri;
            $principalUri = $this->convertPrincipal($principalUri, true);
            $fields = \array_values($this->propertyMap);
            $fields[] = 'id';
    Severity: Major
    Found in apps/dav/lib/CalDAV/CalDavBackend.php - About 3 hrs to fix

      Method initPaths has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function initPaths() {
              if (\defined('PHPUNIT_CONFIG_DIR')) {
                  self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
              } elseif (\defined('PHPUNIT_RUN') and PHPUNIT_RUN and \is_dir(OC::$SERVERROOT . '/tests/config/')) {
                  self::$configDir = OC::$SERVERROOT . '/tests/config/';
      Severity: Major
      Found in lib/kernel.php - About 3 hrs to fix

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

            protected function execute(InputInterface $input, OutputInterface $output): int {
                $appId = $input->getArgument('app-id');
        
                $checkList = new EmptyCheck();
                foreach ($input->getOption('checker') as $checker) {
        Severity: Major
        Found in core/Command/App/CheckCode.php - About 3 hrs to fix

          Method buildCoreRoles has 84 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function buildCoreRoles(AddRolesEvent $event) {
                  $event->addRole(
                      [
                          'id' => 'core.viewer',
                          'displayName' => $this->l10n->t('Download / View'),
          Severity: Major
          Found in core/Controller/RolesController.php - About 3 hrs to fix

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

                $('#legal_privacy_policy').change(function () {
                    OC.msg.startSaving('#legal_privacy_policy');
                    var post = {
                        privacyPolicy : $("#legal_privacy_policy").val()
                    };
            Severity: Major
            Found in settings/js/panels/legal.js and 1 other location - About 3 hrs to fix
            settings/js/panels/legal.js on lines 2..10

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

            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

                $('#legal_imprint').change(function () {
                    OC.msg.startSaving('#legal_imprint');
                    var post = {
                        imprintUrl : $("#legal_imprint").val()
                    };
            Severity: Major
            Found in settings/js/panels/legal.js and 1 other location - About 3 hrs to fix
            settings/js/panels/legal.js on lines 11..19

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

            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 Local.php has 306 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * @author Bart Visscher <bartv@thisnet.nl>
             * @author Boris Rybalkin <ribalkin@gmail.com>
             * @author Brice Maron <brice@bmaron.net>
            Severity: Minor
            Found in lib/private/Files/Storage/Local.php - About 3 hrs to fix

              Storage has 28 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Storage {
                  public const DEFAULTENABLED=true;
                  public const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota
                  public const VERSIONS_ROOT = 'files_versions/';
              
              
              Severity: Minor
              Found in apps/files_versions/lib/Storage.php - About 3 hrs to fix

                File sv.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                OC.L10N.register(
                    "settings",
                    {
                    "No user supplied" : "Ingen användare angiven",
                    "Authentication error" : "Fel vid autentisering",
                Severity: Minor
                Found in settings/l10n/sv.js - About 3 hrs to fix

                  Function fail has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                  fail: function(e, data) {
                                      var upload = self.getUpload(data);
                                      if (upload && upload.data && upload.data.stalled) {
                                          self.log('retry', e, upload);
                                          // jQuery Widget Factory uses "namespace-widgetname" since version 1.10.0:
                  Severity: Major
                  Found in apps/files/js/file-upload.js - About 3 hrs to fix

                    Function checkSetup has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            checkSetup: function() {
                                var deferred = $.Deferred();
                                var afterCall = function(data, statusText, xhr) {
                                    var messages = [];
                                    if (xhr.status === 200 && data) {
                    Severity: Major
                    Found in core/js/setupchecks.js - About 3 hrs to fix

                      Method getLocks has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getLocks($uri, $returnChildLocks) {
                              try {
                                  $node = $this->tree->getNodeForPath($uri);
                      
                                  if ($node instanceof SharedFile || $node instanceof SharedFolder) {
                      Severity: Major
                      Found in apps/dav/lib/Files/FileLocksBackend.php - About 3 hrs to fix

                        Method unshareFromSelf has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function unshareFromSelf($itemType, $itemOrigin, $originIsSource = false) {
                                $originType = ($originIsSource) ? 'source' : 'target';
                                $uid = \OCP\User::getUser();
                        
                                if ($itemType === 'file' || $itemType === 'folder') {
                        Severity: Major
                        Found in lib/private/Share/Share.php - About 3 hrs to fix

                          Function singleSelect has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              $.fn.singleSelect = function () {
                                  return this.each(function (i, select) {
                                      var input = $('<input/>'),
                                          placement = $(select).attr('data-tooltip-placement'),
                                          inputTooltip = $(select).attr('data-inputtitle');
                          Severity: Major
                          Found in core/js/singleselect.js - About 3 hrs to fix

                            Method scanFiles has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function scanFiles($user, $path, $verbose, OutputInterface $output, $backgroundScan = false, $shouldRepair = false) {
                                    $connection = $this->reconnectToDatabase($output);
                                    $scanner = new \OC\Files\Utils\Scanner($user, $connection, \OC::$server->getLogger());
                                    if ($shouldRepair) {
                                        $scanner->listen('\OC\Files\Utils\Scanner', 'beforeScanStorage', function ($storage) use ($output, $connection) {
                            Severity: Major
                            Found in apps/files/lib/Command/Scan.php - About 3 hrs to fix

                              Method setupDatabase has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function setupDatabase($username) {
                                      $e_host = \addslashes($this->dbHost);
                                      $e_dbname = \addslashes($this->dbName);
                                      //check if the database user has admin right
                                      if ($this->dbConnectionString !== null) {
                              Severity: Major
                              Found in lib/private/Setup/OCI.php - About 3 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language