Showing 3,235 of 4,504 total issues
Method getUidAndFilename
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUidAndFilename($path) {
list($storage, $internalPath) = $this->rootView->resolvePath($path);
$absMountPoint = $this->rootView->getMountPoint($path);
$parts = \explode('/', $absMountPoint);
Method set
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function set($data) {
if ($data instanceof IImage) {
$img = $data;
$data = $img->data();
} else {
Method getForObject
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getForObject(
$objectType,
$objectId,
$limit = 0,
$offset = 0,
Method convertDB
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function convertDB(Connection $fromDB, Connection $toDB, array $tables, InputInterface $input, OutputInterface $output) {
$this->config->setSystemValue('maintenance', true);
try {
$fromSchema = $fromDB->createSchema();
// copy table rows
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$privateKeyPath = $input->getOption('privateKey');
$keyBundlePath = $input->getOption('certificate');
$path = $input->getOption('path');
if ($privateKeyPath === null || $keyBundlePath === null || $path === null) {
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
if (!$this->connection->getDatabasePlatform() instanceof MySqlPlatform) {
$output->writeln("<error>This command is only valid for MySQL/MariaDB databases.</error>");
return 1;
}
Method execute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$importFile = $input->getArgument('file');
if ($importFile !== null) {
$content = $this->getArrayFromFile($importFile);
} else {
Method checkInput
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function checkInput(InputInterface $input) {
$uid = $input->getArgument('uid');
if (!$input->getOption('ignore-missing-user') && !$this->userManager->userExists($uid)) {
throw new \InvalidArgumentException('The user "' . $uid . '" does not exist.');
}
Method showChallenge
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showChallenge($challengeProviderId, $redirect_url) {
$user = $this->userSession->getUser();
$provider = $this->twoFactorManager->getProvider($user, $challengeProviderId);
if ($provider === null) {
return new RedirectResponse($this->urlGenerator->linkToRoute('core.TwoFactorChallenge.selectChallenge'));
Function fallBackCallBack
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
fallBackCallBack:function(type,data){
var i;
// ignore messages that might appear after closing
if (this.closed) {
return;
- 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 isTargetAllowed
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function isTargetAllowed($target) {
$currentMount = $this->getMountPoint();
// note: $currentMount has a trailing slash. It doesn't matter for the check below
$isRename = \dirname($currentMount) === \dirname($target);
- 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 formatUserForIndex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function formatUserForIndex(IUser $user, array $userGroups = null) {
// TODO: eliminate this encryption specific code below and somehow
// hook in additional user info from other apps
// recovery isn't possible if admin or user has it disabled and encryption
- 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 splitUserRemote
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function splitUserRemote($address) {
if (\strpos($address, '@') === false) {
throw new \Exception('Invalid Federated Cloud ID');
}
- 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 search
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function search($search = '', $itemType = null, $page = 1, $perPage = 200) {
if ($perPage <= 0) {
return [ 'statuscode' => Http::STATUS_BAD_REQUEST,
'message' => 'Invalid perPage argument'];
}
- 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 isExpired
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function isExpired($timestamp, $quotaExceeded = false) {
// No expiration if disabled
if (!$this->isEnabled()) {
return 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 getProperties
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getProperties($properties) {
if (($properties === null) || ($properties === [])) {
$properties = \array_keys($this->properties);
}
- 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 getVersionsFromTrash
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function getVersionsFromTrash($filename, $timestamp, $user) {
$view = new View('/' . $user . '/files_trashbin/versions');
$versions = [];
//force rescan of versions, local storage may not have updated the cache
- 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 onReport
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function onReport($reportName, $report, $uri) {
$node = $this->server->tree->getNodeForPath($uri);
if (!$node instanceof EntityCollection || $reportName !== self::REPORT_NAME) {
throw new ReportNotSupported();
}
- 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 createConfidentialObject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function createConfidentialObject($calData) {
$vObject = Reader::read($calData);
/** @var Component $vElement */
$vElement = 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 createFederatedShare
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function createFederatedShare(IShare $share) {
$token = $this->tokenHandler->generateToken();
$shareId = $this->addShareToDB(
$share->getNodeId(),
$share->getNodeType(),
- 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"