Showing 3,235 of 4,504 total issues
Function makeTheme
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function makeTheme($themeName, $appTheme = true) {
$serverRoot = $this->environmentHelper->getServerRoot();
$baseDirectory = $serverRoot;
$directory = '';
$webPath = '';
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
public function delete($names) {
if (!\is_array($names)) {
$names = [$names];
}
- 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 groupItems
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected static function groupItems($items, $itemType) {
$fileSharing = ($itemType === 'file' || $itemType === 'folder') ? true : false;
$result = [];
- 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 getAppComplains
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function getAppComplains(): array {
$apps = [];
$appComplains = $this->config->getAppKeys('core-license-complains');
foreach ($appComplains as $appComplain) {
if ($this->config->getAppValue($appComplain, 'enabled', 'no') === 'yes' && $this->appManager->getAppPath($appComplain) !== 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 formatResult
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static function formatResult($items, $column, $backend, $format = self::FORMAT_NONE, $parameters = null) {
if ($format === self::FORMAT_NONE) {
return $items;
} elseif ($format === self::FORMAT_STATUSES) {
$statuses = [];
- 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 createShare
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function createShare(\OCP\Share\IShare $share) {
$this->canShare($share);
// Verify if there are any issues with the path
$this->pathCreateChecks($share->getNode());
- 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 getShareByToken
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getShareByToken($token) {
$provider = $this->factory->getProviderForType(\OCP\Share::SHARE_TYPE_LINK);
try {
$share = $provider->getShareByToken($token);
- 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 normalizeVersion
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function normalizeVersion($version, $fullVersion = null) {
$version = \trim($version);
if ($fullVersion === null) {
$fullVersion = $version;
}
- 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 loadApp
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function loadApp($app, $checkUpgrade = true) {
self::$loadedApps[] = $app;
$appPath = self::getAppPath($app);
if ($appPath === false) {
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 needUpgrade
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function needUpgrade(\OCP\IConfig $config) {
if ($config->getSystemValue('installed', false)) {
$installedVersion = $config->getSystemValue('version', '0.0.0');
$currentVersion = \implode('.', \OCP\Util::getVersion());
$versionDiff = \version_compare($currentVersion, $installedVersion);
- 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 loginUser
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static function loginUser() {
if (self::$isLoggedIn === true) {
return \OC_User::getUser();
}
- 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 toXML
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static function toXML($array, $writer) {
foreach ($array as $k => $v) {
if (isset($k[0]) && ($k[0] === '@')) {
if (\is_array($v)) {
foreach ($v as $name => $value) {
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$appSteps = $this->getAppsRepairSteps($output);
// Handle listing repair steps
$steps = \array_merge(
\OC\Repair::getRepairSteps(),
- 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 tryLogin
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function tryLogin($user, $password, $redirect_url, $timezone = null, $remember_login = null) {
$originalUser = $user;
// TODO: Add all the insane error handling
$loginResult = $this->userSession->login($user, $password);
if ($loginResult !== true && $this->config->getSystemValue('strict_login_enforced', false) !== true) {
- 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 _createFileActions
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createFileActions: function() {
var fileActions = new OCA.Files.FileActions();
fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) {
var dir = context.fileList.getCurrentDirectory();
context.fileList.changeDirectory(OC.joinPaths(dir, filename));
Function _addConvenienceMethods
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
_addConvenienceMethods: function (e, data) {
var that = this,
getPromise = function (args) {
return $.Deferred().resolveWith(that, args).promise();
};
Function updateIcons
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateIcons:function(itemType, fileList){
var item;
var $fileList;
var currentDir;
if (!fileList && OCA.Files) {
Method getNodeForPath
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getNodeForPath($path) {
if (!$this->fileView) {
throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
}
Method configure
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure() {
parent::configure();
$this
->setName('files:scan')
File eu.js
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"core",
{
"Please select a file." : "Mesedez, hautatu fitxategia.",
"File is too big" : "Fitxategia handiegia da",