owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

File nl.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
Open

OC.L10N.register(
    "core",
    {
    "Please select a file." : "Selecteer een bestand.",
    "File is too big" : "Bestand te groot",
Severity: Minor
Found in core/l10n/nl.js - About 4 hrs to fix

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

    OC.L10N.register(
        "core",
        {
        "Please select a file." : "Vennligst velg en fil.",
        "File is too big" : "Filen er for stor",
    Severity: Minor
    Found in core/l10n/nb_NO.js - About 4 hrs to fix

      Function getAssignableAndRemovableGroups has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getAssignableAndRemovableGroups() {
              $assignableGroups = [];
              $removableGroups = [];
      
              $currentUser = $this->userSession->getUser();
      Severity: Minor
      Found in settings/Controller/GroupsController.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 getDenormalizedData has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getDenormalizedData($calendarData) {
              $vObject = Reader::read($calendarData);
              $componentType = null;
              $component = null;
              $firstOccurrence = null;
      Severity: Minor
      Found in apps/dav/lib/CalDAV/CalDavBackend.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 execute has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output): int {
              $user = $input->getOption('user');
              $path = $input->getArgument('path');
              if ($path === '-') {
                  $json = \file_get_contents('php://stdin');
      Severity: Minor
      Found in apps/files_external/lib/Command/Import.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

      Method changeUserPassword has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function changeUserPassword($args) {
              // Check if we are an user
              \OC_JSON::callCheck();
              \OC_JSON::checkLoggedIn();
      
      
      Severity: Major
      Found in settings/ChangePassword/Controller.php - About 4 hrs to fix

        Method rename has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function rename($path1, $path2) {
                return $this->emittingCall(function () use (&$path1, &$path2) {
                    $absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
                    $absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
                    $result = false;
        Severity: Major
        Found in lib/private/Files/View.php - About 4 hrs to fix

          Method changeSchema has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function changeSchema(Schema $schema, array $options) {
                  $prefix = $options['tablePrefix'];
                  if (!$schema->hasTable("{$prefix}external_mounts")) {
                      $table = $schema->createTable("{$prefix}external_mounts");
                      $table->addColumn('mount_id', 'bigint', [
          Severity: Major
          Found in core/Migrations/Version20170111103310.php - About 4 hrs to fix

            AbstractNode has 32 functions (exceeds 20 allowed). Consider refactoring.
            Open

            abstract class AbstractNode implements \OCP\Files\Node {
                /**
                 * @inheritdoc
                 */
                public function getMimePart() {
            Severity: Minor
            Found in lib/private/Files/Node/AbstractNode.php - About 4 hrs to fix

              FileInfo has 32 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
                  /**
                   * @var array $data
                   */
                  private $data;
              Severity: Minor
              Found in lib/private/Files/FileInfo.php - About 4 hrs to fix

                Encryption has 32 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Encryption extends Wrapper {
                    use LocalTempFileTrait;
                
                    /** @var string */
                    private $mountPoint;
                Severity: Minor
                Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 4 hrs to fix

                  Notification has 32 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Notification implements INotification {
                      /** @var string */
                      protected $app;
                  
                      /** @var string */
                  Severity: Minor
                  Found in lib/private/Notification/Notification.php - About 4 hrs to fix

                    OC_User has 32 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class OC_User {
                        /**
                         * @return \OC\User\Session
                         */
                        public static function getUserSession() {
                    Severity: Minor
                    Found in lib/private/legacy/user.php - About 4 hrs to fix

                      User has 32 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class User implements IUser {
                          use EventEmitterTrait;
                      
                          /** @var Account */
                          private $account;
                      Severity: Minor
                      Found in lib/private/User/User.php - About 4 hrs to fix

                        File id.js has 333 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        OC.L10N.register(
                            "core",
                            {
                            "Please select a file." : "Silakan pilih sebuah berkas.",
                            "File is too big" : "Berkas terlalu besar",
                        Severity: Minor
                        Found in core/l10n/id.js - About 4 hrs to fix

                          File DIContainer.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * @author Bernhard Posselt <dev@bernhard-posselt.com>
                           * @author Christoph Wurst <christoph@owncloud.com>
                           * @author Joas Schilling <coding@schilljs.com>
                          Severity: Minor
                          Found in lib/private/AppFramework/DependencyInjection/DIContainer.php - About 4 hrs to fix

                            File share.js has 332 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*
                             * Copyright (c) 2014
                             *
                             * This file is licensed under the Affero General Public License version 3
                             * or later.
                            Severity: Minor
                            Found in apps/files_sharing/js/share.js - About 4 hrs to fix

                              Method downloadShare has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function downloadShare($token, $files = null, $path = '', $downloadStartSecret = '') {
                                      \OC_User::setIncognitoMode(true);
                              
                                      $share = $this->shareManager->getShareByToken($token);
                              
                              
                              Severity: Major
                              Found in apps/files_sharing/lib/Controllers/ShareController.php - About 3 hrs to fix

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

                                $this->create('files.viewcontroller.showFile', '/f/{fileId}')->action(static function ($urlParams) {
                                    $webBaseUrl = \OC::$server->getConfig()->getSystemValue('web.baseUrl', null);
                                    if (!$webBaseUrl) {
                                        // Check the old phoenix.baseUrl system key to provide compatibility across the name change
                                        $webBaseUrl = \OC::$server->getConfig()->getSystemValue('phoenix.baseUrl', null);
                                Severity: Major
                                Found in core/routes.php and 1 other location - About 3 hrs to fix
                                core/routes.php on lines 120..134

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

                                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

                                $this->create('files_sharing.sharecontroller.showShare', '/s/{token}')->action(static function ($urlParams) {
                                    $webBaseUrl = \OC::$server->getConfig()->getSystemValue('web.baseUrl', null);
                                    if (!$webBaseUrl) {
                                        // Check the old phoenix.baseUrl system key to provide compatibility across the name change
                                        $webBaseUrl = \OC::$server->getConfig()->getSystemValue('phoenix.baseUrl', null);
                                Severity: Major
                                Found in core/routes.php and 1 other location - About 3 hrs to fix
                                core/routes.php on lines 103..117

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

                                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