Showing 3,235 of 4,504 total issues
Method rename
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rename($path1, $path2) {
$renameOk = false;
$copyKeysOk = true; // assume keys are copied, in case we deal with versions
$isVersion = $this->isVersion($path2) || $this->isVersion($path1);
Method doUpgrade
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doUpgrade($currentVersion, $installedVersion) {
// Stop update if the update is over several major versions
$allowedPreviousVersions = $this->getAllowedPreviousVersions();
if (!self::isUpgradePossible($installedVersion, $currentVersion, $allowedPreviousVersions)) {
throw new \Exception('Updates between multiple major versions and downgrades are unsupported.');
Method generateHashes
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateHashes(
\RecursiveIteratorIterator $iterator,
$path
) {
$hashes = [];
Method fixThisShare
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function fixThisShare($groupShares, $subShares) {
if (empty($subShares)) {
return false;
}
Method analyzeLibraries
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function analyzeLibraries(array $dependencies) {
$missing = [];
if (!isset($dependencies['lib'])) {
return $missing;
}
Method decryptUsersFiles
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function decryptUsersFiles($uid, ProgressBar $progress, $userCount) {
$this->setupUserFS($uid);
$directories = [];
$directories[] = '/' . $uid . '/files';
Method validateToken
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function validateToken($token, $user = null) {
try {
$dbToken = $this->tokenProvider->getToken($token);
} catch (InvalidTokenException $ex) {
$this->logger->debug(
Method execute
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$outputType = $input->getOption('output');
if ($outputType === self::OUTPUT_FORMAT_JSON || $outputType === self::OUTPUT_FORMAT_JSON_PRETTY) {
$certificates = \array_map(function (ICertificate $certificate) {
return [
Function _triggerGroupEdit
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
_triggerGroupEdit: function($td, isSubadminSelect) {
var $groupsListContainer = $td.find('.groupsListContainer');
var placeholder = $groupsListContainer.attr('data-placeholder') || t('settings', 'no group');
var user = UserList.getUID($td);
var checked = _.keys($td.data('groups')) || [];
- 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 checkExistingFiles
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
checkExistingFiles: function (selection, callbacks) {
var self = this;
var fileList = this.fileList;
var conflicts = [];
// only keep non-conflicting uploads
- 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 parseQueryString
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
parseQueryString: function (queryString) {
var parts,
pos,
components,
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 EventSource
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
OC.EventSource=function(src,data){
var dataStr='';
var name;
var joinChar;
this.typelessListeners=[];
- 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 check
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function check($pathsToCheck) {
// If any of elements cannot be downloaded, prevent whole download
foreach ($pathsToCheck as $file) {
try {
$info = $this->userFolder->get($file);
- 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 setupFromToken
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function setupFromToken($token, $relativePath = null, $password = null) {
\OC_User::setIncognitoMode(true);
$linkItem = \OCP\Share::getShareByToken($token, !$password);
if ($linkItem === false || ($linkItem['item_type'] !== 'file' && $linkItem['item_type'] !== 'folder')) {
- 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 run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function run($argument) {
$target = $argument['url'];
$source = $this->urlGenerator->getAbsoluteURL('/');
$source = \rtrim($source, '/');
$token = $argument['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 discover
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function discover($remote) {
// Check if something is in the cache
if ($cacheData = $this->cache->get($remote)) {
return \json_decode($cacheData, 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 firstLogin
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function firstLogin(IUser $user = null) {
if ($user !== null) {
$principal = 'principals/users/' . $user->getUID();
$calendars = $this->calDav->getCalendarsForUser($principal);
if (empty($calendars) || (\count($calendars) === 1 && $calendars[0]['uri'] === BirthdayService::BIRTHDAY_CALENDAR_URI)) {
- 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 verifyChecksumsForFolder
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function verifyChecksumsForFolder($folder, InputInterface $input, OutputInterface $output) {
$folderQueue = [$folder];
while ($currentFolder = \array_pop($folderQueue)) {
'@phan-var \OCP\Files\Folder $currentFolder';
$currentFolderPath = $currentFolder->getPath();
- 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 checkDependencies
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function checkDependencies() {
$ret = [];
$result = \call_user_func([$this->getStorageClass(), 'checkDependencies']);
if ($result !== 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 writeExtra
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function writeExtra($app, $message, $level, $conditionalLogFile, $extraFields = []) {
$config = \OC::$server->getSystemConfig();
// default to ISO8601
$format = $config->getValue('logdateformat', 'c');
- 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"