Showing 4,504 of 4,504 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
IUserSession $userSession = null,
IAppConfig $appConfig = null,
IGroupManager $groupManager = null,
ICacheFactory $memCacheFactory,
EventDispatcherInterface $dispatcher,
Avoid deeply nested control flow statements. Open
for ($k = 8 - $bit; $k >= $limit; $k -= $bit) {
$index = \imagecolorat($im, $i, $j);
$bin |= $index << $k;
$i++;
}
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(IConfig $config, ILogger $logger, IL10N $l10n, View $rootView, Util $util, ArrayCache $arrayCache) {
Function respond
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function respond($result, $format='xml') {
$request = \OC::$server->getRequest();
// Send 401 headers if unauthorised
if ($result->getStatusCode() === API::RESPOND_UNAUTHORISED) {
- 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 checkDatabaseVersion
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function checkDatabaseVersion() {
$l = \OC::$server->getL10N('lib');
$errors = [];
$dbType = \OC::$server->getSystemConfig()->getValue('dbtype', 'sqlite');
if ($dbType === 'pgsql') {
- 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 generateToken
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function generateToken($token, $uid, $loginName, $password, $name, $type = IToken::TEMPORARY_TOKEN) {
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
IConfig $config,
IniGetWrapper $iniWrapper,
IL10N $l10n,
\OC_Defaults $defaults,
ILogger $logger,
Method generateToken
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function generateToken($token, $uid, $loginName, $password, $name, $type = IToken::TEMPORARY_TOKEN);
Function executeStep
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function executeStep($version) {
$this->logger->debug("Migrations: starting $version from app {$this->appName}", ['app' => 'core']);
$instance = $this->createInstance($version);
if ($instance instanceof ISimpleMigration) {
$instance->run($this->output);
- 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 quoteColumnName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function quoteColumnName($string) {
if ($string instanceof IParameter || $string instanceof ILiteral || $string instanceof IQueryFunction) {
return (string) $string;
}
- 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 decrypt
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function decrypt($authenticatedCiphertext, $password = '') {
if ($password === '') {
$password = $this->config->getSystemValue('secret');
}
- 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 setValues
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function setValues($table, array $keys, array $values, array $updatePreconditionValues = []) {
// Try to insert whole record into the table ($toInsert) if predicate NOT EXISTS ($compare) is satisfied
$toInsert = \array_merge($keys, $values);
$compare = \array_keys($keys);
$tableName = $this->tablePrefix . $table;
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(AppManager $appManager, ISession $session, IGroupManager $groupManager, IConfig $config, IRequest $request, ILogger $logger) {
Function l
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function l($type, $data = null, $options = []) {
// Use the language of the instance
$locale = $this->getLanguageCode();
if ($locale === 'sr@latin') {
$locale = 'sr_latn';
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function run(UserInterface $backend, \Traversable $userIds, \Closure $callback = null) {
// update existing and insert new users
foreach ($userIds as $uid) {
try {
$account = $this->createOrSyncAccount($uid, $backend);
- 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 execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int {
$toBeSet = [];
if ($input->getOption('enable')) {
$toBeSet['log_type'] = 'owncloud';
- 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 analyzeStream
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function analyzeStream($stream, array $processors = [], int $maxBytes = PHP_INT_MAX) {
$byteCount = 0;
$map = [];
$processorActions = [
'count' => 'processCountChars',
- 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 getNext
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getNext() {
$query = $this->connection->getQueryBuilder();
$query->select('*')
->from('jobs')
->where($query->expr()->lte('reserved_at', $query->createNamedParameter($this->timeFactory->getTime() - 12 * 3600, IQueryBuilder::PARAM_INT)))
- 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 changeSchema
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function changeSchema(Schema $schema, array $options) {
$prefix = $options['tablePrefix'];
if (!$schema->hasTable("{$prefix}account_terms")) {
$table = $schema->createTable("{$prefix}account_terms");
- 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
Avoid deeply nested control flow statements. Open
if (!isset($contact['EMAIL'])) {
continue;
}