owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Function getSharedWith has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSharedWith($userId, $shareType, $node, $limit, $offset) {
        /** @var Share[] $shares */
        $shares = [];

        if ($shareType === \OCP\Share::SHARE_TYPE_USER) {
Severity: Minor
Found in lib/private/Share20/DefaultShareProvider.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 loadCommands has a Cognitive Complexity of 33 (exceeds 5 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: Minor
Found in lib/private/Console/Application.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

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

OC.L10N.register(
    "files_sharing",
    {
    "Uploading..." : "Laai tans op…",
    "Cancel" : "Kanseleer",
Severity: Major
Found in apps/files_sharing/l10n/af_ZA.js and 2 other locations - About 4 hrs to fix
apps/files/l10n/bn_IN.js on lines 1..28
apps/files/l10n/ms_MY.js on lines 1..28

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

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

OC.L10N.register(
    "files",
    {
    "Close" : "বন্ধ",
    "Uploading..." : "আপলোডইং ...",
Severity: Major
Found in apps/files/l10n/bn_IN.js and 2 other locations - About 4 hrs to fix
apps/files/l10n/ms_MY.js on lines 1..28
apps/files_sharing/l10n/af_ZA.js on lines 1..28

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

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

OC.L10N.register(
    "files",
    {
    "Close" : "Tutup",
    "Upload cancelled." : "Muatnaik dibatalkan.",
Severity: Major
Found in apps/files/l10n/ms_MY.js and 2 other locations - About 4 hrs to fix
apps/files/l10n/bn_IN.js on lines 1..28
apps/files_sharing/l10n/af_ZA.js on lines 1..28

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

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

Method __construct has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct(array $urlParams = []) {
        parent::__construct('files_sharing', $urlParams);

        $container = $this->getContainer();
        $server = $container->getServer();
Severity: Major
Found in apps/files_sharing/lib/AppInfo/Application.php - About 4 hrs to fix

    File el.js has 370 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/el.js - About 4 hrs to fix

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

      OC.L10N.register(
          "core",
          {
          "Please select a file." : "Proszę wybrać plik",
          "File is too big" : "Plik jest za duży",
      Severity: Minor
      Found in core/l10n/pl.js - About 4 hrs to fix

        File ru_RU.js has 369 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/ru_RU.js - About 4 hrs to fix

          File th_TH.js has 367 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/th_TH.js - About 4 hrs to fix

            File api.php has 367 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * @author Bart Visscher <bartv@thisnet.nl>
             * @author Bernhard Posselt <dev@bernhard-posselt.com>
             * @author Björn Schießle <bjoern@schiessle.org>
            Severity: Minor
            Found in lib/private/legacy/api.php - About 4 hrs to fix

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

                      initialize: function($el, options) {
                          var self = this;
                          options = options || {};
                          if (this.initialized) {
                              return;
              Severity: Major
              Found in apps/files/js/filelist.js - About 4 hrs to fix

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

                            $.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'),
                                    params,
                                    function(result) {
                                        if (allFiles) {
                                            if (result.status !== 'success') {
                Severity: Major
                Found in apps/files_trashbin/js/filelist.js and 1 other location - About 4 hrs to fix
                apps/files_trashbin/js/filelist.js on lines 208..224

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

                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

                            $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'),
                                params,
                                function(result) {
                                    if (allFiles) {
                                        if (result.status !== 'success') {
                Severity: Major
                Found in apps/files_trashbin/js/filelist.js and 1 other location - About 4 hrs to fix
                apps/files_trashbin/js/filelist.js on lines 258..274

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

                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 decryptUsersFiles has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function decryptUsersFiles($uid, ProgressBar $progress, $userCount) {
                        $this->setupUserFS($uid);
                        $directories = [];
                        $directories[] = '/' . $uid . '/files';
                
                
                Severity: Minor
                Found in lib/private/Encryption/DecryptAll.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 ja.js has 364 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/ja.js - About 4 hrs to fix

                  File SyncBackend.php has 364 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * @author Jörn Friedrich Dreyer <jfd@butonic.de>
                   * @author Thomas Müller <thomas.mueller@tmit.eu>
                   *
                  Severity: Minor
                  Found in core/Command/User/SyncBackend.php - About 4 hrs to fix

                    File nb_NO.js has 363 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    OC.L10N.register(
                        "settings",
                        {
                        "Wrong current password" : "Feil nåværende passord",
                        "The new password cannot be the same as the previous one" : "Det nye passordet kan ikke være det samme som det forrige",
                    Severity: Minor
                    Found in settings/l10n/nb_NO.js - About 4 hrs to fix

                      File StoragesService.php has 363 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * @author Jesús Macias <jmacias@solidgear.es>
                       * @author Lukas Reschke <lukas@statuscode.ch>
                       * @author Robin Appelman <icewind@owncloud.com>
                      Severity: Minor
                      Found in lib/private/Files/External/Service/StoragesService.php - About 4 hrs to fix

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

                                    return $.ajax({
                                        type: 'DELETE',
                                        url: this._getUrl('shares/' + encodeURIComponent(shareId)),
                                    }).done(function() {
                                        self.fetch({
                        Severity: Major
                        Found in core/js/shareitemmodel.js and 1 other location - About 4 hrs to fix
                        core/js/shareitemmodel.js on lines 234..260

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

                        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