owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method upgrade has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function upgrade() {
        $this->emitRepairEvents();

        $logLevel = $this->config->getSystemValue('loglevel', Util::WARN);
        $this->emit('\OC\Updater', 'setDebugLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]);
Severity: Minor
Found in lib/private/Updater.php - About 1 hr to fix

    Method getAppsFromMarket has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getAppsFromMarket(IOutput $output, $appList, $event) {
            $failedApps = [];
            foreach ($appList as $app) {
                $output->info("Fetching app from market: $app");
                try {
    Severity: Minor
    Found in lib/private/Repair/Apps.php - About 1 hr to fix

      Method linkTo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function linkTo($app, $file, $args = []) {
              $frontControllerActive = (\getenv('front_controller_active') === 'true');
              $webRoot = $this->environmentHelper->getWebRoot();
      
              if ($app != '') {
      Severity: Minor
      Found in lib/private/URLGenerator.php - About 1 hr to fix

        Method loadApp has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function loadApp($app, $checkUpgrade = true) {
                self::$loadedApps[] = $app;
                $appPath = self::getAppPath($app);
                if ($appPath === false) {
                    return;
        Severity: Minor
        Found in lib/private/legacy/app.php - About 1 hr to fix

          Method installShippedApp has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function installShippedApp($app) {
                  \OC::$server->getLogger()->info('Attempting to install shipped app: '.$app);
          
                  $info = OC_App::getAppInfo($app);
                  if ($info === null) {
          Severity: Minor
          Found in lib/private/Installer.php - About 1 hr to fix

            Method get has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get($uid, $evenMissing = false) {
                    // fix numeric uid that was cast by storing it in an array key
                    if (\is_numeric($uid)) {
                        $uid = (string)$uid;
                    }
            Severity: Minor
            Found in lib/private/User/Manager.php - About 1 hr to fix

              Method getLocksByPath has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getLocksByPath($storageId, $internalPath, $returnChildLocks) {
                      $query = $this->db->getQueryBuilder();
                      $internalPath = \rtrim($internalPath, '/');
              
                      /*
              Severity: Minor
              Found in lib/private/Lock/Persistent/LockMapper.php - About 1 hr to fix

                Method setPassword has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function setPassword($password, $recoveryPassword = null) {
                        if (!$this->allowUserAccountUpdate) {
                            throw new NotPermittedActionException("Operation cannot be allowed as other apps are fetching extended attributes of this user.");
                        }
                
                
                Severity: Minor
                Found in lib/private/User/User.php - About 1 hr to fix

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

                      public function changeSchema(Schema $schema, array $options) {
                          $prefix = $options['tablePrefix'];
                          if (!$schema->hasTable("{$prefix}account_terms")) {
                              $table = $schema->createTable("{$prefix}account_terms");
                  
                  
                  Severity: Minor
                  Found in core/Migrations/Version20170516100103.php - About 1 hr to fix

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

                        protected function execute(InputInterface $input, OutputInterface $output): int {
                            $toBeSet = [];
                    
                            if ($input->getOption('enable')) {
                                $toBeSet['log_type'] = 'owncloud';
                    Severity: Minor
                    Found in core/Command/Log/OwnCloud.php - About 1 hr to fix

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

                          protected function execute(InputInterface $input, OutputInterface $output): int {
                              $uid = $input->getArgument('uid');
                              $key = $input->getArgument('key');
                              $value = $input->getArgument('value');
                      
                      
                      Severity: Minor
                      Found in core/Command/User/Modify.php - About 1 hr to fix

                        Method configure has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function configure() {
                                $this
                                    ->setName('user:add')
                                    ->setDescription('adds a user')
                                    ->addArgument(
                        Severity: Minor
                        Found in core/Command/User/Add.php - About 1 hr to fix

                          Method handleRepairFeedback has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function handleRepairFeedback($event) {
                                  if (!$event instanceof GenericEvent) {
                                      return;
                                  }
                          
                          
                          Severity: Minor
                          Found in core/ajax/update.php - About 1 hr to fix

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

                                private function setUserVars($user, $input) {
                                    if (\is_array($input)) {
                                        foreach ($input as $key => $value) {
                                            if (\is_string($value)) {
                                                $input[$key] = \str_replace('$user', $user, $value);
                            Severity: Major
                            Found in lib/private/Files/External/ConfigAdapter.php and 1 other location - About 1 hr to fix
                            lib/private/Files/External/LegacyUtil.php on lines 166..179

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

                            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 getLocalFolder($path) {
                                    $parent = \substr($path, 0, \strrpos($path, '/'));
                                    $path = $this->getAbsolutePath($path);
                                    list($storage, $internalPath) = Filesystem::resolvePath($path);
                                    if (Filesystem::isValidPath($parent) and $storage) {
                            Severity: Major
                            Found in lib/private/Files/View.php and 1 other location - About 1 hr to fix
                            lib/private/Files/View.php on lines 247..256

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

                            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 getLocalFile($path) {
                                    $parent = \substr($path, 0, \strrpos($path, '/'));
                                    $path = $this->getAbsolutePath($path);
                                    list($storage, $internalPath) = Filesystem::resolvePath($path);
                                    if (Filesystem::isValidPath($parent) and $storage) {
                            Severity: Major
                            Found in lib/private/Files/View.php and 1 other location - About 1 hr to fix
                            lib/private/Files/View.php on lines 262..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 106.

                            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 static function setUserVars($user, $input) {
                                    if (\is_array($input)) {
                                        foreach ($input as $key => $value) {
                                            if (\is_string($value)) {
                                                $input[$key] = \str_replace('$user', $user, $value);
                            Severity: Major
                            Found in lib/private/Files/External/LegacyUtil.php and 1 other location - About 1 hr to fix
                            lib/private/Files/External/ConfigAdapter.php on lines 193..206

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

                            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

                                    if ($this->userSession instanceof IUserSession) {
                                        $user = $this->userSession->getUser();
                                        if (
                                            ($this->config->getSystemValue('allow_user_to_change_mail_address') === false) &&
                                            (($user !== null) && (!$this->groupManager->isAdmin($user->getUID()))) &&
                            Severity: Major
                            Found in lib/private/User/User.php and 1 other location - About 1 hr to fix
                            lib/private/User/User.php on lines 454..463

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

                            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

                                    $query->select('s.id', 's.file_source', 's.share_type', 's.parent', 'st.id', 's.uid_owner', 's.uid_initiator', 's.share_with')
                                        ->selectAlias('s.id', 'share_id')
                                        ->selectAlias('s.file_source', 'file_source')
                                        ->selectAlias('s.share_type', 'share_type')
                                        ->selectAlias('s.parent', 'share_parent')
                            Severity: Major
                            Found in apps/files/lib/Command/TroubleshootTransferOwnership.php and 1 other location - About 1 hr to fix
                            apps/files/lib/Command/TroubleshootTransferOwnership.php on lines 316..321

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

                            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

                                    if ($this->userSession instanceof IUserSession) {
                                        $user = $this->userSession->getUser();
                                        if (
                                            ($this->config->getSystemValue('allow_user_to_change_display_name') === false) &&
                                            (($user !== null) && (!$this->groupManager->isAdmin($user->getUID()))) &&
                            Severity: Major
                            Found in lib/private/User/User.php and 1 other location - About 1 hr to fix
                            lib/private/User/User.php on lines 478..487

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

                            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