app/Cli/Roundcube.php
Call to undeclared method \App\Db::createCommand
Open
Open
\App\Db::getInstance()->createCommand()->update('roundcube_users', ['preferences' => ''])->execute();
- Exclude checks
Reference to instance property arguments
from undeclared class \League\CLImate\CLImate
Open
Open
if (!$this->climate->arguments->defined('action')) {
- Exclude checks
Reference to instance property arguments
from undeclared class \League\CLImate\CLImate
Open
Open
if (!$this->climate->arguments->defined('action')) {
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
Open
\App\Db::getInstance()->createCommand()->truncateTable('roundcube_session')->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
Open
$createCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Reference to instance property arguments
from undeclared class \League\CLImate\CLImate
Open
Open
if (!$this->climate->arguments->defined('action')) {
- Exclude checks
Define a constant instead of duplicating this literal "Roundcube" 4 times. Open
Open
public $moduleName = 'Roundcube';
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "action" 3 times. Open
Open
if (!$this->climate->arguments->defined('action')) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Clear users preferences.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function clearUsersPreferences(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'clearUsersSession' => 'Clear users session',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var string[] Methods list */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $methods = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'clearUsersPreferences' => 'Clear users preferences',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Clear users session.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!$this->climate->arguments->defined('action')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->cli->actionsList('Roundcube');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$createCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$createCommand->truncateTable($table)->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->cli->actionsList('Roundcube');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
\App\Db::getInstance()->createCommand()->truncateTable('roundcube_session')->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Clear users cache.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->cli->actionsList('Roundcube');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function clearUsersCache(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!$this->climate->arguments->defined('action')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!$this->climate->arguments->defined('action')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach (['roundcube_cache', 'roundcube_cache_index', 'roundcube_cache_messages', 'roundcube_cache_shared', 'roundcube_cache_thread'] as $table) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
Open
foreach (['roundcube_cache', 'roundcube_cache_index', 'roundcube_cache_messages', 'roundcube_cache_shared', 'roundcube_cache_thread'] as $table) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $moduleName = 'Roundcube';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'clearUsersCache' => 'Clear users cache',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
\App\Db::getInstance()->createCommand()->update('roundcube_users', ['preferences' => ''])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function clearUsersSession(): void
- Exclude checks