owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method getBuiltInPanel has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getBuiltInPanel($className) {
        $panels = [
            // Personal
            Profile::class => new Profile(
                $this->config,
Severity: Minor
Found in lib/private/Settings/SettingsManager.php - About 1 hr to fix

    Method fixUnencryptedSize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function fixUnencryptedSize($path, $size, $unencryptedSize) {
            $headerSize = $this->getHeaderSize($path);
            $header = $this->getHeader($path);
            $encryptionModule = $this->getEncryptionModule($path);
    
    
    Severity: Minor
    Found in lib/private/Files/Storage/Wrapper/Encryption.php - About 1 hr to fix

      Method setValue has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function setValue($app, $key, $value) {
              if ($value === null) {
                  $value = '';
              }
      
      
      Severity: Minor
      Found in lib/private/AppConfig.php - About 1 hr to fix

        Method buildProviderList has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function buildProviderList() {
                $services = [
                    'PRIVATE_DATA' => [
                        'version' => 1,
                        'endpoints' => [
        Severity: Minor
        Found in lib/private/OCS/Provider.php - About 1 hr to fix

          Method fixEntriesWithCorrectParentIdButWrongPath has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function fixEntriesWithCorrectParentIdButWrongPath(IOutput $out, $storageNumericId = null) {
                  $totalResultsCount = 0;
                  $affectedStorages = [$storageNumericId => true];
          
                  // find all entries where the path entry doesn't match the path value that would
          Severity: Minor
          Found in lib/private/Repair/RepairMismatchFileCachePath.php - About 1 hr to fix

            Method loginUser has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private static function loginUser() {
                    if (self::$isLoggedIn === true) {
                        return \OC_User::getUser();
                    }
            
            
            Severity: Minor
            Found in lib/private/legacy/api.php - About 1 hr to fix

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

                  public function changeSchema(Schema $schema, array $options) {
                      $prefix = $options['tablePrefix'];
                      $table = $schema->createTable("{$prefix}accounts");
                      $table->addColumn('id', Type::BIGINT, [
                          'autoincrement' => true,
              Severity: Minor
              Found in core/Migrations/Version20170214112458.php - About 1 hr to fix

                Method execute has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function execute(InputInterface $input, OutputInterface $output): int {
                        if ($input->getOption('list')) {
                            $backends = $this->userManager->getBackends();
                            foreach ($backends as $backend) {
                                $output->writeln(\get_class($backend));
                Severity: Minor
                Found in core/Command/User/SyncBackend.php - About 1 hr to fix

                  Method buildWebUri has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function buildWebUri(array $app_info, string $fileId): ?string {
                          $uri = null;
                          $app_name = $app_info['oc_app_name'];
                          # https://github.com/ONLYOFFICE/onlyoffice-owncloud/blob/2afca075249f24d857f0b3097d565f5129e88d17/appinfo/routes.php#LL27C47-L27C53
                          if ($app_name === 'onlyoffice') {
                  Severity: Minor
                  Found in core/Controller/AppRegistryController.php - About 1 hr to fix

                    Method tryLogin has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function tryLogin($user, $password, $redirect_url, $timezone = null, $remember_login = null) {
                            $originalUser = $user;
                            // TODO: Add all the insane error handling
                            $loginResult = $this->userSession->login($user, $password);
                            if ($loginResult !== true && $this->config->getSystemValue('strict_login_enforced', false) !== true) {
                    Severity: Minor
                    Found in core/Controller/LoginController.php - About 1 hr to fix

                      Method __construct has 15 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              $appName,
                              IRequest $request,
                              IManager $shareManager,
                              IGroupManager $groupManager,
                              IUserManager $userManager,
                      Severity: Major
                      Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 1 hr to fix

                        Method __construct has 15 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                ILogger $logger,
                                IConfig $config,
                                ISecureRandom $secureRandom,
                                IHasher $hasher,
                                IMountManager $mountManager,
                        Severity: Major
                        Found in lib/private/Share20/Manager.php - About 1 hr to fix

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

                              public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
                                  if ($app !== self::APP_NAME) {
                                      return false;
                                  }
                          
                          
                          Severity: Major
                          Found in apps/comments/lib/Activity/Extension.php and 3 other locations - About 1 hr to fix
                          apps/files/lib/Activity.php on lines 156..171
                          apps/files_sharing/lib/Activity.php on lines 173..188
                          apps/systemtags/lib/Activity/Extension.php on lines 120..135

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

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

                              public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
                                  if ($app !== self::APP_NAME) {
                                      return false;
                                  }
                          
                          
                          Severity: Major
                          Found in apps/systemtags/lib/Activity/Extension.php and 3 other locations - About 1 hr to fix
                          apps/comments/lib/Activity/Extension.php on lines 130..145
                          apps/files/lib/Activity.php on lines 156..171
                          apps/files_sharing/lib/Activity.php on lines 173..188

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

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

                              public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
                                  if ($app !== self::APP_FILES) {
                                      return false;
                                  }
                          
                          
                          Severity: Major
                          Found in apps/files/lib/Activity.php and 3 other locations - About 1 hr to fix
                          apps/comments/lib/Activity/Extension.php on lines 130..145
                          apps/files_sharing/lib/Activity.php on lines 173..188
                          apps/systemtags/lib/Activity/Extension.php on lines 120..135

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

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

                              public function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode) {
                                  if ($app !== self::FILES_SHARING_APP) {
                                      return false;
                                  }
                          
                          
                          Severity: Major
                          Found in apps/files_sharing/lib/Activity.php and 3 other locations - About 1 hr to fix
                          apps/comments/lib/Activity/Extension.php on lines 130..145
                          apps/files/lib/Activity.php on lines 156..171
                          apps/systemtags/lib/Activity/Extension.php on lines 120..135

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

                          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

                              public function setObject($objectType, $objectId) {
                                  if (
                                      !\is_string($objectType) || !\trim($objectType)
                                      || !\is_string($objectId)   || !\trim($objectId)
                                  ) {
                          Severity: Major
                          Found in lib/private/Comments/Comment.php and 1 other location - About 1 hr to fix
                          lib/private/Comments/Comment.php on lines 261..271

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

                          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

                              public function setActor($actorType, $actorId) {
                                  if (
                                      !\is_string($actorType) || !\trim($actorType)
                                      || !\is_string($actorId)   || !\trim($actorId)
                                  ) {
                          Severity: Major
                          Found in lib/private/Comments/Comment.php and 1 other location - About 1 hr to fix
                          lib/private/Comments/Comment.php on lines 347..357

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

                          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

                                  $(document).on('click', '#apps-list input.update', function () {
                                      var appId = $(this).data('appid');
                                      var element = $(this);
                          
                                      OC.Settings.Apps.updateApp(appId, element);
                          Severity: Major
                          Found in settings/js/admin-apps.js and 1 other location - About 1 hr to fix
                          settings/js/admin-apps.js on lines 617..622

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

                          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

                                  $(document).on('click', '#apps-list input.uninstall', function () {
                                      var appId = $(this).data('appid');
                                      var element = $(this);
                          
                                      OC.Settings.Apps.uninstallApp(appId, element);
                          Severity: Major
                          Found in settings/js/admin-apps.js and 1 other location - About 1 hr to fix
                          settings/js/admin-apps.js on lines 624..629

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

                          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