Showing 3,235 of 4,504 total issues
Method copy
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function copy($sourcePath, $destinationPath) {
$sourceNode = $this->getNodeForPath($sourcePath);
if ($sourceNode instanceof File
|| $sourceNode instanceof Directory
) {
Method __construct
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($params) {
// log switch might be set already (from a subclass), so don't change it.
if (!isset($this->logActive)) {
$this->logActive = \OC::$server->getConfig()->getSystemValue('smb.logging.enable', false) === true;
}
Method update
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update(Entity $entity) {
// if entity wasn't changed it makes no sense to run a db query
$properties = $entity->getUpdatedFields();
if (\count($properties) === 0) {
return $entity;
Method getStatusInfo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getStatusInfo($includeVersion = false, $serverHide = false, $hostnameShort = false) {
$systemConfig = \OC::$server->getSystemConfig();
$installed = (bool) $systemConfig->getValue('installed', false);
$maintenance = (bool) $systemConfig->getValue('maintenance', false);
Method getBuiltInPanels
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getBuiltInPanels($type) {
if ($type === 'admin') {
return [
Enforce2fa::class,
LegacyAdmin::class,
Method runHooks
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function runHooks($hooks, $path, $post = false) {
if (empty($hooks)) {
return true;
}
$relativePath = $path;
Method stream_write
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function stream_write($data) {
$length = 0;
// loop over $data to fit it in 6126 sized unencrypted blocks
while (isset($data[0])) {
$remainingLength = \strlen($data);
Method detect
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function detect($path) {
$this->loadMappings();
if (@\is_dir($path)) {
// directories are easy
Method commitBatch
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function commitBatch() {
if (!$this->inBatch) {
throw new \BadMethodCallException('Not in batch');
}
$this->inBatch = false;
Method makeTheme
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function makeTheme($themeName, $appTheme = true) {
$serverRoot = $this->environmentHelper->getServerRoot();
$baseDirectory = $serverRoot;
$directory = '';
$webPath = '';
Method addStorage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function addStorage(IStorageConfig $newStorage) {
$allStorages = $this->readConfig();
$configId = $this->dbConfig->addMount(
$newStorage->getMountPoint(),
Method deleteOrphanEntries
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function deleteOrphanEntries(IOutput $output, $repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) {
$qb = $this->connection->getQueryBuilder();
$qb->select('d.' . $deleteId)
->from($deleteTable, 'd')
Method addQueryConditionsParentIdWrongPath
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function addQueryConditionsParentIdWrongPath($qb) {
// thanks, VicDeo!
if ($this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
$concatFunction = $qb->createFunction("CONCAT(fcp.path, '/', fc.name)");
} else {
Method createShare
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function createShare($data) {
$share = new Share($this->rootFolder, $this->userManager);
$share->setId($data['id'])
->setShareType((int)$data['share_type'])
->setPermissions((int)$data['permissions'])
Method cropAndFill
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function cropAndFill($image, $askedWidth, $askedHeight, $previewWidth, $previewHeight) {
if ($previewWidth > $askedWidth) {
$cropX = \floor(($previewWidth - $askedWidth) * 0.5);
$image->crop($cropX, 0, $askedWidth, $previewHeight);
$previewWidth = $askedWidth;
Method findAppInDirectories
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function findAppInDirectories($appId) {
$sanitizedAppId = \OC_App::cleanAppId($appId);
if ($sanitizedAppId !== $appId) {
return false;
}
Method adjustStreamChunkSize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function adjustStreamChunkSize($handle) {
$stream = $handle;
$metadata = \stream_get_meta_data($stream);
while ($metadata['stream_type'] === 'user-space') {
\stream_set_chunk_size($stream, 64 * 1024);
Method getAccessList
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAccessList($path) {
// Make sure that a share key is generated for the owner too
list($owner, $ownerPath) = $this->util->getUidAndFilename($path);
// always add owner to the list of users with access to the file
Method decryptAll
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function decryptAll(InputInterface $input, OutputInterface $output, $user = '') {
$this->input = $input;
$this->output = $output;
if ($user !== '' && $this->userManager->userExists($user) === false) {
Method syncHome
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function syncHome(Account $a, UserInterface $backend) {
// Fallback for backends that dont yet use the new interfaces
$providesHome = $backend instanceof IProvidesHomeBackend || $backend->implementsActions(\OC_User_Backend::GET_HOME);
$uid = $a->getUserId();
// Log when the backend returns a string that is a different home to the current value