Showing 3,235 of 4,504 total issues
Method getAuthors
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getAuthors($file, $gitRoot) {
// only add authors that changed code and not the license header
$licenseHeaderEndsAtLine = \trim(\shell_exec(\sprintf("grep -n '*/' %s | head -n 1 | cut -d ':' -f 1", \escapeshellarg($file))));
$buildDir = \getcwd();
Method getShareFolder
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getShareFolder($view = null) {
if ($view === null) {
$view = Filesystem::getView();
}
// for guests we default to root as their home storage is read-only
Method getPermissionsFromRequest
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getPermissionsFromRequest() {
// int-based permissions are set -> use them
$permissions = $this->request->getParam('permissions', null);
if ($permissions !== null) {
return $permissions;
Method deleteVersions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function deleteVersions(View $view, $file, $user) {
$size = 0;
if (\OCP\App::isEnabled('files_versions')) {
if ($view->is_dir('files_trashbin/versions/' . $file)) {
$size += self::calculateSize(new View('/' . $user . '/files_trashbin/versions/' . $file));
Method execute
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$users = $input->getArgument('user_id');
if (!empty($users)) {
foreach ($users as $user) {
if ($this->userManager->userExists($user)) {
Method ocmDiscover
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function ocmDiscover($remote) {
// Check if something is in the cache
if ($cacheData = $this->cache->get('OCM' . $remote)) {
return \json_decode($cacheData, true);
}
Method splitUserRemote
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function splitUserRemote($address) {
if (\strpos($address, '@') === false) {
$hint = $this->l->t('Invalid Federated Cloud ID');
throw new HintException('Invalid Federated Cloud ID', $hint);
}
Method getUsers
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getUsers() {
$search = !empty($_GET['search']) ? $_GET['search'] : '';
$limit = !empty($_GET['limit']) ? $_GET['limit'] : null;
$offset = !empty($_GET['offset']) ? $_GET['offset'] : null;
Method getMultipleCalendarObjects
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getMultipleCalendarObjects($calendarId, array $uris) {
$chunkSize = 998;
if (\count($uris) <= $chunkSize) {
$query = $this->db->getQueryBuilder();
$query->select(['id', 'uri', 'lastmodified', 'etag', 'calendarid', 'size', 'calendardata', 'componenttype', 'classification'])
Method initialize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function initialize(\Sabre\DAV\Server $server) {
$server->xml->namespaceMap[self::NS_OWNCLOUD] = 'oc';
$server->protectedProperties[] = self::FILEID_PROPERTYNAME;
$server->protectedProperties[] = self::INTERNAL_FILEID_PROPERTYNAME;
$server->protectedProperties[] = self::PERMISSIONS_PROPERTYNAME;
Method validateUserPass
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function validateUserPass($username, $password) {
try {
$share = $this->shareManager->getShareByToken($username);
} catch (ShareNotFound $e) {
\OC::$server->getLogger()->error("PublicAuth: share for found $username");
Method logException
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function logException(\Throwable $ex) {
if ($ex->getPrevious() instanceof FileContentNotAllowedException) {
//Don't log because its already been logged may be by different
//app or so.
return null;
Method handlePut
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handlePut(RequestInterface $request, ResponseInterface $response) {
if ($request->getHeader('OC-Autorename') !== '1') {
return;
}
Method createDirectory
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createDirectory($name) {
# the check here is necessary, because createDirectory does not use the methods in files/view.php
if (Filesystem::isForbiddenFileOrDir($name)) {
throw new SabreForbidden();
}
Method create
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function create(
$mountPoint,
$backend,
$authMechanism,
$backendOptions,
Method execute
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$users = $input->getArgument('user_id');
if (!empty($users)) {
foreach ($users as $user) {
if ($this->userManager->userExists($user)) {
Method configure
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function configure() {
$this
->setName('files:transfer-ownership')
->setDescription('All files and folders are moved to another user - shares are moved as well.')
->addArgument(
Method execute
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$uid = $input->getArgument('uid');
$userFolder = $this->rootFolder->getUserFolder($uid); // might throw a NoUserException
try {
Method findOneQuery
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function findOneQuery($sql, array $params=[], $limit=null, $offset=null) {
if ($sql instanceof IQueryBuilder) {
$stmt = $sql->execute();
} else {
$stmt = $this->execute($sql, $params, $limit, $offset);
Method fopen
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function fopen($mode) {
$preHooks = [];
$postHooks = [];
$requiredPermissions = \OCP\Constants::PERMISSION_READ;
switch ($mode) {