Showing 3,235 of 4,504 total issues
Method execute
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$user = $input->getOption('user');
$path = $input->getArgument('path');
if ($path === '-') {
$json = \file_get_contents('php://stdin');
Method copyBetweenStorage
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function copyBetweenStorage(Storage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime, $isRename) {
// for versions we have nothing to do, because versions should always use the
// key from the original file. Just create a 1:1 copy and done
if ($this->isVersion($targetInternalPath) ||
$this->isVersion($sourceInternalPath)) {
Method getAllStorages
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllStorages() {
$mountPoints = $this->readLegacyConfig();
/**
* Here is the how the horribly messy mount point array looks like
* from the mount.json file:
Method run
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(IOutput $output) {
if ($this->config->getSystemValue('has_internet_connection', true) !== true) {
$link = $this->defaults->buildDocLinkToKey('admin-marketplace-apps');
$output->info('No internet connection available - no app updates will be taken from the marketplace.');
$output->info("How to update apps in such situation please see $link");
Method enterNode
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function enterNode(Node $node) {
if ($this->checkEqualOperatorUsage && $node instanceof Node\Expr\BinaryOp\Equal) {
$this->errors[]= [
'disallowedToken' => '==',
'errorCode' => CodeChecker::OP_OPERATOR_USAGE_DISCOURAGED,
Method listAllApps
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function listAllApps(bool $listEveryApp = false) {
$installedApps = OC_App::getAllApps();
//TODO which apps do we want to blacklist and how do we integrate
// blacklisting with the multi apps folder feature?
Function add
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
add: function (user) {
if (this.currentGid && this.currentGid !== '_everyone' && user.groups[this.currentGid] === undefined) {
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 getGroups
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function getGroups($search) {
$this->result['groups'] = $this->result['exact']['groups'] = [];
if (\strlen(\trim($search)) === 0 && $this->userSearch->getSearchMinLength() > 0) {
$this->result['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 getTrashFiles
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function getTrashFiles($dir, $user, $sortAttribute = '', $sortDescending = false, $addExtraData = true) {
$result = [];
$timestamp = null;
$view = new \OC\Files\View('/' . $user . '/files_trashbin/files');
- 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 fopen
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function fopen($path, $mode) {
$pos = \strrpos($path, '.');
if ($pos !== false) {
$ext = \substr($path, $pos);
} else {
- 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 getAutoExpireList
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected static function getAutoExpireList($time, $versions) {
$size = 0;
$toDelete = []; // versions we want to delete
$interval = 1;
- 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 searchCommon
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function searchCommon($method, $args) {
$files = [];
$rootLength = \strlen($this->fakeRoot);
$mount = $this->getMount('');
- 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 calculateFolderSize
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function calculateFolderSize($path, $entry = null) {
$totalSize = 0;
if ($entry === null or !isset($entry['fileid'])) {
$entry = $this->get($path);
}
- 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 getAllSharedWith
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getAllSharedWith($userId, $node) {
// Create array of sharedWith objects (target user -> $userId or group of which user is a member
$user = $this->userManager->get($userId);
// Check if user is member of some groups and chunk them
- 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 getSingleFile
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private static function getSingleFile($view, $dir, $name, $params) {
$filename = "{$dir}/{$name}";
OC_Util::obEnd();
$view->lockFile($filename, ILockingProvider::LOCK_SHARED);
- 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 auth
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function auth(IRequest $request) {
if (!isset($request->server['PHP_AUTH_USER'], $request->server['PHP_AUTH_PW'])) {
return null;
}
if ($this->session->exists('app_password')) {
- 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 _createRow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createRow: function(fileData) {
// TODO: hook earlier and render the whole row here
var $tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments);
var td;
var formatted;
File ca.js
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
OC.L10N.register(
"core",
{
"Please select a file." : "Si us plau, selecciona un fitxer",
"File is too big" : "El fitxer és massa gran",
Method getDenormalizedData
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDenormalizedData($calendarData) {
$vObject = Reader::read($calendarData);
$componentType = null;
$component = null;
$firstOccurrence = null;
Method propFind
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function propFind(PropFind $propFind, INode $node) {
// properties about the share
if ($node instanceof PublicSharedRootNode) {
$propFind->handle(self::PUBLIC_LINK_ITEM_TYPE, static function () use ($node) {
return $node->getShare()->getNodeType();