owncloud/core

View on GitHub

Showing 3,236 of 4,502 total issues

Preview has 45 functions (exceeds 20 allowed). Consider refactoring.
Open

class Preview {
    //the thumbnail folder
    public const THUMBNAILS_FOLDER = 'thumbnails';

    public const MODE_FILL = 'fill';
Severity: Minor
Found in lib/private/Preview.php - About 6 hrs to fix

    OC_App has 45 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class OC_App {
        private static $adminForms = [];
        private static $personalForms = [];
        private static $appTypes = [];
        private static $loadedApps = [];
    Severity: Minor
    Found in lib/private/legacy/app.php - About 6 hrs to fix

      Function getUsers has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function getUsers($search) {
              $this->result['users'] = $this->result['exact']['users'] = $users = [];
      
              if (\strlen(\trim($search)) === 0 && $this->userSearch->getSearchMinLength() > 0) {
                  $this->result['users'] = [];
      Severity: Minor
      Found in apps/files_sharing/lib/Controller/ShareesController.php - About 6 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

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

      class Share implements IShare {
          /** @var string */
          private $id;
          /** @var string */
          private $providerId;
      Severity: Minor
      Found in lib/private/Share20/Share.php - About 6 hrs to fix

        Session has 44 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Session implements IUserSession, Emitter {
            use EventEmitterTrait;
            /** @var IUserManager | PublicEmitter $manager */
            private $manager;
        
        
        Severity: Minor
        Found in lib/private/User/Session.php - About 6 hrs to fix

          File en_GB.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          OC.L10N.register(
              "settings",
              {
              "Wrong current password" : "Wrong current password",
              "The new password cannot be the same as the previous one" : "The new password cannot be the same as the previous one",
          Severity: Minor
          Found in settings/l10n/en_GB.js - About 5 hrs to fix

            File ru_RU.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            OC.L10N.register(
                "settings",
                {
                "Wrong current password" : "Старый пароль неверен",
                "The new password cannot be the same as the previous one" : "Новый пароль не совпадать с предыдущим",
            Severity: Minor
            Found in settings/l10n/ru_RU.js - About 5 hrs to fix

              File de_DE.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              OC.L10N.register(
                  "settings",
                  {
                  "Wrong current password" : "Falsches aktuelles Passwort",
                  "The new password cannot be the same as the previous one" : "Das neue Passwort kann nicht das gleiche sein wie das alte",
              Severity: Minor
              Found in settings/l10n/de_DE.js - About 5 hrs to fix

                File sq.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                OC.L10N.register(
                    "settings",
                    {
                    "Wrong current password" : "Fjalëkalim i tanishëm i gabuar",
                    "The new password cannot be the same as the previous one" : "Fjalëkalimi i ri s’mund të jetë i njëjtë me atë të mëparshmin",
                Severity: Minor
                Found in settings/l10n/sq.js - About 5 hrs to fix

                  File pt_BR.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  OC.L10N.register(
                      "settings",
                      {
                      "Wrong current password" : "Senha atual incorreta",
                      "The new password cannot be the same as the previous one" : "A nova senha não pode ser a mesma que a anterior",
                  Severity: Minor
                  Found in settings/l10n/pt_BR.js - About 5 hrs to fix

                    File ug.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    OC.L10N.register(
                        "settings",
                        {
                        "Wrong current password" : "نۆۋەتتىكى ئىم خاتا",
                        "The new password cannot be the same as the previous one" : "يېڭى ئىم ئالدىنقى ئىمغا ئوخشاش بولسا بولمايدۇ",
                    Severity: Minor
                    Found in settings/l10n/ug.js - About 5 hrs to fix

                      File de.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      OC.L10N.register(
                          "settings",
                          {
                          "Wrong current password" : "Das aktuelle Passwort ist falsch.",
                          "The new password cannot be the same as the previous one" : "Das neue Passwort kann nicht identisch zum alten Passwort sein.",
                      Severity: Minor
                      Found in settings/l10n/de.js - About 5 hrs to fix

                        File tr.js has 414 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        OC.L10N.register(
                            "settings",
                            {
                            "Wrong current password" : "Şimdiki parola yanlış",
                            "The new password cannot be the same as the previous one" : "Yeni parola eskisiyle aynı olamaz",
                        Severity: Minor
                        Found in settings/l10n/tr.js - About 5 hrs to fix

                          Function index has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function index($offset = 0, $limit = 10, $gid = '', $pattern = '', $backend = '') {
                                  // FIXME: The JS sends the group '_everyone' instead of no GID for the "all users" group.
                                  if ($gid === '_everyone') {
                                      $gid = '';
                                  }
                          Severity: Minor
                          Found in settings/Controller/UsersController.php - About 5 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 getLocks has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function getLocks($uri, $returnChildLocks) {
                                  try {
                                      $node = $this->tree->getNodeForPath($uri);
                          
                                      if ($node instanceof SharedFile || $node instanceof SharedFolder) {
                          Severity: Minor
                          Found in apps/dav/lib/Files/FileLocksBackend.php - About 5 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 listMounts has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function listMounts($userId, array $mounts, InputInterface $input, OutputInterface $output) {
                                  $outputType = $input->getOption('output');
                                  $outputIsJson = ($outputType === self::OUTPUT_FORMAT_JSON) || ($outputType === self::OUTPUT_FORMAT_JSON_PRETTY);
                                  $shortView = $input->getOption('short');
                                  $importableView = $input->getOption('importable-format');
                          Severity: Minor
                          Found in apps/files_external/lib/Command/ListCommand.php - About 5 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 getInternalDriveFile has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function getInternalDriveFile($path) {
                                  // Remove leading and trailing slashes
                                  $path = \trim($path, '/');
                                  if ($path === '.') {
                                      $path = '';
                          Severity: Minor
                          Found in apps/files_external/lib/Lib/Storage/Google.php - About 5 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 position has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          $.fn.position = function( options ) {
                              if ( !options || !options.of ) {
                                  return _position.apply( this, arguments );
                              }
                          
                          
                          Severity: Major
                          Found in core/js/js.js - About 5 hrs to fix

                            FailedStorage has 43 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class FailedStorage extends Common {
                                /** @var \Exception */
                                protected $e;
                            
                                /**
                            Severity: Minor
                            Found in lib/private/Files/Storage/FailedStorage.php - About 5 hrs to fix

                              Function autocompleteHandler has 145 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      autocompleteHandler: function (search, response) {
                                          var view = this;
                                          var $loading = this.$el.find('.shareWithLoading');
                                          var trimmedSearch = search.term.trim();
                                          $loading.removeClass('hidden');
                              Severity: Major
                              Found in core/js/sharedialogview.js - About 5 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language