Showing 3,235 of 4,503 total issues
Method downloadShare
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function downloadShare($token, $files = null, $path = '', $downloadStartSecret = '') {
\OC_User::setIncognitoMode(true);
$share = $this->shareManager->getShareByToken($token);
Method showShare
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function showShare($token, $path = '') {
\OC_User::setIncognitoMode(true);
// Check whether share exists
try {
File OcmController.php
has 330 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @author Viktar Dubiniuk <dubiniuk@owncloud.com>
*
* @copyright Copyright (c) 2018, ownCloud GmbH
Method __construct
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($renderAs, $appId = '') {
// yes - should be injected ....
$this->config = \OC::$server->getConfig();
// Decide which page we show
Method imagebmp
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function imagebmp($im, $fileName = '', $bit = 24, $compression = 0) {
if (!\in_array($bit, [1, 4, 8, 16, 24, 32])) {
$bit = 24;
} elseif ($bit == 32) {
$bit = 24;
Function writeBack
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
public function writeBack($tmpFile) {
if (isset(self::$tempFiles[$tmpFile])) {
$path = self::$tempFiles[$tmpFile];
$parentFolder = $this->getDriveFile(\dirname($path));
if ($parentFolder) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getSharesBy
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getSharesBy($userId, $shareType, $path = null, $reshares = false, $limit = 50, $offset = 0) {
if ($path !== null &&
!($path instanceof \OCP\Files\File) &&
!($path instanceof \OCP\Files\Folder)) {
throw new \InvalidArgumentException('invalid path');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function enableApp
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
enableApp:function(appId, active, element, groups) {
var self = this;
OC.Settings.Apps.hideErrorMessage(appId);
groups = groups || [];
var appItem = $('div#app-'+appId+'');
Function _makeFilesFromShares
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_makeFilesFromShares: function(data) {
/* jshint camelcase: false */
var self = this;
var files = data;
Method createShare
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function createShare(\OCP\Share\IShare $share) {
$this->canShare($share);
// Verify if there are any issues with the path
$this->pathCreateChecks($share->getNode());
File TroubleshootTransferOwnership.php
has 328 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @author Piotr Mrowczynski <piotr@owncloud.com>
*
* @copyright Copyright (c) 2020, ownCloud GmbH
File files.js
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright (c) 2014
*
* This file is licensed under the Affero General Public License version 3
* or later.
File SettingsManager.php
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* @author Tom Needham <tom@owncloud.com>
*
* @copyright Copyright (c) 2018, ownCloud GmbH
Method create
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function create($username, $password, array $groups= [], $email='') {
$resp = $this->validateString($username, 255);
if ($resp) {
return $resp;
}
Method getMessageForLicense
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getMessageForLicense(array $info, string $language = null): array {
$l = $this->l10nFactory->get('core', $language);
// check if present
if ($info['licenseState'] === ILicenseManager::LICENSE_STATE_MISSING) {
SMB
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class SMB extends StorageAdapter {
/** @var bool */
protected $logActive;
/**
ObjectStoreStorage
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ObjectStoreStorage extends \OC\Files\Storage\Common {
/**
* @var array
*/
private static $tmpFiles = [];
DefaultShareProvider
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class DefaultShareProvider implements IShareProvider {
// Special share type for user modified group shares
public const SHARE_TYPE_USERGROUP = 2;
/** @var IDBConnection */
DeletedUser
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class DeletedUser implements IUser {
/** @var Emitter */
private $emitter;
/** @var IConfig */
private $config;
RemoteUser
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class RemoteUser implements IUser {
/** @var string */
private $userId;
/**