Showing 3,235 of 4,504 total issues
Function updateHtaccess
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function updateHtaccess() {
$config = \OC::$server->getConfig();
$il10n = \OC::$server->getL10N('lib');
// For CLI read the value from overwrite.cli.url
- 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 clear
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function clear($prefix = '') {
$storage = $this->getStorage();
if ($storage and $storage->is_dir('/')) {
$dh = $storage->opendir('/');
if (\is_resource($dh)) {
- 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 findAvailableLanguageFiles
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function findAvailableLanguageFiles($dir) {
$availableLanguageFiles = [];
if (\is_dir($dir)) {
$files = \scandir($dir);
if ($files !== 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 loginWithApache
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function loginWithApache(IApacheBackend $apacheBackend) {
$uidAndBackend = $apacheBackend->getCurrentUserId();
if (\is_array($uidAndBackend)
&& \count($uidAndBackend) === 2
&& $uidAndBackend[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 guessTimeZoneFromOffset
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function guessTimeZoneFromOffset($offset, $timestamp) {
try {
// Note: the timeZone name is the inverse to the offset,
// so a positive offset means negative timeZone
// and the other way around.
- 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 checkInput
has a Cognitive Complexity of 11 (exceeds 5 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.');
}
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
if (Filesystem::isPrimaryObjectStorageEnabled() === true) {
$output->writeln('<info>We detected that the instance is running on a S3 primary object storage, users might not be accurate</info>');
}
- 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 sendEmail
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function sendEmail($user, $token, $link) {
if ($this->userManager->userExists($user)) {
$userObject = $this->userManager->get($user);
$email = $userObject->getEMailAddress();
- 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 buildWebUri
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function buildWebUri(array $app_info, string $fileId): ?string {
$uri = null;
$app_name = $app_info['oc_app_name'];
# https://github.com/ONLYOFFICE/onlyoffice-owncloud/blob/2afca075249f24d857f0b3097d565f5129e88d17/appinfo/routes.php#LL27C47-L27C53
if ($app_name === 'onlyoffice') {
- 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 query
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
query: _.debounce(function(query) {
var queryData = {};
if (self._cachedGroups && query.term === '') {
query.callback({results: self._cachedGroups});
return;
Function calculate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
calculate: function(files) {
var file;
var summary = {
totalDirs: 0,
totalFiles: 0,
Function getDescriptiveTag
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDescriptiveTag: function(tag) {
if (_.isUndefined(tag.name) && !_.isUndefined(tag.toJSON)) {
tag = tag.toJSON();
}
Function addAndFetchFileInfo
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
addAndFetchFileInfo: function(fileName, dir, options) {
var self = this;
var deferred = $.Deferred();
if (_.isUndefined(dir)) {
dir = this.getCurrentDirectory();
Function parse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
parse: function(data) {
/* jshint camelcase: false */
if (data.ocs && data.ocs.data) {
// parse out of the ocs response
data = data.ocs.data;
Function lock
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
lock: function(path, options) {
if (!path) {
throw 'Missing argument "path"';
}
var self = this;
Function showHtml
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
showHtml: function (html, options) {
options = options || {};
_.defaults(options, {
timeout: 0
});
Method getPanel
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPanel() {
$activeLangCode = $this->config->getUserValue(
$this->userSession->getUser()->getUID(),
'core',
'lang',
Method isTargetAllowed
has 31 lines of code (exceeds 25 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);
Method setPasswordForm
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setPasswordForm($token, $userId) {
try {
$this->checkPasswordSetToken($token, $userId);
} catch (UserTokenException $e) {
if ($e instanceof UserTokenExpiredException) {
Method addCertificate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addCertificate(ICertificateManager $certificateManager) {
$headers = [];
if ($this->request->isUserAgent([\OC\AppFramework\Http\Request::USER_AGENT_IE_8])) {
// due to upload iframe workaround, need to set content-type to text/plain
$headers['Content-Type'] = 'text/plain';