owncloud/core

View on GitHub

Showing 3,235 of 4,504 total issues

Method getPhoto has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getPhoto(Card $node) {
        // TODO: this is kind of expensive - load carddav data from database and parse it
        //       we might want to build up a cache one day
        try {
            $vObject = $this->readCard($node->get());
Severity: Minor
Found in apps/dav/lib/CardDAV/ImageExportPlugin.php - About 1 hr to fix

    Method __construct has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($params) {
            // extract context path from host if specified
            // (owncloud install path on host)
            $host = $params['host'];
            // strip protocol
    Severity: Minor
    Found in apps/files_external/lib/Lib/Storage/OwnCloud.php - About 1 hr to fix

      Method restoreShares has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function restoreShares(OutputInterface $output) {
              $output->writeln("Restoring shares ...");
              $progress = new ProgressBar($output, \count($this->shares));
              $status = 0;
      
      
      Severity: Minor
      Found in apps/files/lib/Command/TransferOwnership.php - About 1 hr to fix

        Method touch has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function touch($path, $mtime = null) {
                $file = $this->getDriveFile($path);
                $toUpdate = new DriveFile();
                $result = false;
                if ($file) {
        Severity: Minor
        Found in apps/files_external/lib/Lib/Storage/Google.php - About 1 hr to fix

          Method fopen has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function fopen($path, $mode) {
                  $hooks = [];
                  switch ($mode) {
                      case 'r':
                      case 'rb':
          Severity: Minor
          Found in lib/private/Files/View.php - About 1 hr to fix

            Method getMultiBucketObjectStoreConfig has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function getMultiBucketObjectStoreConfig(IUser $user) {
                    $config = $this->config->getSystemValue('objectstore_multibucket');
                    if (!\is_array($config)) {
                        return null;
                    }
            Severity: Minor
            Found in lib/private/Files/Mount/ObjectHomeMountProvider.php - About 1 hr to fix

              Method jsonSerialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function jsonSerialize() {
                      $result = [];
                      if ($this->id !== null) {
                          $result['id'] = $this->id;
                      }
              Severity: Minor
              Found in lib/private/Files/External/StorageConfig.php - About 1 hr to fix

                Method getAllNonUTF8BinTables has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getAllNonUTF8BinTables(IDBConnection $connection) {
                        $dbPrefix = $this->config->getSystemValue("dbtableprefix");
                        $dbName = $this->config->getSystemValue("dbname");
                        $characterSet = $this->config->getSystemValue('mysql.utf8mb4', false) ? 'utf8mb4' : 'utf8';
                
                
                Severity: Minor
                Found in lib/private/Repair/Collation.php - About 1 hr to fix

                  Method scale has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function scale($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight) {
                          $scalingUp = $this->getScalingUp();
                          $maxScaleFactor = $this->getMaxScaleFactor();
                  
                          $factorX = $askedWidth / $previewWidth;
                  Severity: Minor
                  Found in lib/private/Preview.php - About 1 hr to fix

                    Method getRawPathInfo has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getRawPathInfo() {
                            $requestUri = $this->server['REQUEST_URI'] ?? '';
                            // remove too many leading slashes - can be caused by reverse proxy configuration
                            if (\strpos($requestUri, '/') === 0) {
                                $requestUri = '/' . \ltrim($requestUri, '/');
                    Severity: Minor
                    Found in lib/private/AppFramework/Http/Request.php - About 1 hr to fix

                      Method processResources has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function processResources($routes) {
                              // declaration of all restful actions
                              $actions = [
                                  ['name' => 'index', 'verb' => 'GET', 'on-collection' => true],
                                  ['name' => 'show', 'verb' => 'GET'],
                      Severity: Minor
                      Found in lib/private/AppFramework/Routing/RouteConfig.php - About 1 hr to fix

                        Method decrypt has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function decrypt($authenticatedCiphertext, $password = '') {
                                if ($password === '') {
                                    $password = $this->config->getSystemValue('secret');
                                }
                        
                        
                        Severity: Minor
                        Found in lib/private/Security/Crypto.php - About 1 hr to fix

                          Method signedRequestIsValid has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function signedRequestIsValid(): bool {
                                  $params = $this->getQueryParameters();
                                  if (!isset($params['OC-Signature'], $params['OC-Credential'], $params['OC-Date'], $params['OC-Expires'], $params['OC-Verb'])) {
                                      $q = \json_encode($params);
                                      \OC::$server->getLogger()->debug("Query parameters are missing: $q", ['app' => 'signed-url']);
                          Severity: Minor
                          Found in lib/private/Security/SignedUrl/Verifier.php - About 1 hr to fix

                            Method printExceptionErrorPage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function printExceptionErrorPage($exception, $fetchPage = false) {
                                    try {
                                        $trace = Log::replaceSensitiveData($exception->getTraceAsString());
                            
                                        $request = \OC::$server->getRequest();
                            Severity: Minor
                            Found in lib/private/legacy/template.php - About 1 hr to fix

                              Method callForUsers has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function callForUsers($callback, $search, $onlySeen, $limit = null, $offset = null) {
                                      $qb = $this->db->getQueryBuilder();
                                      $qb->select(['*'])
                                          ->from($this->getTableName());
                              
                              
                              Severity: Minor
                              Found in lib/private/User/AccountMapper.php - About 1 hr to fix

                                Method setLanguageFromRequest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function setLanguageFromRequest($app = null) {
                                        $header = $this->request->getHeader('ACCEPT_LANGUAGE');
                                        if ($header) {
                                            $available = $this->findAvailableLanguages($app);
                                
                                
                                Severity: Minor
                                Found in lib/private/L10N/Factory.php - About 1 hr to fix

                                  Method findLanguage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function findLanguage($app = null) {
                                          if ($this->requestLanguage !== '' && $this->languageExists($app, $this->requestLanguage)) {
                                              return $this->requestLanguage;
                                          }
                                  
                                  
                                  Severity: Minor
                                  Found in lib/private/L10N/Factory.php - About 1 hr to fix

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

                                        protected function configure() {
                                            parent::configure();
                                    
                                            $this
                                                ->setName('config:system:set')
                                    Severity: Minor
                                    Found in core/Command/Config/System/SetConfig.php - About 1 hr to fix

                                      Function share has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, expirationDate, callback, errorCallback) {
                                      Severity: Major
                                      Found in core/js/share.js - About 1 hr to fix

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

                                                string $appName,
                                                IRequest $request,
                                                MailNotifications $mailNotifications,
                                                IUserSession $userSession,
                                                IUserManager $userManager,
                                        Severity: Major
                                        Found in apps/files_sharing/lib/Controller/NotificationController.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language