owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method createServer has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function createServer(
        $baseUri,
        $requestUri,
        BackendInterface $authBackend,
        callable $viewCallBack,
Severity: Major
Found in apps/dav/lib/Connector/Sabre/ServerFactory.php - About 3 hrs to fix

    Method handleRequest has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function handleRequest() {
            \OC::$server->getEventLogger()->start('handle_request', 'Handle request');
            $systemConfig = \OC::$server->getSystemConfig();
            // load all the classpaths from the enabled apps so they are available
            // in the routing files of each app
    Severity: Major
    Found in lib/kernel.php - About 3 hrs to fix

      File sl.js has 318 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      OC.L10N.register(
          "core",
          {
          "Please select a file." : "Izberite datoteko",
          "File is too big" : "Datoteka je prevelika",
      Severity: Minor
      Found in core/l10n/sl.js - About 3 hrs to fix

        File hu_HU.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        OC.L10N.register(
            "settings",
            {
            "Wrong current password" : "A jelenlegi jelszót helytelenül adtad meg",
            "The new password cannot be the same as the previous one" : "Az új jelszó nem lehet ugyanaz, mint az előző",
        Severity: Minor
        Found in settings/l10n/hu_HU.js - About 3 hrs to fix

          File da.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          OC.L10N.register(
              "settings",
              {
              "No user supplied" : "Intet brugernavn givet",
              "Authentication error" : "Adgangsfejl",
          Severity: Minor
          Found in settings/l10n/da.js - About 3 hrs to fix

            File nn_NO.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            OC.L10N.register(
                "core",
                {
                "Please select a file." : "Ver venleg og vel ei fil.",
                "File is too big" : "Fila er for stor",
            Severity: Minor
            Found in core/l10n/nn_NO.js - About 3 hrs to fix

              Method getPanel has 90 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getPanel() {
                      $l = $this->lfactory->get('settings');
                      $activeLangCode = $this->config->getAppValue(
                          'core',
                          'shareapi_public_notification_lang',
              Severity: Major
              Found in settings/Panels/Admin/FileSharing.php - About 3 hrs to fix

                Method parse has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function parse($file) {
                        if (!\is_file($file)) {
                            throw new AppNotFoundException(
                                \sprintf('%s does not exist', $file)
                            );
                Severity: Major
                Found in lib/private/App/InfoParser.php - About 3 hrs to fix

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

                      $('#CheckboxLastLogin').click(function() {
                          if ($('#CheckboxLastLogin').is(':checked')) {
                              $("#userlist .lastLogin").show();
                              OC.AppConfig.setValue('core', 'umgmt_show_last_login', 'true');
                          } else {
                  Severity: Major
                  Found in settings/js/users/users.js and 6 other locations - About 3 hrs to fix
                  settings/js/users/users.js on lines 1009..1017
                  settings/js/users/users.js on lines 1023..1031
                  settings/js/users/users.js on lines 1037..1045
                  settings/js/users/users.js on lines 1067..1075
                  settings/js/users/users.js on lines 1081..1089
                  settings/js/users/users.js on lines 1111..1119

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

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

                      $('#CheckboxEmailAddress').click(function() {
                          if ($('#CheckboxEmailAddress').is(':checked')) {
                              $("#userlist .mailAddress").show();
                              OC.AppConfig.setValue('core', 'umgmt_show_email', 'true');
                          } else {
                  Severity: Major
                  Found in settings/js/users/users.js and 6 other locations - About 3 hrs to fix
                  settings/js/users/users.js on lines 1009..1017
                  settings/js/users/users.js on lines 1023..1031
                  settings/js/users/users.js on lines 1037..1045
                  settings/js/users/users.js on lines 1053..1061
                  settings/js/users/users.js on lines 1081..1089
                  settings/js/users/users.js on lines 1111..1119

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

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

                      $('#CheckboxStorageLocation').click(function() {
                          if ($('#CheckboxStorageLocation').is(':checked')) {
                              $("#userlist .storageLocation").show();
                              OC.AppConfig.setValue('core', 'umgmt_show_storage_location', 'true');
                          } else {
                  Severity: Major
                  Found in settings/js/users/users.js and 6 other locations - About 3 hrs to fix
                  settings/js/users/users.js on lines 1009..1017
                  settings/js/users/users.js on lines 1037..1045
                  settings/js/users/users.js on lines 1053..1061
                  settings/js/users/users.js on lines 1067..1075
                  settings/js/users/users.js on lines 1081..1089
                  settings/js/users/users.js on lines 1111..1119

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

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

                      $('#CheckboxIsEnabled').click(function () {
                          if ($('#CheckboxIsEnabled').is(':checked')) {
                              $("#userlist .enabled").show();
                              OC.AppConfig.setValue('core', 'umgmt_show_is_enabled', 'true');
                          } else {
                  Severity: Major
                  Found in settings/js/users/users.js and 6 other locations - About 3 hrs to fix
                  settings/js/users/users.js on lines 1023..1031
                  settings/js/users/users.js on lines 1037..1045
                  settings/js/users/users.js on lines 1053..1061
                  settings/js/users/users.js on lines 1067..1075
                  settings/js/users/users.js on lines 1081..1089
                  settings/js/users/users.js on lines 1111..1119

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

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

                      $('#CheckboxUserBackend').click(function() {
                          if ($('#CheckboxUserBackend').is(':checked')) {
                              $("#userlist .userBackend").show();
                              OC.AppConfig.setValue('core', 'umgmt_show_backend', 'true');
                          } else {
                  Severity: Major
                  Found in settings/js/users/users.js and 6 other locations - About 3 hrs to fix
                  settings/js/users/users.js on lines 1009..1017
                  settings/js/users/users.js on lines 1023..1031
                  settings/js/users/users.js on lines 1037..1045
                  settings/js/users/users.js on lines 1053..1061
                  settings/js/users/users.js on lines 1067..1075
                  settings/js/users/users.js on lines 1111..1119

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

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

                          $('#CheckboxCreationTime').click(function() {
                                  if ($('#CheckboxCreationTime').is(':checked')) {
                                          $("#userlist .creationTime").show();
                                          OC.AppConfig.setValue('core', 'umgmt_show_creation_time', 'true');
                                  } else {
                  Severity: Major
                  Found in settings/js/users/users.js and 6 other locations - About 3 hrs to fix
                  settings/js/users/users.js on lines 1009..1017
                  settings/js/users/users.js on lines 1023..1031
                  settings/js/users/users.js on lines 1053..1061
                  settings/js/users/users.js on lines 1067..1075
                  settings/js/users/users.js on lines 1081..1089
                  settings/js/users/users.js on lines 1111..1119

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

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

                      $('#CheckboxQuota').click(function() {
                          if ($('#CheckboxQuota').is(':checked')) {
                              $("#userlist .quota").show();
                              OC.AppConfig.setValue('core', 'umgmt_show_quota', 'true');
                          } else {
                  Severity: Major
                  Found in settings/js/users/users.js and 6 other locations - About 3 hrs to fix
                  settings/js/users/users.js on lines 1009..1017
                  settings/js/users/users.js on lines 1023..1031
                  settings/js/users/users.js on lines 1037..1045
                  settings/js/users/users.js on lines 1053..1061
                  settings/js/users/users.js on lines 1067..1075
                  settings/js/users/users.js on lines 1081..1089

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

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

                  OC.Tags= {
                      edit:function(type, cb) {
                          if(!type && !this.type) {
                              throw {
                                  name: 'MissingParameter',
                  Severity: Minor
                  Found in core/js/tags.js - About 3 hrs to fix

                    File multiselect.js has 316 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /**
                     * @param 'createCallback' A function to be called when a new entry is created.
                     *    Two arguments are supplied to this function:
                     *    The select element used and the value of the option. If the function
                     *    returns false addition will be cancelled. If it returns
                    Severity: Minor
                    Found in core/js/multiselect.js - About 3 hrs to fix

                      Function message has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                          message:function(content, title, dialogType, buttons, callback, modal, cssClass) {
                              return $.when(this._getMessageTemplate()).then(function($tmpl) {
                                  var dialogName = 'oc-dialog-' + OCdialogs.dialogsCounter + '-content';
                                  var dialogId = '#' + dialogName;
                                  var $dlg = $tmpl.octemplate({
                      Severity: Minor
                      Found in core/js/oc-dialogs.js - About 3 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 changeUserPassword has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function changeUserPassword($args) {
                              // Check if we are an user
                              \OC_JSON::callCheck();
                              \OC_JSON::checkLoggedIn();
                      
                      
                      Severity: Minor
                      Found in settings/ChangePassword/Controller.php - About 3 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 formatShare has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function formatShare(IShare $share, $received = false) {
                              $sharedBy = $this->userManager->get($share->getSharedBy());
                              $shareFileOwner = $this->userManager->get($share->getShareOwner());
                      
                              $result = [
                      Severity: Minor
                      Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 3 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

                      Severity
                      Category
                      Status
                      Source
                      Language