Showing 3,235 of 4,504 total issues
Function save
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function save() {
if (\is_array($this->tags)) {
foreach ($this->tags as $tag) {
try {
if (!$this->mapper->tagExists($tag)) {
- 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 sendInternalShareMail
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function sendInternalShareMail($sender, $node, $shareType, $recipientList): array {
if ($this->config->getAppValue('core', 'shareapi_allow_mail_notification', 'no') !== 'yes') {
$message_t = $this->l->t('Internal mail notification for shared files is not allowed');
throw new GenericShareException($message_t, $message_t, 403);
}
- 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 delete
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function delete($parent, $excludeParent = false, $uidOwner = null, $newParent = null, $excludeGroupChildren = false) {
$ids = [$parent];
$deletedItems = [];
$changeParent = [];
$parents = [$parent];
- 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 isAvailable
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function isAvailable(\OCP\Files\FileInfo $file) {
if (!$this->config->getSystemValue('enable_previews', true)) {
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 findAppInDirectories
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function findAppInDirectories($appId) {
$sanitizedAppId = \OC_App::cleanAppId($appId);
if ($sanitizedAppId !== $appId) {
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 checkAppForUser
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function checkAppForUser($enabled, $appName, $user) {
if ($user !== null) {
$userAppAttributes = $user->getExtendedAttributes();
/**
* Guests will only have access to some whitelisted apps
- 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 loadRoutes
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function loadRoutes($app = null) {
if (\is_string($app)) {
$app = \OC_App::cleanAppId($app);
}
- 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 execute
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$this->checkInput($input);
} catch (\InvalidArgumentException $e) {
$output->writeln('<error>' . $e->getMessage() . '</error>');
- 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 execute
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$outputType = $input->getOption('output');
\OC_App::loadApps();
$this->router->loadRoutes();
- 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 getStorageConfig
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
getStorageConfig: function($tr) {
var storageId = $tr.data('id');
if (!storageId) {
// new entry
storageId = null;
Method setPassword
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setPassword($token, $userId, $password) {
$user = $this->userManager->get($userId);
if ($user === null) {
$this->log->error('User: ' . $userId . ' does not exist.', ['app' => 'settings']);
Method sendLinkShareMail
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendLinkShareMail($sender, $recipients, $link, $personalNote = null) {
if ($this->config->getAppValue('core', 'shareapi_allow_public_notification', 'no') !== 'yes') {
$message_t = $this->l->t('Public link mail notification is not allowed');
throw new GenericShareException($message_t, $message_t, 403);
}
Method lock
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function lock($storageId, $internalPath, $fileId, array $lockInfo) {
if ($fileId <= 0) {
throw new \InvalidArgumentException('Invalid file id');
}
if (!isset($lockInfo['token'])) {
File filesharing.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** @var \OCP\IL10N $l */
/** @var array $_ */
?>
<div id="shareAPI" class="section">
File Server.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Christoph Wurst <christoph@owncloud.com>
* @author Georg Ehrke <georg@owncloud.com>
* @author Lukas Reschke <lukas@statuscode.ch>
Function submit
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
submit: function() {
var self = this;
var data = this.data;
var file = this.getFile();
Function avatar
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) {
if (typeof(size) === 'undefined') {
if (this.height() > 0) {
size = this.height();
} else if (this.data('size') > 0) {
Method setupDatabase
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setupDatabase($username) {
$e_host = \addslashes($this->dbHost);
$e_user = \addslashes($this->dbUser);
$e_password = \addslashes($this->dbPassword);
Method __construct
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($server, $protocolVersion='HTTP/1.1') {
$this->server = $server;
$this->protocolVersion = $protocolVersion;
$this->headers = [
prototype
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
OC.FileUpload.prototype = {
/**
* Unique upload id
*