YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/MailRbl/actions/SaveAjax.php

Summary

Maintainability
A
3 hrs
Test Coverage
F
0%

Method update has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function update(App\Request $request): void
    {
        $db = \App\Db::getInstance('admin');
        $requestMode = \in_array($request->getByType('type'), ['forVerification', 'toSend', 'request']);
        $response = new Vtiger_Response();
Severity: Minor
Found in modules/Settings/MailRbl/actions/SaveAjax.php - About 1 hr to fix

    Function checkExistingRbl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        private function checkExistingRbl(App\Request $request): string
        {
            $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));
            $rblRecord->parse();
            $sender = $rblRecord->getSender();
    Severity: Minor
    Found in modules/Settings/MailRbl/actions/SaveAjax.php - About 1 hr to fix

    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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public function update(App\Request $request): void
        {
            $db = \App\Db::getInstance('admin');
            $requestMode = \in_array($request->getByType('type'), ['forVerification', 'toSend', 'request']);
            $response = new Vtiger_Response();
    Severity: Minor
    Found in modules/Settings/MailRbl/actions/SaveAjax.php - About 55 mins to fix

    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

    Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
    Open

        private function checkExistingRbl(App\Request $request): string

    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

    See

    Missing class import via use statement (line '140', column '21').
    Open

            $configFile = new \App\ConfigFile('component', 'Mail');

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '144', column '19').
    Open

            $response = new Vtiger_Response();

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '47', column '19').
    Open

            $response = new Vtiger_Response();

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '64', column '17').
    Open

                    $ips = (new \App\Db\Query())->select(['ip'])->from('s_#__mail_rbl_list')->where(['id' => $request->getInteger('record')])->column($db);

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method update uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $db->createCommand()
                    ->update($requestMode ? 's_#__mail_rbl_request' : 's_#__mail_rbl_list', [
                        'status' => $request->getInteger('status')
                    ], ['id' => $request->getInteger('record')])->execute();

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid using static access to class '\App\Mail\Rbl' in method 'checkExistingRbl'.
    Open

                if ($ipsList = \App\Mail\Rbl::findIp($sender['ip'])) {

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid assigning values to variables in if clauses and the like (line '115', column '8').
    Open

        private function checkExistingRbl(App\Request $request): string
        {
            $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));
            $rblRecord->parse();
            $sender = $rblRecord->getSender();

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Avoid using static access to class 'App\Language' in method 'update'.
    Open

                        'title' => App\Language::translate('LBL_CHANGES_SAVED'),

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Cache' in method 'update'.
    Open

                        \App\Cache::delete('MailRblList', $ip);

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    The method updateList uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                \App\Db::getInstance('admin')
                    ->createCommand()
                    ->delete('s_#__mail_rbl_list', ['request' => $request->getInteger('record')])
                    ->execute();

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid using static access to class 'App\Language' in method 'checkExistingRbl'.
    Open

                            return App\Language::translateArgs('LBL_IP_EXISTING_IN_RBL', $request->getModule(false), $href, App\Language::translate($type, $request->getModule(false)));

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    The method update uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                } else {
                    $ips = (new \App\Db\Query())->select(['ip'])->from('s_#__mail_rbl_list')->where(['id' => $request->getInteger('record')])->column($db);
                    foreach ($ips as $ip) {
                        \App\Cache::delete('MailRblIpColor', $ip);
                        \App\Cache::delete('MailRblList', $ip);

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid assigning values to variables in if clauses and the like (line '48', column '101').
    Open

        public function update(App\Request $request): void
        {
            $db = \App\Db::getInstance('admin');
            $requestMode = \in_array($request->getByType('type'), ['forVerification', 'toSend', 'request']);
            $response = new Vtiger_Response();

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    Avoid using static access to class '\App\Cache' in method 'update'.
    Open

                        \App\Cache::delete('MailRblIpColor', $ip);

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Mail\Rbl' in method 'checkExistingRbl'.
    Open

            $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class 'App\Language' in method 'config'.
    Open

                    'title' => App\Language::translate('LBL_CHANGES_SAVED'),

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Db' in method 'update'.
    Open

            $db = \App\Db::getInstance('admin');

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\App\Mail\Rbl' in method 'updateList'.
    Open

                $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class 'App\Language' in method 'checkExistingRbl'.
    Open

                            return App\Language::translateArgs('LBL_IP_EXISTING_IN_RBL', $request->getModule(false), $href, App\Language::translate($type, $request->getModule(false)));

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Define a constant instead of duplicating this literal "title" 3 times.
    Open

                        'title' => $error,

    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 "s_#__mail_rbl_list" 3 times.
    Open

                    ->update($requestMode ? 's_#__mail_rbl_request' : 's_#__mail_rbl_list', [

    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 "status" 4 times.
    Open

            if ('forVerification' === $request->getByType('type') && 1 === $request->getInteger('status') && ($error = $this->checkExistingRbl($request))) {

    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.

    Merge this if statement with the enclosing one.
    Open

                if ($ipsList = \App\Mail\Rbl::findIp($sender['ip'])) {

    Merging collapsible if statements increases the code's readability.

    Noncompliant Code Example

    if (condition1) {
      if (condition2) {
        ...
      }
    }
    

    Compliant Solution

    if (condition1 && condition2) {
      ...
    }
    

    Define a constant instead of duplicating this literal "notify" 3 times.
    Open

                    'notify' => [

    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 "success" 5 times.
    Open

                    'success' => true,

    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.

    Rename "$rblRecord" which has the same name as the field declared at line 34.
    Open

            $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));

    Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

    Noncompliant Code Example

    class Foo {
      public $myField;
    
      public function doSomething() {
        $myField = 0;
        ...
      }
    }
    

    See

    Rename "$rblRecord" which has the same name as the field declared at line 34.
    Open

                $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));

    Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

    Noncompliant Code Example

    class Foo {
      public $myField;
    
      public function doSomething() {
        $myField = 0;
        ...
      }
    }
    

    See

    Define a constant instead of duplicating this literal "record" 6 times.
    Open

                    ], ['id' => $request->getInteger('record')])->execute();

    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.

    Call to undeclared method \App\Db\Query::select
    Open

                    $ips = (new \App\Db\Query())->select(['ip'])->from('s_#__mail_rbl_list')->where(['id' => $request->getInteger('record')])->column($db);

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

                $db->createCommand()

    Argument 1 (request) is int but \Settings_MailRbl_SaveAjax_Action::updateList() takes \App\Request defined at /code/modules/Settings/MailRbl/actions/SaveAjax.php:88
    Open

                $rblRecord->updateList($request->getInteger('record'));

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

                \App\Db::getInstance('admin')

    Each class must be in a namespace of at least one level (a top-level vendor name)
    Open

    class Settings_MailRbl_SaveAjax_Action extends Settings_Vtiger_Basic_Action

    Avoid variables with short names like $db. Configured minimum length is 3.
    Open

            $db = \App\Db::getInstance('admin');

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#shortvariable

    The class Settings_MailRbl_SaveAjax_Action is not named in CamelCase.
    Open

    class Settings_MailRbl_SaveAjax_Action extends Settings_Vtiger_Basic_Action
    {
        use \App\Controller\ExposeMethod;
        use \App\Controller\Traits\SettingsPermission;
    
    

    CamelCaseClassName

    Since: 0.2

    It is considered best practice to use the CamelCase notation to name classes.

    Example

    class class_name {
    }

    Source

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

         *

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

        public function update(App\Request $request): void

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

                        'type' => 'error',

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

                    foreach ($ips as $ip) {

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

         */

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

                            $href = "<a href=\"http://yeti/index.php?parent=Settings&module=MailRbl&view=Index&tab={$tab}&ip={$sender['ip']}\" target=\"_blank\">{$sender['ip']}</a>";

    Line exceeds 120 characters; contains 178 characters
    Open

                            $href = "<a href=\"http://yeti/index.php?parent=Settings&module=MailRbl&view=Index&tab={$tab}&ip={$sender['ip']}\" target=\"_blank\">{$sender['ip']}</a>";

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

                            return App\Language::translateArgs('LBL_IP_EXISTING_IN_RBL', $request->getModule(false), $href, App\Language::translate($type, $request->getModule(false)));

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

                    }

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

                }

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

        {

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

         */

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

                $db->createCommand()

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

         * Check existing IP in RBL list.

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

         *

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

            if (!empty($sender['ip'])) {

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

            }

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

            $configFile->set($name, $request->getBoolean('value'));

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

            $response = new Vtiger_Response();

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

                }

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

         * @return string

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

            $rblRecord->parse();

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

            $sender = $rblRecord->getSender();

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

                            $tab = $ipList['type'] ? 'whiteList' : 'blackList';

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

                    'title' => App\Language::translate('LBL_CHANGES_SAVED'),

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

                ],

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

        {

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

         * Status update.

    Line exceeds 120 characters; contains 180 characters
    Open

                            return App\Language::translateArgs('LBL_IP_EXISTING_IN_RBL', $request->getModule(false), $href, App\Language::translate($type, $request->getModule(false)));

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

                } else {

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

                        \App\Cache::delete('MailRblList', $ip);

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

                    'success' => true,

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

        /**

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

                \App\Db::getInstance('admin')

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

            $configFile->create();

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

            $response = new Vtiger_Response();

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

         *

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

                ]);

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

        private function updateList(App\Request $request): void

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

                $rblRecord->parse();

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

        }

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

            $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));

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

                if ($ipsList = \App\Mail\Rbl::findIp($sender['ip'])) {

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

                    foreach ($ipsList as $ipList) {

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

                        if ($type !== (int) $ipList['type']) {

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

         *

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

            $configFile = new \App\ConfigFile('component', 'Mail');

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

        }

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

        /** {@inheritdoc} */

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

        protected $rblRecord;

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

                    ->update($requestMode ? 's_#__mail_rbl_request' : 's_#__mail_rbl_list', [

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

                        'status' => $request->getInteger('status')

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

         *

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

         * @return void

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

         * @var \App\Mail\Rbl

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

         * Update.

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

            } else {

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

            $name = 'accept_mode' === $request->getByType('name') ? 'rcListAcceptAutomatically' : 'rcListSendReportAutomatically';

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

            $response->setResult([

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

                    'type' => 'success',

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

         * @param App\Request $request

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

                    $ips = (new \App\Db\Query())->select(['ip'])->from('s_#__mail_rbl_list')->where(['id' => $request->getInteger('record')])->column($db);

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

                        'title' => App\Language::translate('LBL_CHANGES_SAVED'),

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

         *

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

        {

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

                    ->execute();

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

                'notify' => [

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

            if ('forVerification' === $request->getByType('type') && 1 === $request->getInteger('status') && ($error = $this->checkExistingRbl($request))) {

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

                $response->setResult([

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

                    ],

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

                    }

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

         * @param App\Request $request

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

            if (1 === $request->getInteger('status')) {

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

                            $type = $ipList['type'] ? 'LBL_WHITE_LIST' : 'LBL_BLACK_LIST';

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

        /**

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

         * @param App\Request $request

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

        public function __construct()

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

        }

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

                if ($requestMode) {

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

                    'notify' => [

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

            }

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

        /**

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

         * Config update.

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

        public function config(App\Request $request): void

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

        use \App\Controller\Traits\SettingsPermission;

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

            parent::__construct();

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

        {

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

            $db = \App\Db::getInstance('admin');

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

                    'notify' => [

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

                        'title' => $error,

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

                        \App\Cache::delete('MailRblIpColor', $ip);

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

                ]);

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

                $rblRecord->updateList($request->getInteger('record'));

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

        private function checkExistingRbl(App\Request $request): string

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

            return '';

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

         *

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

            $this->exposeMethod('update');

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

         * Rbl record instance.

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

        /**

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

                    'success' => true,

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

                    ], ['id' => $request->getInteger('record')])->execute();

    Line exceeds 120 characters; contains 151 characters
    Open

                    $ips = (new \App\Db\Query())->select(['ip'])->from('s_#__mail_rbl_list')->where(['id' => $request->getInteger('record')])->column($db);

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

                $response->setResult([

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

                    ->delete('s_#__mail_rbl_list', ['request' => $request->getInteger('record')])

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

         *

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

         * @param App\Request $request

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

        {

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

        }

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

        use \App\Controller\ExposeMethod;

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

        /**

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

         *

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

         */

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

            $requestMode = \in_array($request->getByType('type'), ['forVerification', 'toSend', 'request']);

    Line exceeds 120 characters; contains 152 characters
    Open

            if ('forVerification' === $request->getByType('type') && 1 === $request->getInteger('status') && ($error = $this->checkExistingRbl($request))) {

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

            } else {

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

                    ],

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

        }

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

                $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));

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

                    ->createCommand()

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

            }

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

         */

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

                        }

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

            $this->exposeMethod('config');

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

         * @return void

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

                        'type' => 'success',

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

            $response->emit();

    Line exceeds 120 characters; contains 126 characters
    Open

            $name = 'accept_mode' === $request->getByType('name') ? 'rcListAcceptAutomatically' : 'rcListSendReportAutomatically';

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

                'success' => true,

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

                    $this->updateList($request);

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

                    $type = (int) $rblRecord->get('type');

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

         * @return void

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

         */

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

            ]);

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

            $response->emit();

    Class name "Settings_MailRbl_SaveAjax_Action" is not in camel caps format
    Open

    class Settings_MailRbl_SaveAjax_Action extends Settings_Vtiger_Basic_Action

    There are no issues that match your filters.

    Category
    Status