Showing 3,235 of 4,504 total issues
Function initMouseTrack
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initMouseTrack() {
var interval = 120; // 2 minutes
if (oc_config.session_lifetime) {
interval = Math.floor(oc_config.session_lifetime / 2);
}
Method translateShort
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function translateShort($text, IL10N $l, array $params) {
switch ($text) {
case self::SUBJECT_PUBLIC_SHARED_FOLDER_DOWNLOADED:
case self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED:
return (string) $l->t('Downloaded via public link');
Method prepare
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function prepare(INotification $notification, $languageCode) {
if ($notification->getApp() !== 'files_sharing') {
// Not my app => throw
throw new \InvalidArgumentException();
}
Method commentEvent
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function commentEvent(CommentsEvent $event) {
if ($event->getComment()->getObjectType() !== 'files'
|| !\in_array($event->getEvent(), [CommentsEvent::EVENT_ADD])
|| !$this->appManager->isInstalled('activity')) {
// Comment not for file, not adding a comment or no activity-app enabled (save the energy)
Method restoreVersion
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function restoreVersion($uid, $filename, $fileToRestore, $revision) {
if (\OC::$server->getConfig()->getSystemValue('files_versions', Storage::DEFAULTENABLED) !== true) {
return false;
}
$users_view = new View('/'.$uid);
Method get
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function get($file) {
if (\is_string($file) or $file == '') {
// normalize file
$file = $this->normalize($file);
Method __construct
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($data = []) {
$factory = new InputFilterFactory();
$this->inputFilter = $factory->createInputFilter([
'file' => [
'required' => true,
Method generalChecks
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function generalChecks(\OCP\Share\IShare $share) {
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER) {
// We expect a valid user as sharedWith for user shares
if (!$this->userManager->userExists($share->getSharedWith())) {
throw new \InvalidArgumentException('SharedWith is not a valid user');
Method loginWithApache
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function loginWithApache(IApacheBackend $apacheBackend) {
$uidAndBackend = $apacheBackend->getCurrentUserId();
if (\is_array($uidAndBackend)
&& \count($uidAndBackend) === 2
&& $uidAndBackend[0] !== ''
Method new
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function new(?string $parent_container_id, ?string $filename): DataResponse {
$userAgent = $this->request->getHeader('User-Agent') ?? '-';
$this->logger->info("new($parent_container_id, $filename) - $userAgent");
if ($parent_container_id === null) {
Function ocFederationAddServer
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.ocFederationAddServer = function() {
/* Go easy on jquery and define some vars
========================================================================== */
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function() {
var self = this;
var fileActions = this._context.fileActions;
var actions = fileActions.getActions(
fileActions.getCurrentMimeType(),
Function done
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
done: function() {
if (!this.data.isChunked) {
return $.Deferred().resolve().promise();
}
Method addShare
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addShare($remote, $token, $password, $name, $owner, $accepted = false, $user = null, $remoteId = -1) {
$user = $user ? $user : $this->uid;
$accepted = $accepted ? 1 : 0;
$name = Filesystem::normalizePath('/' . $name);
Method addUser
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addUser() {
$userId = isset($_POST['userid']) ? $_POST['userid'] : null;
$password = isset($_POST['password']) ? $_POST['password'] : null;
$groups = isset($_POST['groups']) ? $_POST['groups'] : null;
$user = $this->userSession->getUser();
Method getPublicCalendars
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getPublicCalendars() {
$fields = \array_values($this->propertyMap);
$fields[] = 'a.id';
$fields[] = 'a.uri';
$fields[] = 'a.synctoken';
Method reShare
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function reShare($id) {
$token = $this->request->getParam('token', null);
$shareWith = $this->request->getParam('shareWith', null);
$permission = $this->request->getParam('permission', null);
$remoteId = $this->request->getParam('remoteId', null);
Method createCardsPropertiesTable
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createCardsPropertiesTable(Schema $schema) {
if (!$schema->hasTable("{$this->prefix}cards_properties")) {
$table = $schema->createTable("{$this->prefix}cards_properties");
$table->addColumn('id', 'integer', [
'autoincrement' => true,
Method createTag
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createTag($data, $contentType = 'application/json'): ISystemTag {
if (\explode(';', $contentType)[0] === 'application/json') {
$data = \json_decode($data, true);
} else {
throw new UnsupportedMediaType();
Method handleGetProperties
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function handleGetProperties(PropFind $propFind, INode $node) {
if ($node instanceof MetaFolder) {
$propFind->handle(self::PATH_FOR_FILEID_PROPERTYNAME, function () use ($node) {
$fileId = $node->getName();