YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
F
4 days
Test Coverage
F
0%

File GetData.php has 257 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Settings MailRbl get data action file.
 *
Severity: Minor
Found in modules/Settings/MailRbl/actions/GetData.php - About 2 hrs to fix

    Method request has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function request(App\Request $request)
        {
            $rows = [];
            $query = $this->getQuery($request);
            $query->from('s_#__mail_rbl_request')->select(['id', 'status', 'type', 'datetime', 'user', 'header', 'body']);
    Severity: Minor
    Found in modules/Settings/MailRbl/actions/GetData.php - About 1 hr to fix

      Method forVerification has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function forVerification(App\Request $request)
          {
              $rows = [];
              $query = $this->getQuery($request);
              $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);
      Severity: Minor
      Found in modules/Settings/MailRbl/actions/GetData.php - About 1 hr to fix

        Method toSend has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function toSend(App\Request $request)
            {
                $rows = [];
                $query = $this->getQuery($request);
                $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);
        Severity: Minor
        Found in modules/Settings/MailRbl/actions/GetData.php - About 1 hr to fix

          Method getQuery has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function getQuery(App\Request $request): App\Db\Query
              {
                  $columns = [];
                  foreach ($request->getArray('columns') as $key => $value) {
                      $columns[$key] = $value['data'];
          Severity: Minor
          Found in modules/Settings/MailRbl/actions/GetData.php - About 1 hr to fix

            Function getQuery has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function getQuery(App\Request $request): App\Db\Query
                {
                    $columns = [];
                    foreach ($request->getArray('columns') as $key => $value) {
                        $columns[$key] = $value['data'];
            Severity: Minor
            Found in modules/Settings/MailRbl/actions/GetData.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

            Function forVerification has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function forVerification(App\Request $request)
                {
                    $rows = [];
                    $query = $this->getQuery($request);
                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);
            Severity: Minor
            Found in modules/Settings/MailRbl/actions/GetData.php - About 25 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

            Function request has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function request(App\Request $request)
                {
                    $rows = [];
                    $query = $this->getQuery($request);
                    $query->from('s_#__mail_rbl_request')->select(['id', 'status', 'type', 'datetime', 'user', 'header', 'body']);
            Severity: Minor
            Found in modules/Settings/MailRbl/actions/GetData.php - About 25 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

            The method getQuery() has an NPath complexity of 1944. The configured NPath complexity threshold is 200.
            Open

                private function getQuery(App\Request $request): App\Db\Query
                {
                    $columns = [];
                    foreach ($request->getArray('columns') as $key => $value) {
                        $columns[$key] = $value['data'];

            NPathComplexity

            Since: 0.1

            The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

            Example

            class Foo {
                function bar() {
                    // lots of complicated code
                }
            }

            Source https://phpmd.org/rules/codesize.html#npathcomplexity

            The method getQuery() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
            Open

                private function getQuery(App\Request $request): App\Db\Query
                {
                    $columns = [];
                    foreach ($request->getArray('columns') as $key => $value) {
                        $columns[$key] = $value['data'];

            CyclomaticComplexity

            Since: 0.1

            Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

            Example

            // Cyclomatic Complexity = 11
            class Foo {
            1   public function example() {
            2       if ($a == $b) {
            3           if ($a1 == $b1) {
                            fiddle();
            4           } elseif ($a2 == $b2) {
                            fiddle();
                        } else {
                            fiddle();
                        }
            5       } elseif ($c == $d) {
            6           while ($c == $d) {
                            fiddle();
                        }
            7        } elseif ($e == $f) {
            8           for ($n = 0; $n < $h; $n++) {
                            fiddle();
                        }
                    } else {
                        switch ($z) {
            9               case 1:
                                fiddle();
                                break;
            10              case 2:
                                fiddle();
                                break;
            11              case 3:
                                fiddle();
                                break;
                            default:
                                fiddle();
                                break;
                        }
                    }
                }
            }

            Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

            Missing class import via use statement (line '41', column '24').
            Open

                    $requestQuery = (new \App\Db\Query())->from('s_#__mail_rbl_request');

            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 '299', column '17').
            Open

                    $query = (new \App\Db\Query());

            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 '42', column '21').
            Open

                    $listQuery = (new \App\Db\Query())->from('s_#__mail_rbl_list');

            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 '43', 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

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

                public function request(App\Request $request)
                {
                    $rows = [];
                    $query = $this->getQuery($request);
                    $query->from('s_#__mail_rbl_request')->select(['id', 'status', 'type', 'datetime', 'user', 'header', 'body']);

            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 assigning values to variables in if clauses and the like (line '315', column '38').
            Open

                private function getQuery(App\Request $request): App\Db\Query
                {
                    $columns = [];
                    foreach ($request->getArray('columns') as $key => $value) {
                        $columns[$key] = $value['data'];

            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 assigning values to variables in if clauses and the like (line '73', column '9').
            Open

                public function forVerification(App\Request $request)
                {
                    $rows = [];
                    $query = $this->getQuery($request);
                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);

            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\Db' in method 'forVerification'.
            Open

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

            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 'publicRbl'.
            Open

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

            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\Json' in method 'publicRbl'.
            Open

                    echo \App\Json::encode($result);

            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\Json' in method 'toSend'.
            Open

                    echo \App\Json::encode($result);

            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\Purifier' in method 'request'.
            Open

                            $ip = $icon . \App\Purifier::encodeHtml($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\Purifier' in method 'request'.
            Open

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

            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 '306', column '38').
            Open

                private function getQuery(App\Request $request): App\Db\Query
                {
                    $columns = [];
                    foreach ($request->getArray('columns') as $key => $value) {
                        $columns[$key] = $value['data'];

            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 'forVerification'.
            Open

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

            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\Fields\Owner' in method 'forVerification'.
            Open

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

            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 'toSend'.
            Open

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

            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 'toSend'.
            Open

                        $mailRbl = \App\Mail\Rbl::getInstance($row);

            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\Purifier' in method 'toSend'.
            Open

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

            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\Purifier' in method 'toSend'.
            Open

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

            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 '157', column '9').
            Open

                public function request(App\Request $request)
                {
                    $rows = [];
                    $query = $this->getQuery($request);
                    $query->from('s_#__mail_rbl_request')->select(['id', 'status', 'type', 'datetime', 'user', 'header', 'body']);

            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\Db' in method 'blackList'.
            Open

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

            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\Purifier' in method 'forVerification'.
            Open

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

            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 'request'.
            Open

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

            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 'request'.
            Open

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

            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\Json' in method 'blackList'.
            Open

                    echo \App\Json::encode($result);

            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 'forVerification'.
            Open

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

            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 'request'.
            Open

                        $mailRbl = \App\Mail\Rbl::getInstance($row);

            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\Fields\Owner' in method 'request'.
            Open

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

            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\Layout' in method 'publicRbl'.
            Open

                            'comment' => \App\Layout::truncateText($row['comment'], 30),

            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 'blackList'.
            Open

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

            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 'whiteList'.
            Open

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

            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 'forVerification'.
            Open

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

            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\Purifier' in method 'forVerification'.
            Open

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

            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\Json' in method 'forVerification'.
            Open

                    echo \App\Json::encode($result);

            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\Fields\DateTime' in method 'toSend'.
            Open

                            'datetime' => \App\Fields\DateTime::formatToDisplay($row['datetime']),

            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\Purifier' in method 'toSend'.
            Open

                            'ip' => \App\Purifier::encodeHtml($mailRbl->getSender()['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\Purifier' in method 'request'.
            Open

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

            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 'publicRbl'.
            Open

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

            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\Purifier' in method 'forVerification'.
            Open

                            $ip = $icon . \App\Purifier::encodeHtml($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\Json' in method 'request'.
            Open

                    echo \App\Json::encode($result);

            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 'publicRbl'.
            Open

                            'type' => \App\Language::translate((\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST == $row['type'] ? 'LBL_BLACK_LIST' : 'LBL_WHITE_LIST'), 'Settings:MailRbl'),

            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\Fields\DateTime' in method 'forVerification'.
            Open

                            'datetime' => \App\Fields\DateTime::formatToDisplay($row['datetime']),

            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\Fields\Owner' in method 'toSend'.
            Open

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

            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 'request'.
            Open

                            if ($ips = \App\Mail\Rbl::findIp($ip, true)) {

            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 'whiteList'.
            Open

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

            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 'forVerification'.
            Open

                        $mailRbl = \App\Mail\Rbl::getInstance($row);

            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 'request'.
            Open

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

            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\Fields\DateTime' in method 'request'.
            Open

                            'datetime' => \App\Fields\DateTime::formatToDisplay($row['datetime']),

            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 'request'.
            Open

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

            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 '309', column '40').
            Open

                private function getQuery(App\Request $request): App\Db\Query
                {
                    $columns = [];
                    foreach ($request->getArray('columns') as $key => $value) {
                        $columns[$key] = $value['data'];

            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 assigning values to variables in if clauses and the like (line '318', column '39').
            Open

                private function getQuery(App\Request $request): App\Db\Query
                {
                    $columns = [];
                    foreach ($request->getArray('columns') as $key => $value) {
                        $columns[$key] = $value['data'];

            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 assigning values to variables in if clauses and the like (line '71', column '8').
            Open

                public function forVerification(App\Request $request)
                {
                    $rows = [];
                    $query = $this->getQuery($request);
                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);

            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\Mail\Rbl' in method 'forVerification'.
            Open

                            if ($ips = \App\Mail\Rbl::findIp($ip, true)) {

            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 'request'.
            Open

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

            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 'toSend'.
            Open

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

            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\Json' in method 'whiteList'.
            Open

                    echo \App\Json::encode($result);

            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 '312', column '36').
            Open

                private function getQuery(App\Request $request): App\Db\Query
                {
                    $columns = [];
                    foreach ($request->getArray('columns') as $key => $value) {
                        $columns[$key] = $value['data'];

            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

            Define a constant instead of duplicating this literal "content-type: text/json; charset=UTF-8" 6 times.
            Open

                    header('content-type: text/json; charset=UTF-8');

            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 "recipient" 3 times.
            Open

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

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

                    $requestQuery = (new \App\Db\Query())->from('s_#__mail_rbl_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.

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

                    $this->exposeMethod('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.

            Define a constant instead of duplicating this literal "s_#__mail_rbl_list" 4 times.
            Open

                    $listQuery = (new \App\Db\Query())->from('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 "admin" 6 times.
            Open

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

            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 "iTotalDisplayRecords" 6 times.
            Open

                        'iTotalDisplayRecords' => $count,

            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 "Settings:MailRbl" 12 times.
            Open

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

            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 "comment" 3 times.
            Open

                    $query->from('s_#__mail_rbl_list')->select(['ip', 'status', 'type', 'comment'])->andWhere(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_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 "aaData" 6 times.
            Open

                        'aaData' => $rows,

            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 "iTotalRecords" 6 times.
            Open

                        'iTotalRecords' => $query->where(['status' => 0])->count(),

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

                            'statusId' => $row['status'],

            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 "header" 3 times.
            Open

                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);

            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 "label" 9 times.
            Open

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

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

                        'forVerification' => $requestQuery->where(['status' => 0])->count(),

            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 "datetime" 10 times.
            Open

                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);

            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 "Integer" 3 times.
            Open

                    if (!$request->isEmpty('type') && ($type = $request->getArray('type', 'Integer'))) {

            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 "sender" 3 times.
            Open

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

            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.

            Avoid unused parameters such as '$request'.
            Open

                public function counters(App\Request $request)

            UnusedFormalParameter

            Since: 0.2

            Avoid passing parameters to methods or constructors and then not using those parameters.

            Example

            class Foo
            {
                private function bar($howdy)
                {
                    // $howdy is not used
                }
            }

            Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);

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

                    $count = $query->count();

            Call to method getHeaderValue from undeclared class \ZBateson\MailMimeParser\Message
            Open

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

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

                        $query->andWhere(['type' => $type]);

            Call to method read from undeclared class \yii\db\DataReader
            Open

                    while ($row = $dataReader->read()) {

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

                    $count = $query->count();

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

                        'iTotalRecords' => $query->where(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_LIST]])->count(),

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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                    $query->from('s_#__mail_rbl_list')->andWhere(['type' => \App\Mail\Rbl::LIST_TYPE_BLACK_LIST]);

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

                        $query->orderBy([$columns[$order['column']] => 'asc' === $order['dir'] ? \SORT_ASC : \SORT_DESC]);

            Call to method getHeaderValue from undeclared class \ZBateson\MailMimeParser\Message
            Open

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                        'iTotalRecords' => $query->where(['status' => 0])->count(),

            Call to method read from undeclared class \yii\db\DataReader
            Open

                    while ($row = $dataReader->read()) {

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

                    $query->from('s_#__mail_rbl_list')->andWhere(['type' => \App\Mail\Rbl::LIST_TYPE_WHITE_LIST]);

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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                    $query->andWhere(['status' => 0]);

            Call to method getUserLabel from undeclared class \App\Fields\Owner
            Open

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                    $count = $query->count();

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

                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);

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

                    $count = $query->count();

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

                        $query->andWhere(['ip' => $ip]);

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

                    $query->andWhere(['status' => 1]);

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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                    $query->from('s_#__mail_rbl_list')->select(['ip', 'status', 'type', 'comment'])->andWhere(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_LIST]]);

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

                    $listQuery = (new \App\Db\Query())->from('s_#__mail_rbl_list');

            Call to method getHeaderValue from undeclared class \ZBateson\MailMimeParser\Message
            Open

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

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

                        'iTotalRecords' => $query->where(['status' => 1])->count(),

            Call to method getHeaderValue from undeclared class \ZBateson\MailMimeParser\Message
            Open

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

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

                        'iTotalRecords' => $query->where(null)->count(),

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

                    $query->from('s_#__mail_rbl_request')->select(['id', 'status', 'type', 'datetime', 'user', 'header', 'body']);

            Call to method read from undeclared class \yii\db\DataReader
            Open

                    while ($row = $dataReader->read()) {

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

                    $query->limit(null)->offset(null)->orderBy(null);

            Call to method read from undeclared class \yii\db\DataReader
            Open

                    while ($row = $dataReader->read()) {

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

                    $query->offset($request->getInteger('start'));

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

                        $query->andWhere(['status' => $status]);

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

                        $query->andWhere(['user' => $users]);

            Call to method read from undeclared class \yii\db\DataReader
            Open

                    while ($row = $dataReader->read()) {

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

                    $count = $query->count();

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

                    $requestQuery = (new \App\Db\Query())->from('s_#__mail_rbl_request');

            Call to method getUserLabel from undeclared class \App\Fields\Owner
            Open

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

            Call to method getHeaderValue from undeclared class \ZBateson\MailMimeParser\Message
            Open

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

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

                    $count = $query->count();

            Call to method getUserLabel from undeclared class \App\Fields\Owner
            Open

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

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

                    $query->limit($request->getInteger('length'));

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

                        $query->andWhere(['between', 'datetime', $date[0] . ' 00:00:00', $date[1] . ' 23:59:59']);

            Call to method read from undeclared class \yii\db\DataReader
            Open

                    while ($row = $dataReader->read()) {

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

                        'iTotalRecords' => $query->where(['type' => \App\Mail\Rbl::LIST_TYPE_BLACK_LIST])->count(),

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

                        'iTotalRecords' => $query->where(['type' => \App\Mail\Rbl::LIST_TYPE_WHITE_LIST])->count(),

            Call to method getHeaderValue from undeclared class \ZBateson\MailMimeParser\Message
            Open

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                public function blackList(App\Request $request)
                {
                    $rows = [];
                    $query = $this->getQuery($request);
                    $query->from('s_#__mail_rbl_list')->andWhere(['type' => \App\Mail\Rbl::LIST_TYPE_BLACK_LIST]);
            Severity: Major
            Found in modules/Settings/MailRbl/actions/GetData.php and 1 other location - About 1 day to fix
            modules/Settings/MailRbl/actions/GetData.php on lines 225..251

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 297.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                public function whiteList(App\Request $request)
                {
                    $rows = [];
                    $query = $this->getQuery($request);
                    $query->from('s_#__mail_rbl_list')->andWhere(['type' => \App\Mail\Rbl::LIST_TYPE_WHITE_LIST]);
            Severity: Major
            Found in modules/Settings/MailRbl/actions/GetData.php and 1 other location - About 1 day to fix
            modules/Settings/MailRbl/actions/GetData.php on lines 192..218

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 297.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                        if ($ip = ($mailRbl->getSender()['ip'] ?? '')) {
                            $icon = '';
                            if ($ips = \App\Mail\Rbl::findIp($ip, true)) {
                                $type = \App\Mail\Rbl::LIST_TYPES[$ips[0]['type']];
                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';
            Severity: Major
            Found in modules/Settings/MailRbl/actions/GetData.php and 1 other location - About 3 hrs to fix
            modules/Settings/MailRbl/actions/GetData.php on lines 155..162

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 144.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                        if ($ip = ($mailRbl->getSender()['ip'] ?? '')) {
                            $icon = '';
                            if ($ips = \App\Mail\Rbl::findIp($ip, true)) {
                                $type = \App\Mail\Rbl::LIST_TYPES[$ips[0]['type']];
                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';
            Severity: Major
            Found in modules/Settings/MailRbl/actions/GetData.php and 1 other location - About 3 hrs to fix
            modules/Settings/MailRbl/actions/GetData.php on lines 71..78

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 144.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            class Settings_MailRbl_GetData_Action extends \App\Controller\Action

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

                    if (!$request->isEmpty('ip') && ($ip = $request->getByType('ip', 'ip'))) {

            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_GetData_Action is not named in CamelCase.
            Open

            class Settings_MailRbl_GetData_Action extends \App\Controller\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

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

                        if ($ip = ($mailRbl->getSender()['ip'] ?? '')) {

            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

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

                        if ($ip = ($mailRbl->getSender()['ip'] ?? '')) {

            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

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

                    $this->exposeMethod('request');

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

                    $this->exposeMethod('blackList');

            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

                    $requestQuery = (new \App\Db\Query())->from('s_#__mail_rbl_request');

            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

                    $this->exposeMethod('forVerification');

            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

                    $this->exposeMethod('whiteList');

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

                    $this->exposeMethod('counters');

            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

                    $this->exposeMethod('publicRbl');

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

                }

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

                    $query = $this->getQuery($request);

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

                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);

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

                    while ($row = $dataReader->read()) {

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

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

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

                    }

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

                        $mailRbl->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

                 */

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

                                $type = \App\Mail\Rbl::LIST_TYPES[$ips[0]['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

                            'ip' => $ip,

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

                public function counters(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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                    ];

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

                    $rows = [];

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

                    $query->limit(null)->offset(null)->orderBy(null);

            Line exceeds 120 characters; contains 253 characters
            Open

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

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

                        ];

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

                        'aaData' => $rows,

            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 blackList(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

                        'forVerification' => $requestQuery->where(['status' => 0])->count(),

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

                        'request' => $requestQuery->where(null)->count(),

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

                            if ($ips = \App\Mail\Rbl::findIp($ip, true)) {

            Line exceeds 120 characters; contains 253 characters
            Open

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

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

                 */

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

                    $count = $query->count();

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

                    header('content-type: text/json; charset=UTF-8');

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

                    }

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

                        'draw' => $request->getInteger('draw'),

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

                {

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

                 * Counters mode.

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

                        'publicRbl' => $listQuery->where(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_LIST]])->count(),

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

                        $type = \App\Mail\Rbl::LIST_TYPES[$row['type']];

            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

                        'iTotalRecords' => $query->where(['status' => 1])->count(),

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

                    $query = $this->getQuery($request);

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

                        $mailRbl->parse();

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

                            $ip = $icon . \App\Purifier::encodeHtml($ip);

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

                        'blackList' => $listQuery->where(['type' => \App\Mail\Rbl::LIST_TYPE_BLACK_LIST])->count(),

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

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

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

                        'iTotalDisplayRecords' => $count,

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

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

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

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

            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

                    $query->from('s_#__mail_rbl_request')->select(['id',  'type', 'datetime', 'user', 'header']);

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

                        'draw' => $request->getInteger('draw'),

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

                            'datetime' => \App\Fields\DateTime::formatToDisplay($row['datetime']),

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

                            'statusId' => $row['status'],

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

                        'iTotalDisplayRecords' => $count,

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

                /**

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

                        'toSend' => $requestQuery->where(['status' => 1])->count(),

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

                    $rows = [];

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

                    $query->andWhere(['status' => 0]);

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

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

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

                            $icon = '';

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

                        $rows[] = [

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

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

            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

                    $query = $this->getQuery($request);

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

                    while ($row = $dataReader->read()) {

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

                    $query->andWhere(['status' => 1]);

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

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

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

                            'id' => $row['id'],

            Line exceeds 120 characters; contains 136 characters
            Open

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

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

                    }

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

                    echo \App\Json::encode($result);

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

                    $result = [

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

                 * Black list mode.

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

                            'id' => $row['id'],

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

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

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

                 *

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

                        'iTotalRecords' => $query->where(null)->count(),

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

                    header('content-type: text/json; charset=UTF-8');

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

                        'whiteList' => $listQuery->where(['type' => \App\Mail\Rbl::LIST_TYPE_WHITE_LIST])->count(),

            Line exceeds 120 characters; contains 156 characters
            Open

                        'publicRbl' => $listQuery->where(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_LIST]])->count(),

            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 ($ip = ($mailRbl->getSender()['ip'] ?? '')) {

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

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

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

                public function toSend(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

                        'aaData' => $rows,

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

                 * Request mode.

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

                                $icon = "<span class=\"{$type['icon']} mr-2 u-cursor-pointer\" title=\"" . \App\Language::translate('LBL_IP_ALREADY_EXISTS_LIST', 'Settings:MailRbl') . ' ' . \App\Language::translate($type['label'], 'Settings:MailRbl') . '"></span>';

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

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

            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

                    $listQuery = (new \App\Db\Query())->from('s_#__mail_rbl_list');

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

                        $rows[] = [

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

                            'datetime' => \App\Fields\DateTime::formatToDisplay($row['datetime']),

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

                            'recipient' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('to')),

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

                    $rows = [];

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

                            $icon = '';

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

                            if ($ips = \App\Mail\Rbl::findIp($ip, 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

                /**

            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

                        $mailRbl = \App\Mail\Rbl::getInstance($row);

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

                            'sender' => \App\Purifier::encodeHtml($mailRbl->mailMimeParser->getHeaderValue('from')),

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

                        $mailRbl = \App\Mail\Rbl::getInstance($row);

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

                        if ($ip = ($mailRbl->getSender()['ip'] ?? '')) {

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

                    $result = [

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

                    $response->emit();

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

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

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

                        $mailRbl->parse();

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

                    echo \App\Json::encode($result);

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

                }

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

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

            Line exceeds 120 characters; contains 136 characters
            Open

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

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

                    ];

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

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

            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

                            'datetime' => \App\Fields\DateTime::formatToDisplay($row['datetime']),

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

                    $count = $query->count();

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

                        'iTotalRecords' => $query->where(['status' => 0])->count(),

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

                            'ip' => \App\Purifier::encodeHtml($mailRbl->getSender()['ip'] ?? ''),

            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

                        $type = \App\Mail\Rbl::LIST_TYPES[$row['type']];

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

                 * For verification mode.

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

                public function forVerification(App\Request $request)

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

                                $type = \App\Mail\Rbl::LIST_TYPES[$ips[0]['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

                            $ip = $icon . \App\Purifier::encodeHtml($ip);

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

                    $result = [

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

                    header('content-type: text/json; charset=UTF-8');

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

                        'iTotalDisplayRecords' => $count,

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

                }

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

                /**

            Line exceeds 120 characters; contains 142 characters
            Open

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

            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

                        $mailRbl = \App\Mail\Rbl::getInstance($row);

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

                            'id' => $row['id'],

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

                            'ip' => $ip,

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

                        'draw' => $request->getInteger('draw'),

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

                        'aaData' => $rows,

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

                 * To send mode.

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

                    echo \App\Json::encode($result);

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

                public function request(App\Request $request)

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

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

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

                        $rows[] = [

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

                    $count = $query->count();

            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

                /** {@inheritdoc} */

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

                    $this->exposeMethod('toSend');

            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

                 */

            Line exceeds 120 characters; contains 136 characters
            Open

                            'type' => "<span class=\"{$type['icon']} mr-2\"></span>" . \App\Language::translate($type['label'], 'Settings:MailRbl'),

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

                        $type = \App\Mail\Rbl::LIST_TYPES[$row['type']];

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

                    $query->from('s_#__mail_rbl_request')->select(['id', 'status', 'type', 'datetime', 'user', 'header', 'body']);

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

                    while ($row = $dataReader->read()) {

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

                        $status = \App\Mail\Rbl::REQUEST_STATUS[$row['status']];

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

                            'user' => \App\Fields\Owner::getUserLabel($row['user']) ?: '',

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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                    $rows = [];

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

                            'id' => $row['id'],

            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

                            'statusId' => $row['status'],

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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                        'aaData' => $rows,

            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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                    $count = $query->count();

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

                    header('content-type: text/json; charset=UTF-8');

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

                 */

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

                    $query->limit(null)->offset(null)->orderBy(null);

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

                {

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

                            'id' => $row['id'],

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

                        'iTotalRecords' => $query->where(['type' => \App\Mail\Rbl::LIST_TYPE_WHITE_LIST])->count(),

            Line exceeds 120 characters; contains 171 characters
            Open

                            'type' => \App\Language::translate((\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST == $row['type'] ? 'LBL_BLACK_LIST' : 'LBL_WHITE_LIST'), 'Settings:MailRbl'),

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

                    if (!$request->isEmpty('type') && ($type = $request->getArray('type', 'Integer'))) {

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

                    }

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

                            'request' => $row['request'],

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

                 * White list mode.

            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 RBL mode.

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

                    $query->from('s_#__mail_rbl_list')->select(['ip', 'status', 'type', 'comment'])->andWhere(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_LIST]]);

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

                        'iTotalRecords' => $query->where(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_LIST]])->count(),

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

                    if ($order && isset($columns[$order['column']])) {

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

                 *

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

                    $query->limit($request->getInteger('length'));

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

                        $query->orderBy([$columns[$order['column']] => 'asc' === $order['dir'] ? \SORT_ASC : \SORT_DESC]);

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

                        $query->andWhere(['type' => $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

                    header('content-type: text/json; charset=UTF-8');

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

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

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

                    while ($row = $dataReader->read()) {

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

                        $status = \App\Mail\Rbl::LIST_STATUS[$row['status']];

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

                            'request' => $row['request'],

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

                    while ($row = $dataReader->read()) {

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

                            'statusId' => $row['status'],

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

                    foreach ($request->getArray('columns') as $key => $value) {

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

                    $query = (new \App\Db\Query());

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

                    if (!$request->isEmpty('ip') && ($ip = $request->getByType('ip', 'ip'))) {

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

                        $status = \App\Mail\Rbl::LIST_STATUS[$row['status']];

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

                            'ip' => $row['ip'],

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

                    $query->from('s_#__mail_rbl_list')->andWhere(['type' => \App\Mail\Rbl::LIST_TYPE_WHITE_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

                public function publicRbl(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

                        $status = \App\Mail\Rbl::LIST_STATUS[$row['status']];

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

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

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

                    $columns = [];

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

                    }

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

                    }

            Line exceeds 120 characters; contains 142 characters
            Open

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

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

                            'ip' => $row['ip'],

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

                        'iTotalDisplayRecords' => $count,

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

                    $query = $this->getQuery($request);

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

                        'draw' => $request->getInteger('draw'),

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

                 * @return App\Db\Query

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

                    if (!$request->isEmpty('status') && ($status = $request->getArray('status', 'Integer'))) {

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

                        $query->andWhere(['ip' => $ip]);

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

                    while ($row = $dataReader->read()) {

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

                        'aaData' => $rows,

            Line exceeds 120 characters; contains 142 characters
            Open

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

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

                    echo \App\Json::encode($result);

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

                    $rows = [];

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

                        $rows[] = [

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

                        'iTotalDisplayRecords' => $count,

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

                    $order = current($request->getArray('order', 'Alnum'));

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

                        $query->andWhere(['between', 'datetime', $date[0] . ' 00:00:00', $date[1] . ' 23:59:59']);

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

                    return $query;

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

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

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

                    }

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

                    $count = $query->count();

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

                    $rows = [];

            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' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

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

                    ];

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

                    header('content-type: text/json; charset=UTF-8');

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

                    echo \App\Json::encode($result);

            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

                    $query->offset($request->getInteger('start'));

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

                    echo \App\Json::encode($result);

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

                    $dataReader = $query->createCommand(\App\Db::getInstance('admin'))->query();

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

                            'ip' => $row['ip'],

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

                    $result = [

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

                 * Get query.

            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

                private function getQuery(App\Request $request): App\Db\Query

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

                    if (!$request->isEmpty('date') && ($date = $request->getDateRange('date'))) {

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

                        $query->andWhere(['user' => $users]);

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

                    $query->from('s_#__mail_rbl_list')->andWhere(['type' => \App\Mail\Rbl::LIST_TYPE_BLACK_LIST]);

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

                            'statusId' => $row['status'],

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

                        'iTotalRecords' => $query->where(['type' => \App\Mail\Rbl::LIST_TYPE_BLACK_LIST])->count(),

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

                    $result = [

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

                /**

            Line exceeds 120 characters; contains 200 characters
            Open

                    $query->from('s_#__mail_rbl_list')->select(['ip', 'status', 'type', 'comment'])->andWhere(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_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

                        $columns[$key] = $value['data'];

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

                        $query->andWhere(['status' => $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

                        ];

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

                    $result = [

            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

                        'draw' => $request->getInteger('draw'),

            Line exceeds 120 characters; contains 142 characters
            Open

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

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

                            'comment' => \App\Layout::truncateText($row['comment'], 30),

            Line exceeds 120 characters; contains 156 characters
            Open

                        'iTotalRecords' => $query->where(['type' => [\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST, \App\Mail\Rbl::LIST_TYPE_PUBLIC_WHITE_LIST]])->count(),

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

                /**

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

                        $rows[] = [

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

                            'status' => "<span class=\"{$status['icon']} mr-2\"></span>" . \App\Language::translate($status['label'], 'Settings:MailRbl'),

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

                        'draw' => $request->getInteger('draw'),

            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 whiteList(App\Request $request)

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

                        'aaData' => $rows,

            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

                    if (!$request->isEmpty('users') && ($users = $request->getArray('users', 'Integer'))) {

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

                    $query = $this->getQuery($request);

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

                        'iTotalDisplayRecords' => $count,

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

                    $query = $this->getQuery($request);

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

                        $rows[] = [

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

                    $count = $query->count();

            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

                            'type' => \App\Language::translate((\App\Mail\Rbl::LIST_TYPE_PUBLIC_BLACK_LIST == $row['type'] ? 'LBL_BLACK_LIST' : 'LBL_WHITE_LIST'), 'Settings:MailRbl'),

            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

                    }

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

            class Settings_MailRbl_GetData_Action extends \App\Controller\Action

            There are no issues that match your filters.

            Category
            Status