Showing 3,235 of 4,504 total issues
Function doFind
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function doFind($script) {
$fullScript = $this->addExtension($script);
$themeDirectory = $this->theme->getDirectory();
$baseDirectory = $this->theme->getBaseDirectory();
$webRoot = '';
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function rename($path1, $path2) {
$srcParent = \dirname($path1);
$dstParent = \dirname($path2);
if (!$this->isUpdatable($srcParent)) {
- 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 get
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function get($file) {
if (\is_string($file) or $file == '') {
// normalize file
$file = $this->normalize($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 createDBUser
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function createDBUser($connection) {
$name = $this->dbUser;
$password = $this->dbPassword;
$query = 'SELECT * FROM all_users WHERE USERNAME = :un';
$stmt = \oci_parse($connection, $query);
- 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 groupCreateChecks
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function groupCreateChecks(\OCP\Share\IShare $share) {
// Verify group shares are allowed
if (!$this->allowGroupSharing()) {
throw new \Exception('Group sharing is not allowed');
}
- 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 getMessageForLicense
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getMessageForLicense(array $info, string $language = null): array {
$l = $this->l10nFactory->get('core', $language);
// check if present
if ($info['licenseState'] === ILicenseManager::LICENSE_STATE_MISSING) {
- 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 moveAvatars
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function moveAvatars(IOutput $out, IUser $user) {
$userId = $user->getUID();
try {
\OC\Files\Filesystem::initMountPoints($userId);
- 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 getLicenseWithState
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getLicenseWithState(string $appid) {
// check if license is missing
$licenseObj = $this->licenseFetcher->getOwncloudLicense();
if ($licenseObj === null) {
$licenseState = ILicenseManager::LICENSE_STATE_MISSING;
- 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 rmdirr
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function rmdirr($dir, $deleteSelf = true) {
if (\is_dir($dir)) {
$files = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST
- 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 getSupportedDatabases
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getSupportedDatabases($allowAllDatabases = false) {
$availableDatabases = [
'sqlite' => [
'type' => 'class',
'call' => 'SQLite3',
- 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 saveColumn
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private static function saveColumn($column, $xml) {
$xml->addChild('name', $column->getName());
switch ($column->getType()) {
case 'SmallInt':
case 'Integer':
- 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 addExternalResource
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private static function addExternalResource($application, $prepend, $path, $type = "script") {
if ($type === "style") {
if (!\in_array($path, self::$styles)) {
if ($prepend === true) {
\array_unshift(self::$styles, $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 verifyAuthHeaders
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function verifyAuthHeaders($request) {
$shallLogout = false;
try {
$lastUser = null;
foreach ($this->getAuthModules(true) as $module) {
- 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 validateInput
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function validateInput(InputInterface $input, OutputInterface $output, $supportedDatabases) {
$db = \strtolower($input->getOption('database'));
if (!\in_array($db, $supportedDatabases)) {
throw new InvalidArgumentException("Database <$db> is not supported.");
- 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
Method __construct
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
$appName,
IRequest $request,
IURLGenerator $urlGenerator,
IUserManager $userManager,
OC_Defaults $defaults,
Function rebuildNavigation
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
rebuildNavigation: function() {
$.getJSON(OC.filePath('settings', 'ajax', 'navigationdetect.php')).done(function(response){
if(response.status === 'success'){
var idsToKeep = {};
var navEntries=response.nav_entries;
Function _initFilterField
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initFilterField: function ($container) {
this.$filterField = $('<input type="hidden" name="tags"/>');
$container.append(this.$filterField);
this.$filterField.select2({
placeholder: t('systemtags', 'Select tags to filter by'),
Function getAuthUrl
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
OCA.External.Settings.OAuth2.getAuthUrl = function (backendUrl, data) {
var $tr = data['tr'];
var configured = $tr.find('[data-parameter="configured"]');
var token = $tr.find('.configuration [data-parameter="token"]');
Function EventSource
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
OC.EventSource=function(src,data){
var dataStr='';
var name;
var joinChar;
this.typelessListeners=[];
Function showNotification
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
showNotification: function() {
if (!this._template) {
this._template = Handlebars.compile(this.NOTIFICATION_TEMPLATE);
}