Showing 3,229 of 4,480 total issues
File DefaultShareProvider.php
has 866 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Björn Schießle <bjoern@schiessle.org>
* @author Joas Schilling <coding@schilljs.com>
* @author phisch <git@philippschaffrath.de>
Function init
has a Cognitive Complexity of 94 (exceeds 5 allowed). Consider refactoring. Open
init: function($uploadEl, options) {
var self = this;
options = options || {};
this._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 scanFile
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true) {
// only proceed if $file is not a partial file nor a blacklisted file
if (!self::isPartialFile($file) and !Filesystem::isFileBlacklisted($file)) {
//acquire a lock
if ($lock && $this->storage->instanceOfStorage(ILockingStorage::class)) {
- 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 getUsersSharingFile
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false, $recursive = true) {
$userManager = \OC::$server->getUserManager();
$userObject = $userManager->get($ownerUser);
if ($userObject === null) {
- 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
File Session.php
has 775 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @author Christoph Wurst <christoph@owncloud.com>
Function init
has 358 lines of code (exceeds 25 allowed). Consider refactoring. Open
init: function($uploadEl, options) {
var self = this;
options = options || {};
this._uploads = {};
File image.php
has 761 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Andreas Fischer <bantu@owncloud.com>
* @author Bartek Przybylski <bart.p.pl@gmail.com>
* @author Bart Visscher <bartv@thisnet.nl>
Method getItems
has 344 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getItems(
$itemType,
$item = null,
$shareType = null,
$shareWith = null,
Function log
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
public function log($level, $message, array $context = []) {
$minLevel = \min($this->config->getValue('loglevel', Util::WARN), Util::FATAL);
$logConditions = $this->config->getValue('log.conditions', []);
if (empty($logConditions)) {
$logConditions[] = $this->config->getValue('log.condition', []);
- 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 getDirectoryContent
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
public function getDirectoryContent($directory, $mimetype_filter = '') {
$this->assertPathLength($directory);
if (!Filesystem::isValidPath($directory)) {
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
Server
has 87 functions (exceeds 20 allowed). Consider refactoring. Open
class Server extends ServerContainer implements IServerContainer, IServiceLoader {
use EventEmitterTrait;
/** @var string */
private $webRoot;
View
has 85 functions (exceeds 20 allowed). Consider refactoring. Open
class View {
use EventEmitterTrait;
/** @var string */
private $fakeRoot = '';
File kernel.php
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Adam Williamson <awilliam@redhat.com>
* @author Andreas Fischer <bantu@owncloud.com>
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
File FederatedShareProvider.php
has 697 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Björn Schießle <bjoern@schiessle.org>
* @author Robin Appelman <icewind@owncloud.com>
* @author Roeland Jago Douma <rullzer@owncloud.com>
Function multiSelect
has 311 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.multiSelect=function(options) {
multiSelectId++;
var settings = {
'createCallback':false,
'createText':false,
File Trashbin.php
has 683 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Bart Visscher <bartv@thisnet.nl>
* @author Bastien Ho <bastienho@urbancube.fr>
* @author Björn Schießle <bjoern@schiessle.org>
File oc-dialogs.js
has 677 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* ownCloud
*
* @author Bartek Przybylski, Christopher Schäpers, Thomas Tanghus
* @copyright Copyright (c) 2012 Bartek Przybylski bartek@alefzero.eu
Function createShare
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
public function createShare() {
$share = $this->shareManager->newShare();
if (!$this->shareManager->shareApiEnabled()) {
return new Result(null, 404, $this->l->t('Share API is disabled'));
- 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 imagebmp
has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring. Open
function imagebmp($im, $fileName = '', $bit = 24, $compression = 0) {
if (!\in_array($bit, [1, 4, 8, 16, 24, 32])) {
$bit = 24;
} elseif ($bit == 32) {
$bit = 24;
- 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
File Preview.php
has 665 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Björn Schießle <bjoern@schiessle.org>
* @author Frank Karlitschek <frank@karlitschek.de>
* @author Georg Ehrke <georg@owncloud.com>