YetiForceCompany/YetiForceCRM

View on GitHub
app/Cli/Roundcube.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Call to undeclared method \App\Db::createCommand
Open

        \App\Db::getInstance()->createCommand()->update('roundcube_users', ['preferences' => ''])->execute();
Severity: Critical
Found in app/Cli/Roundcube.php by phan

Reference to instance property arguments from undeclared class \League\CLImate\CLImate
Open

        if (!$this->climate->arguments->defined('action')) {
Severity: Minor
Found in app/Cli/Roundcube.php by phan

Reference to instance property arguments from undeclared class \League\CLImate\CLImate
Open

        if (!$this->climate->arguments->defined('action')) {
Severity: Minor
Found in app/Cli/Roundcube.php by phan

Call to undeclared method \App\Db::createCommand
Open

        \App\Db::getInstance()->createCommand()->truncateTable('roundcube_session')->execute();
Severity: Critical
Found in app/Cli/Roundcube.php by phan

Call to undeclared method \App\Db::createCommand
Open

        $createCommand = \App\Db::getInstance()->createCommand();
Severity: Critical
Found in app/Cli/Roundcube.php by phan

Reference to instance property arguments from undeclared class \League\CLImate\CLImate
Open

        if (!$this->climate->arguments->defined('action')) {
Severity: Minor
Found in app/Cli/Roundcube.php by phan

Define a constant instead of duplicating this literal "Roundcube" 4 times.
Open

    public $moduleName = 'Roundcube';
Severity: Critical
Found in app/Cli/Roundcube.php by sonar-php

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

        if (!$this->climate->arguments->defined('action')) {
Severity: Critical
Found in app/Cli/Roundcube.php by sonar-php

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

     * Clear users preferences.
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function clearUsersPreferences(): void
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        'clearUsersSession' => 'Clear users session',
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    ];
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string[] Methods list */
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $methods = [
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        'clearUsersPreferences' => 'Clear users preferences',
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Clear users session.
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$this->climate->arguments->defined('action')) {
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->cli->actionsList('Roundcube');
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $createCommand = \App\Db::getInstance()->createCommand();
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $createCommand->truncateTable($table)->execute();
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->cli->actionsList('Roundcube');
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Db::getInstance()->createCommand()->truncateTable('roundcube_session')->execute();
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Clear users cache.
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->cli->actionsList('Roundcube');
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function clearUsersCache(): void
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$this->climate->arguments->defined('action')) {
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$this->climate->arguments->defined('action')) {
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach (['roundcube_cache', 'roundcube_cache_index', 'roundcube_cache_messages', 'roundcube_cache_shared', 'roundcube_cache_thread'] as $table) {
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Line exceeds 120 characters; contains 154 characters
Open

        foreach (['roundcube_cache', 'roundcube_cache_index', 'roundcube_cache_messages', 'roundcube_cache_shared', 'roundcube_cache_thread'] as $table) {
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public $moduleName = 'Roundcube';
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        'clearUsersCache' => 'Clear users cache',
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Db::getInstance()->createCommand()->update('roundcube_users', ['preferences' => ''])->execute();
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function clearUsersSession(): void
Severity: Minor
Found in app/Cli/Roundcube.php by phpcodesniffer

There are no issues that match your filters.

Category
Status