Showing 4,504 of 4,504 total issues
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var defaultExpireMessage = '';
var defaultExpireDays = this.configModel.get('defaultExpireDate');
var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');
Method getPanel
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPanel() {
// create htaccess test file
$util = new \OC_Util();
$util->createHtaccessTestFile($this->config);
Method resendInvitation
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resendInvitation($userId) {
$user = $this->userManager->get($userId);
$currentUser = $this->userSession->getUser();
if ($user === null || $this->userTypeHelper->isGuestUser($userId) === true) {
Method execute
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$mountId = $input->getArgument('mount_id');
try {
$mount = $this->globalService->getStorage($mountId);
} catch (NotFoundException $e) {
Method collectUsersShares
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function collectUsersShares(InputInterface $input, OutputInterface $output) {
$output->writeln("Collecting all share information for files and folder of $this->sourceUser ...");
$skipped = 0;
$progress = new ProgressBar($output, \count($this->shares));
Method rename
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rename($source, $target) {
$this->log("enter: rename('$source', '$target')", Util::DEBUG);
if ($this->isRootDir($source) || $this->isRootDir($target)) {
$this->log("refusing to rename \"$source\" to \"$target\"");
Method getChildrenWithFilter
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getChildrenWithFilter($fileId, $mimetypeFilter = null) {
if ($fileId > -1) {
$qb = $this->connection->getQueryBuilder();
$qb->select(
'fileid',
Method getStorageConfigFromDBMount
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getStorageConfigFromDBMount(array $mount) {
$applicableUsers = \array_filter($mount['applicable'], function ($applicable) {
return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_USER;
});
$applicableUsers = \array_map(function ($applicable) {
Method delete
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function delete($names) {
if (!\is_array($names)) {
$names = [$names];
}
Method getRepairSteps
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getRepairSteps() {
return [
new RepairMimeTypes(\OC::$server->getConfig()),
new RepairMismatchFileCachePath(
\OC::$server->getDatabaseConnection(),
Method process
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(bool $all = false, int $chunkSize = 1000, \Closure $progress = null): int {
$root = \OC::$server->getLazyRootFolder();
$count = 0;
$qb = $this->connection->getQueryBuilder();
Method normalizeVersion
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function normalizeVersion($version, $fullVersion = null) {
$version = \trim($version);
if ($fullVersion === null) {
$fullVersion = $version;
}
Method loadIndex
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadIndex($table, $xml) {
$name = null;
$fields = [];
foreach ($xml->children() as $child) {
/**
Method createUser
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createUser($uid, $password) {
return $this->emittingCall(function () use (&$uid, &$password) {
$l = \OC::$server->getL10N('lib');
// Check the name for bad characters
Method configure
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure() {
$this
->setName('user:sync')
->setDescription('Synchronize users from a given backend to the accounts table.')
->addArgument(
Function getShares
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getShares($includingPending = false) {
$shares = [];
$groupExternalManager = null;
foreach ($this->externalManager->getAcceptedShares() as $shareInfo) {
- 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 doDelete
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function doDelete($path, $method) {
if (self::$disableTrash
|| !\OC_App::isEnabled('files_trashbin')
|| (\pathinfo($path, PATHINFO_EXTENSION) === 'part')
|| $this->shouldMoveToTrash($path) === false
- 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 checkQuota
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function checkQuota($path, $length = null, $extraSpace = 0) {
if ($length === null) {
$length = $this->getLength();
}
if ($length !== null) {
- 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 restoreShares
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function restoreShares(OutputInterface $output) {
$output->writeln("Restoring shares ...");
$progress = new ProgressBar($output, \count($this->shares));
$status = 0;
- 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 findRegisteredSections
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function findRegisteredSections($type) {
$sections = [];
foreach ($this->appManager->getEnabledAppsForUser($this->userSession->getUser()) as $app) {
if (isset($this->appManager->getAppInfo($app)['settings-sections'])) {
foreach ($this->appManager->getAppInfo($app)['settings-sections'] as $t => $section) {
- 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"