owncloud/core

View on GitHub

Showing 3,235 of 4,503 total issues

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

          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

            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

              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

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

                  public static function getVersions($uid, $filename) {
                      $versions = [];
                      if ($filename === null || $filename === '') {
                          return $versions;
                      }
              Severity: Minor
              Found in apps/files_versions/lib/Storage.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 rename has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function rename($path1, $path2) {
                      $file = $this->getDriveFile($path1);
                      if ($file) {
                          $newFile = $this->getDriveFile($path2);
                          $toUpdate = new DriveFile();
              Severity: Minor
              Found in apps/files_external/lib/Lib/Storage/Google.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 rename has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function rename($path1, $path2) {
                      $renameOk = false;
                      $copyKeysOk = true;  // assume keys are copied, in case we deal with versions
              
                      $isVersion = $this->isVersion($path2) || $this->isVersion($path1);
              Severity: Minor
              Found in lib/private/Files/Storage/Wrapper/Encryption.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 generateHashes has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function generateHashes(
                      \RecursiveIteratorIterator $iterator,
                      $path
                  ) {
                      $hashes = [];
              Severity: Minor
              Found in lib/private/IntegrityCheck/Checker.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 getDefaultPageUrl has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getDefaultPageUrl() {
                      $urlGenerator = \OC::$server->getURLGenerator();
                      // Deny the redirect if the URL contains a @
                      // This prevents unvalidated redirects like ?redirect_url=:user@domain.com
                      if (isset($_REQUEST['redirect_url']) && \strpos($_REQUEST['redirect_url'], '@') === false) {
              Severity: Minor
              Found in lib/private/legacy/util.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 getSharedWith has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getSharedWith($userId, $shareType, $node = null, $limit = 50, $offset = 0) {
                      $provider = $this->factory->getProviderForType($shareType);
              
                      $shares = $provider->getSharedWith($userId, $shareType, $node, $limit, $offset);
              
              
              Severity: Minor
              Found in lib/private/Share20/Manager.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 lock has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function lock($storageId, $internalPath, $fileId, array $lockInfo) {
                      if ($fileId <= 0) {
                          throw new \InvalidArgumentException('Invalid file id');
                      }
                      if (!isset($lockInfo['token'])) {
              Severity: Minor
              Found in lib/private/Lock/Persistent/LockManager.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 _chunkedUpload has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _chunkedUpload: function (options, testOnly) {
                          options.uploadedBytes = options.uploadedBytes || 0;
                          var that = this,
                              file = options.files[0],
                              fs = file.size,
              Severity: Major
              Found in apps/files/js/jquery.fileupload.js - About 3 hrs to fix

                File uk.js has 315 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/uk.js - About 3 hrs to fix

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

                  OC.L10N.register(
                      "core",
                      {
                      "Please select a file." : "Vælg fil",
                      "File is too big" : "Filen er for stor",
                  Severity: Minor
                  Found in core/l10n/da.js - About 3 hrs to fix

                    Method registerListeners has 89 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function registerListeners() {
                            $this->eventDispatcher->addListener(
                                'files.resolvePrivateLink',
                                function (GenericEvent $event) {
                                    $uid = $event->getArgument('uid');
                    Severity: Major
                    Found in apps/files_sharing/lib/Hooks.php - About 3 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language