owncloud/core

View on GitHub

Showing 3,235 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

                            Function joinPaths has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                joinPaths: function () {
                                    if (arguments.length < 1) {
                                        return '';
                                    }
                                    var path = '';
                            Severity: Minor
                            Found in core/js/js.js - About 1 hr 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 exec has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function exec($folder, $license, $gitRoot = false) {
                                    if (isset($this->licenseText[$license])) {
                                        echo "Unknown license $license. Supported: agpl, gpl or ocl";
                                    }
                                    $license = $this->licenseText[$license];
                            Severity: Minor
                            Found in build/license.php - About 1 hr 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 getPanel has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getPanel() {
                                    // create htaccess test file
                                    $util = new \OC_Util();
                                    $util->createHtaccessTestFile($this->config);
                            
                            
                            Severity: Minor
                            Found in settings/Panels/Admin/SecurityWarning.php - About 1 hr 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 resolveReshares has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected static function resolveReshares($source) {
                                    if (isset($source['parent'])) {
                                        $parent = $source['parent'];
                                        while (isset($parent)) {
                                            $query = \OCP\DB::prepare('SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?', 1);
                            Severity: Minor
                            Found in apps/files_sharing/lib/ShareBackend/File.php - About 1 hr 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 getShareById has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function getShareById($id, $recipient = null) {
                                    $share = null;
                                    $providerIds = \array_keys($this->shareManager->getProvidersCapabilities());
                                    
                                    // First check if it is an internal share.
                            Severity: Minor
                            Found in apps/files_sharing/lib/Controller/Share20OcsController.php - About 1 hr 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 syncThemAll has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function syncThemAll(\Closure $callback) {
                                    $trustedServers = $this->dbHandler->getAllServer();
                                    foreach ($trustedServers as $trustedServer) {
                                        $url = $trustedServer['url'];
                                        $callback($url, null);
                            Severity: Minor
                            Found in apps/federation/lib/SyncFederationAddressBooks.php - About 1 hr 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 __construct has 10 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    IDBConnection $connection,
                                    EventDispatcherInterface $eventDispatcher,
                                    AddressHandler $addressHandler,
                                    Notifications $notifications,
                                    TokenHandler $tokenHandler,
                            Severity: Major
                            Found in apps/federatedfilesharing/lib/FederatedShareProvider.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language