Showing 4,504 of 4,504 total issues
Method generateTokenAndSendMail
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function generateTokenAndSendMail($userId, $email) {
$token = $this->secureRandom->generate(
21,
ISecureRandom::CHAR_DIGITS,
ISecureRandom::CHAR_LOWER,
Method notifyPublicLinkRecipientsByEmail
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function notifyPublicLinkRecipientsByEmail($link, $recipients, $personalNote) {
# verify that the link is for a trusted domain
if (!$this->trustedDomainHelper->isUrlTrusted($link)) {
return new Result(null, 400, "Invalid shared link");
}
Method createComment
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createComment($objectType, $objectId, $data, $contentType = 'application/json') {
if (\explode(';', $contentType)[0] === 'application/json') {
$data = \json_decode($data, true);
} else {
throw new UnsupportedMediaType();
Method createShareObject
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createShareObject($data) {
$share = new Share($this->rootFolder, $this->userManager);
$share->setId($data['id'])
->setShareType((int)$data['share_type'])
->setPermissions((int)$data['permissions'])
Method getUsersGroups
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getUsersGroups($parameters) {
// Check if user is logged in
$loggedInUser = $this->userSession->getUser();
if ($loggedInUser === null) {
return new Result(null, API::RESPOND_UNAUTHORISED);
Method update
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update($name, $userVisible, $userAssignable, $userEditable = false) {
try {
if (!$this->tagManager->canUserSeeTag($this->tag, $this->user)) {
throw new NotFound('Tag with id ' . $this->tag->getId() . ' does not exist');
}
Method getUser
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getUser($parameters) {
$userId = $parameters['userid'];
// Check if user is logged in
$currentLoggedInUser = $this->userSession->getUser();
Method check
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function check(RequestInterface $request, ResponseInterface $response) {
$node = $this->resolveShare($request->getPath());
if (!$node instanceof PublicSharedRootNode) {
return [true, 'principals/system/public'];
}
Method getSystemTagFileIds
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getSystemTagFileIds($systemTagIds) {
$resultFileIds = null;
// check user permissions, if applicable
if (!$this->isAdmin()) {
Method getChild
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getChild($name, $info = null) {
if (!$this->info->isReadable()) {
// avoid detecting files through this way
throw new SabreNotFound();
}
Method updateStorageStatus
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function updateStorageStatus(IStorageConfig &$storage, $testOnly = true) {
try {
$this->manipulateStorageConfig($storage);
/** @var Backend */
Method checkQuota
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function checkQuota($path, $length = null, $extraSpace = 0) {
if ($length === null) {
$length = $this->getLength();
}
if ($length !== null) {
Method processUserChunks
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function processUserChunks($input, $output, $users, $inputPath, $shouldRepairStoragesIndividually, $group = null) {
# no messaging level option means: no full printout but statistics
# $quiet means no print at all
# $verbose means full printout including statistics
# -q -v full stat
Method hasUpdated
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function hasUpdated($path, $time) {
if ($this->is_file($path)) {
return parent::hasUpdated($path, $time);
}
Method getTagIdsForObjects
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getTagIdsForObjects($objIds, $objectType) {
if (!\is_array($objIds)) {
$objIds = [$objIds];
} elseif (empty($objIds)) {
return [];
Method stream_seek
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function stream_seek($offset, $whence = SEEK_SET) {
$return = false;
switch ($whence) {
case SEEK_SET:
Method copyFromStorage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
if ($sourceStorage === $this) {
return $this->copy($sourceInternalPath, $targetInternalPath);
}
Method getBackendStatus
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getBackendStatus($class, $options, $isPersonal, $testOnly = true) {
if (self::$skipTest) {
return StorageNotAvailableException::STATUS_SUCCESS;
}
$user = \OC::$server->getUserSession()->getUser();
Method setExpirationDate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function setExpirationDate($itemType, $itemSource, $date, $shareTime = null) {
$user = \OC_User::getUser();
$l = \OC::$server->getL10N('lib');
if ($date == '') {
Method run
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function run(IOutput $out) {
if (!$this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
return;
}