owncloud/core

View on GitHub

Showing 4,504 of 4,504 total issues

Method getACL has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getACL() {
        $acl =  [
            [
                'privilege' => '{DAV:}read',
                'principal' => $this->getOwner(),
Severity: Minor
Found in apps/dav/lib/CardDAV/AddressBook.php - About 1 hr to fix

    Method handleGetProperties has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function handleGetProperties(
            PropFind $propFind,
            \Sabre\DAV\INode $sabreNode
        ) {
            if (!($sabreNode instanceof \OCA\DAV\Connector\Sabre\Node)) {
    Severity: Minor
    Found in apps/dav/lib/Connector/Sabre/SharesPlugin.php - About 1 hr to fix

      Method formatFileInfo has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function formatFileInfo(FileInfo $i) {
              $entry = [];
      
              $entry['id'] = $i['fileid'];
              $entry['parentId'] = $i['parent'];
      Severity: Minor
      Found in apps/files/lib/Helper.php - About 1 hr to fix

        Method check has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function check() {
                // Look up the cache - it is invalidated all 30 minutes
                if (((int)$this->config->getAppValue('core', 'lastupdatedat') + 1800) > \time()) {
                    return \json_decode($this->config->getAppValue('core', 'lastupdateResult'), true);
                }
        Severity: Minor
        Found in lib/private/Updater/VersionCheck.php - About 1 hr to fix

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

              public function __construct($prefix = '') {
                  parent::__construct($prefix);
                  if (self::$cache === null) {
                      self::$cache = new \Memcached();
          
          
          Severity: Minor
          Found in lib/private/Memcache/Memcached.php - About 1 hr to fix

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

                public function __construct($params) {
                    $this->statCache = new ArrayCache();
                    $this->httpClientService = \OC::$server->getHTTPClientService();
                    $this->webDavClientService = \OC::$server->getWebDavClientService();
                    if (isset($params['host'], $params['user'], $params['password'])) {
            Severity: Minor
            Found in lib/private/Files/Storage/DAV.php - About 1 hr to fix

              Method renameFromStorage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function renameFromStorage(IStorage $sourceStorage, $source, $target) {
                      if (!$this->enabled or Scanner::isPartialFile($source) or Scanner::isPartialFile($target)) {
                          return;
                      }
              
              
              Severity: Minor
              Found in lib/private/Files/Cache/Updater.php - About 1 hr to fix

                Method calculateFolderSize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function calculateFolderSize($path, $entry = null) {
                        $totalSize = 0;
                        if ($entry === null or !isset($entry['fileid'])) {
                            $entry = $this->get($path);
                        }
                Severity: Minor
                Found in lib/private/Files/Cache/Cache.php - About 1 hr to fix

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

                      public function touch($path, $mtime = null) {
                          if ($mtime === null) {
                              $mtime = \time();
                          }
                  
                  
                  Severity: Minor
                  Found in lib/private/Files/ObjectStore/ObjectStoreStorage.php - About 1 hr to fix

                    Method createSpecificUser has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function createSpecificUser($username, $connection) {
                            try {
                                //user already specified in config
                                $oldUser = $this->config->getSystemValue('dbuser', false);
                    
                    
                    Severity: Minor
                    Found in lib/private/Setup/MySQL.php - About 1 hr to fix

                      Method getFontFile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function getFontFile(array $info): string {
                              $fontFileDir  = __DIR__;
                              $fontFileDir .= '/../../../core/fonts/';
                      
                              $fontSet = [
                      Severity: Minor
                      Found in lib/private/Preview/TXT.php - About 1 hr to fix

                        Method userCreateChecks has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function userCreateChecks(\OCP\Share\IShare $share) {
                                $userTypeHelper = new UserTypeHelper();
                                $isGuestUser = $userTypeHelper->isGuestUser($share->getSharedWith());
                                // Check if we can share with group members only
                                // We still should be able to share with guest user even when it's not a group member
                        Severity: Minor
                        Found in lib/private/Share20/Manager.php - About 1 hr to fix

                          Method getAllSharesBy has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getAllSharesBy($userId, $shareTypes, $nodeIDs, $reshares) {
                                  $shares = [];
                                  $qb = $this->dbConn->getQueryBuilder();
                          
                                  $qb->select('*')
                          Severity: Minor
                          Found in lib/private/Share20/DefaultShareProvider.php - About 1 hr to fix

                            Method getPreview has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getPreview() {
                                    if ($this->preview !== null && $this->preview->valid()) {
                                        return $this->preview;
                                    }
                            
                            
                            Severity: Minor
                            Found in lib/private/Preview.php - About 1 hr to fix

                              Method loginInOwnCloud has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function loginInOwnCloud($loginType, $user, $password, $options = []) {
                                      $login = $user->getUID();
                              
                                      // check the login policies first. It will throw a LoginException if needed
                                      // The LoginPolicyManager can't be injected due to cyclic dependency
                              Severity: Minor
                              Found in lib/private/User/Session.php - About 1 hr to fix

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

                                    protected function execute(InputInterface $input, OutputInterface $output): int {
                                        $output->writeln('<info>This feature is currently experimental.</info>');
                                        $this->targetType = $this->connectionFactory->normalizeType($input->getArgument('type'));
                                        $this->targetHostname = $input->getArgument('hostname');
                                        $this->targetPort = $input->getOption('port');
                                Severity: Minor
                                Found in core/Command/Db/ConvertType.php - About 1 hr to fix

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

                                      protected function execute(InputInterface $input, OutputInterface $output): int {
                                          if (Filesystem::isPrimaryObjectStorageEnabled() === true) {
                                              $output->writeln('<info>We detected that the instance is running on a S3 primary object storage, users might not be accurate</info>');
                                          }
                                  
                                  
                                  Severity: Minor
                                  Found in core/Command/User/HomeListUsers.php - About 1 hr to fix

                                    Method openWithWeb has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function openWithWeb(?string $file_id, ?string $app_name): DataResponse {
                                            $userAgent = $this->request->getHeader('User-Agent') ?? '-';
                                            $this->logger->info("openWithWeb($file_id, $app_name) - $userAgent");
                                            $fileId = $this->extractFileId($file_id);
                                            $nodes = $this->rootFolder->getById($fileId, true);
                                    Severity: Minor
                                    Found in core/Controller/AppRegistryController.php - About 1 hr to fix

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

                                      OC.L10N.register(
                                          "files_trashbin",
                                          {
                                          "Couldn't delete %s permanently" : "حذف نہیں ہو سکتا %s مستقل طور پر",
                                          "Couldn't restore %s" : "بحال نہيں کيا جا سکتا %s",
                                      Severity: Major
                                      Found in apps/files_trashbin/l10n/ur_PK.js and 16 other locations - About 1 hr to fix
                                      apps/comments/l10n/az.js on lines 1..14
                                      apps/federation/l10n/sk_SK.js on lines 1..14
                                      apps/files_external/l10n/ur_PK.js on lines 1..14
                                      apps/files_sharing/l10n/kn.js on lines 1..14
                                      apps/files_sharing/l10n/ta.js on lines 1..14
                                      apps/files_trashbin/l10n/bn_BD.js on lines 1..14
                                      apps/files_trashbin/l10n/cy_GB.js on lines 1..14
                                      apps/files_trashbin/l10n/ka_GE.js on lines 1..14
                                      apps/files_trashbin/l10n/ms_MY.js on lines 1..14
                                      apps/systemtags/l10n/es_MX.js on lines 1..14
                                      apps/updatenotification/l10n/ro.js on lines 1..14
                                      apps/updatenotification/l10n/sr.js on lines 1..14
                                      lib/l10n/ku_IQ.js on lines 1..14
                                      lib/l10n/ms_MY.js on lines 1..14
                                      lib/l10n/te.js on lines 1..14
                                      settings/l10n/bn_IN.js on lines 1..14

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

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

                                      OC.L10N.register(
                                          "settings",
                                          {
                                          "Saved" : "সংরক্ষিত",
                                          "Delete" : "মুছে ফেলা",
                                      Severity: Major
                                      Found in settings/l10n/bn_IN.js and 16 other locations - About 1 hr to fix
                                      apps/comments/l10n/az.js on lines 1..14
                                      apps/federation/l10n/sk_SK.js on lines 1..14
                                      apps/files_external/l10n/ur_PK.js on lines 1..14
                                      apps/files_sharing/l10n/kn.js on lines 1..14
                                      apps/files_sharing/l10n/ta.js on lines 1..14
                                      apps/files_trashbin/l10n/bn_BD.js on lines 1..14
                                      apps/files_trashbin/l10n/cy_GB.js on lines 1..14
                                      apps/files_trashbin/l10n/ka_GE.js on lines 1..14
                                      apps/files_trashbin/l10n/ms_MY.js on lines 1..14
                                      apps/files_trashbin/l10n/ur_PK.js on lines 1..14
                                      apps/systemtags/l10n/es_MX.js on lines 1..14
                                      apps/updatenotification/l10n/ro.js on lines 1..14
                                      apps/updatenotification/l10n/sr.js on lines 1..14
                                      lib/l10n/ku_IQ.js on lines 1..14
                                      lib/l10n/ms_MY.js on lines 1..14
                                      lib/l10n/te.js on lines 1..14

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

                                      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