Showing 3,230 of 4,482 total issues
Function initialize
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize: function ($el) {
var self = this;
var fileActions;
if (this._initialized) {
return;
OC_Util
has 55 functions (exceeds 20 allowed). Consider refactoring. Open
class OC_Util {
public static $scripts = [];
public static $styles = [];
public static $headers = [];
private static $rootMounted = false;
QueryBuilder
has 55 functions (exceeds 20 allowed). Consider refactoring. Open
class QueryBuilder implements IQueryBuilder {
/** @var \OCP\IDBConnection */
private $connection;
/** @var \Doctrine\DBAL\Query\QueryBuilder */
File ShareesController.php
has 490 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 Roeland Jago Douma <rullzer@owncloud.com>
Function retainVersions
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
private static function retainVersions($filename, $owner, $ownerPath, $timestamp, $sourceStorage = null, $forceCopy = false) {
if (\OCP\App::isEnabled('files_versions') && !empty($ownerPath)) {
$copyKeysResult = false;
// Temporary
- 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 loadField
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
private function loadField($table, $xml) {
$options = ['notnull' => false];
$primary = null;
foreach ($xml->children() as $child) {
/**
- 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 checkServer
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function checkServer(\OCP\IConfig $config) {
$l = \OC::$server->getL10N('lib');
$errors = [];
$CONFIG_DATADIRECTORY = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data');
Method execute
has 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
if ($output->getVerbosity() === OutputInterface::VERBOSITY_NORMAL
&& !$input->hasParameterOption('--verbose=0', true)) {
// set to more verbose on upgrade if no explicit verbosity was set
$output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE);
Function updateShare
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public function updateShare($id) {
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 getAllStorages
has a Cognitive Complexity of 48 (exceeds 5 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:
- 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 Manager.php
has 474 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Joas Schilling <coding@schilljs.com>
* @author Thomas Müller <thomas.mueller@tmit.eu>
Function put
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
public function put($data) {
try {
$exists = $this->fileView->file_exists($this->path);
if ($this->info && $exists && !$this->info->isUpdateable()) {
throw new Forbidden();
- 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 create
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
private function create() {
$isConnectionParametersSupported = $this->isConnectionParametersSupported();
if ($config = $this->config->getValue('redis.cluster', [])) {
if (!\class_exists('RedisCluster')) {
- 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 createShare
has 181 lines of code (exceeds 25 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'));
File statusmanager.js
has 466 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* ownCloud
*
* @author Juan Pablo Villafañez Ramos <jvillafanez@owncloud.com>
* @author Jesus Macias Portela <jesus@owncloud.com>
Util
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
class Util {
// consts for Logging
public const DEBUG=0;
public const INFO=1;
public const WARN=2;
Method init
has 179 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function init() {
// calculate the root directories
OC::$SERVERROOT = \str_replace("\\", '/', \substr(__DIR__, 0, -4));
// register autoloader
File Users.php
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @author Arthur Schiwon <blizzz@arthur-schiwon.de>
* @author Joas Schilling <coding@schilljs.com>
* @author Lukas Reschke <lukas@statuscode.ch>
Function create
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
public function create($username, $password, array $groups= [], $email='') {
$resp = $this->validateString($username, 255);
if ($resp) {
return $resp;
}
- 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 getRemote
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
protected function getRemote($search) {
$this->result['remotes'] = $this->result['exact']['remotes'] = $users = [];
if (\strlen(\trim($search)) === 0 && $this->userSearch->getSearchMinLength() > 0) {
$this->result['remotes'] = [];
- 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"