Showing 3,235 of 4,503 total issues
Method editUser
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function editUser($parameters) {
/** @var string $targetUserId */
$targetUserId = $parameters['userid'];
// Check if user is logged in
File Installer.php
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Bart Visscher <bartv@thisnet.nl>
* @author Brice Maron <brice@bmaron.net>
Method execute
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$username = $input->getArgument('user');
$emailLink = $input->getOption('send-email');
$displayLink = $input->getOption('output-link');
UserList
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
var UserList = {
availableGroups: {},
offset: 0,
usersToLoad: 200,
initialUsersToLoad: 200, // initial number of users to load
StorageConfig
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class StorageConfig implements IStorageConfig {
/**
* Storage config id
*
* @var int
Connection
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Connection extends \Doctrine\DBAL\Connection implements IDBConnection {
/**
* @var string $tablePrefix
*/
protected $tablePrefix;
Function createItem
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createItem(element, checked){
element=$(element);
var item=element.val();
var id='ms'+multiSelectId+'-option-'+item;
var input=$('<input type="' + inputType + '"/>');
Method formatShare
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formatShare(IShare $share, $received = false) {
$sharedBy = $this->userManager->get($share->getSharedBy());
$shareFileOwner = $this->userManager->get($share->getShareOwner());
$result = [
Method copy
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function copy($path1, $path2, $preserveMtime = false) {
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($path1));
$absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($path2));
return $this->emittingCall(function () use ($absolutePath1, $absolutePath2) {
$result = false;
Method analyse
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function analyse($appId) {
$appPath = $this->appManager->getAppPath($appId);
if ($appPath === false) {
throw new \RuntimeException("No app with given id <$appId> known.");
}
File Activity.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Joas Schilling <coding@schilljs.com>
* @author Morris Jobke <hey@morrisjobke.de>
* @author Thomas Müller <thomas.mueller@tmit.eu>
Function add
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
add: function(e, data) {
self.log('add', e, data);
var that = $(this), freeSpace;
var upload = new OC.FileUpload(self, data);
Method get
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function get($dir, $files, $params = null) {
$view = \OC\Files\Filesystem::getView();
if (!\is_array($files)) {
// "files" contains a string with a filename
Function getNodeForPath
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getNodeForPath($path) {
if (!$this->fileView) {
throw new \Sabre\DAV\Exception\ServiceUnavailable('filesystem not setup');
}
- 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 rename
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function rename($source, $target) {
$this->log("enter: rename('$source', '$target')", Util::DEBUG);
if ($this->isRootDir($source) || $this->isRootDir($target)) {
$this->log("refusing to rename \"$source\" to \"$target\"");
- 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 verify
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function verify($signaturePath, $basePath, $certificateCN, $force = false) {
if (!$force && !$this->isCodeCheckEnforced()) {
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 getIdsForTag
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function getIdsForTag($tag) {
$result = null;
$tagId = false;
if (\is_numeric($tag)) {
$tagId = $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 fixOrientation
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function fixOrientation() {
$o = $this->getOrientation();
$this->logger->debug('OC_Image->fixOrientation() Orientation: ' . $o, ['app' => 'core']);
$rotate = 0;
$flip = 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 loadFromFile
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function loadFromFile($imagePath = false) {
// exif_imagetype throws "read error!" if file is less than 12 byte
if (!@\is_file($imagePath) || !\file_exists($imagePath) || \filesize($imagePath) < 12 || !\is_readable($imagePath)) {
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 gc
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function gc() {
$storage = $this->getStorage();
if ($storage and $storage->is_dir('/')) {
// extra hour safety, in case of stray part chunks that take longer to write,
// because touch() is only called after the chunk was finished
- 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"