YetiForceCompany/YetiForceCRM

View on GitHub
app/Controller/Components/Action/InterestsConflict.php

Summary

Maintainability
D
2 days
Test Coverage
F
0%

The class InterestsConflict has an overall complexity of 60 which is very high. The configured complexity threshold is 50.
Open

class InterestsConflict extends \App\Controller\Action
{
    use \App\Controller\ExposeMethod;

    /** {@inheritdoc} */

Method getConfirmResponse has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getConfirmResponse(\App\Request $request): array
    {
        $queries = [
            'base' => $this->getConfirmQuery($request, 'u'),
        ];
Severity: Major
Found in app/Controller/Components/Action/InterestsConflict.php - About 2 hrs to fix

    Method getUnlockResponse has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getUnlockResponse(\App\Request $request): array
        {
            $query = $this->getUnlockQuery($request);
            $dataReader = $query->createCommand()->query();
            $rows = [];
    Severity: Minor
    Found in app/Controller/Components/Action/InterestsConflict.php - About 1 hr to fix

      Function getConfirmResponse has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getConfirmResponse(\App\Request $request): array
          {
              $queries = [
                  'base' => $this->getConfirmQuery($request, 'u'),
              ];
      Severity: Minor
      Found in app/Controller/Components/Action/InterestsConflict.php - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method getConfirmQuery has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
          {
              $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
              $columns = [];
              foreach ($request->getArray('columns') as $key => $value) {
      Severity: Minor
      Found in app/Controller/Components/Action/InterestsConflict.php - About 1 hr to fix

        Function getUnlockResponse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getUnlockResponse(\App\Request $request): array
            {
                $query = $this->getUnlockQuery($request);
                $dataReader = $query->createCommand()->query();
                $rows = [];
        Severity: Minor
        Found in app/Controller/Components/Action/InterestsConflict.php - About 45 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 checkPermission has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function checkPermission(\App\Request $request)
            {
                switch ($request->getMode()) {
                    case 'getUnlock':
                    case 'updateUnlockStatus':
        Severity: Minor
        Found in app/Controller/Components/Action/InterestsConflict.php - About 45 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 getUnlockQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getUnlockQuery(\App\Request $request): \App\Db\Query
            {
                $columns = [];
                foreach ($request->getArray('columns') as $key => $value) {
                    $columns[$key] = $value['data'];
        Severity: Minor
        Found in app/Controller/Components/Action/InterestsConflict.php - About 35 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 getConfirmQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
            {
                $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
                $columns = [];
                foreach ($request->getArray('columns') as $key => $value) {
        Severity: Minor
        Found in app/Controller/Components/Action/InterestsConflict.php - About 35 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 getConfirmQuery() has an NPath complexity of 1296. The configured NPath complexity threshold is 200.
        Open

            public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
            {
                $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
                $columns = [];
                foreach ($request->getArray('columns') as $key => $value) {

        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 getConfirmResponse() has an NPath complexity of 216. The configured NPath complexity threshold is 200.
        Open

            public function getConfirmResponse(\App\Request $request): array
            {
                $queries = [
                    'base' => $this->getConfirmQuery($request, 'u'),
                ];

        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 getUnlockQuery() has an NPath complexity of 648. The configured NPath complexity threshold is 200.
        Open

            public function getUnlockQuery(\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 getConfirmQuery() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
        Open

            public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
            {
                $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
                $columns = [];
                foreach ($request->getArray('columns') as $key => $value) {

        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

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

            public function getConfirmResponse(\App\Request $request): array
            {
                $queries = [
                    'base' => $this->getConfirmQuery($request, 'u'),
                ];

        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

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

            public function getUnlockQuery(\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

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

            public function getConfirmResponse(\App\Request $request): array

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

        See

        The class InterestsConflict has a coupling between objects value of 17. Consider to reduce the number of dependencies under 13.
        Open

        class InterestsConflict extends \App\Controller\Action
        {
            use \App\Controller\ExposeMethod;
        
            /** {@inheritdoc} */

        CouplingBetweenObjects

        Since: 1.1.0

        A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

        Example

        class Foo {
            /**
             * @var \foo\bar\X
             */
            private $x = null;
        
            /**
             * @var \foo\bar\Y
             */
            private $y = null;
        
            /**
             * @var \foo\bar\Z
             */
            private $z = null;
        
            public function setFoo(\Foo $foo) {}
            public function setBar(\Bar $bar) {}
            public function setBaz(\Baz $baz) {}
        
            /**
             * @return \SplObjectStorage
             * @throws \OutOfRangeException
             * @throws \InvalidArgumentException
             * @throws \ErrorException
             */
            public function process(\Iterator $it) {}
        
            // ...
        }

        Source https://phpmd.org/rules/design.html#couplingbetweenobjects

        Missing class import via use statement (line '45', column '16').
        Open

                            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');

        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 '39', column '16').
        Open

                            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');

        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 '105', column '19').
        Open

                $response = new \Vtiger_Response();

        MissingImport

        Since: 2.7.0

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

        Example

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

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

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

                $query = (new \App\Db\Query())->from('u_#__interests_conflict_unlock');

        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 '154', column '28').
        Open

                    'iTotalRecords' => (new \App\Db\Query())->from('u_#__interests_conflict_unlock')->count(),

        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 '49', column '15').
        Open

                        throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');

        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 '91', column '19').
        Open

                $response = new \Vtiger_Response();

        MissingImport

        Since: 2.7.0

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

        Example

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

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

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

                $query = (new \App\Db\Query())->from($table);

        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 using static access to class '\App\Json' in method 'getConfirm'.
        Open

                echo \App\Json::encode($this->getConfirmResponse($request));

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

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

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

                        $info .= \App\Language::translate('Last Modified By') . ': ' . $row['modify_user'] . '<br>';

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

                    $row['info'] = \App\Purifier::encodeHtml($info);

        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 '183', column '39').
        Open

            public function getUnlockQuery(\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\Record' in method 'getConfirmResponse'.
        Open

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

        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 '288', column '39').
        Open

            public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
            {
                $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
                $columns = [];
                foreach ($request->getArray('columns') as $key => $value) {

        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\Record' in method 'getUnlockResponse'.
        Open

                \App\Record::getLabel($ids);

        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\Config' in method 'getUnlockResponse'.
        Open

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

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

            public function getUnlockQuery(\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\Fields\DateTime' in method 'getConfirmResponse'.
        Open

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

        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 '\vtlib\Functions' in method 'getConfirmResponse'.
        Open

                \vtlib\Functions::getCRMRecordMetadata($ids);

        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\Components\InterestsConflict' in method 'updateConfirmStatus'.
        Open

                \App\Components\InterestsConflict::setCancel($request->getInteger('id'), $request->getInteger('baseRecord'), $request->getByType('comment', 'Text'));

        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 '189', column '41').
        Open

            public function getUnlockQuery(\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\Fields\Owner' in method 'getConfirmResponse'.
        Open

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

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

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

        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\Components\InterestsConflict' in method 'updateUnlockStatus'.
        Open

                \App\Components\InterestsConflict::updateUnlockStatus($request->getInteger('id'), $request->getInteger('status'));

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

                        'comment' => \App\Layout::truncateText($row['comment'], 40, true, 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 assigning values to variables in if clauses and the like (line '285', column '38').
        Open

            public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
            {
                $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
                $columns = [];
                foreach ($request->getArray('columns') as $key => $value) {

        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 '294', column '41').
        Open

            public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
            {
                $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
                $columns = [];
                foreach ($request->getArray('columns') as $key => $value) {

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

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

        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\Record' in method 'getUnlockResponse'.
        Open

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

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

                    $dataReader = $query->createCommand(\App\Db::getInstance($dbType))->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\Record' in method 'getConfirmResponse'.
        Open

                    $row['related'] = \App\Record::getHtmlLink($row['related_id'], null, \App\Config::main('href_max_length'));

        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\Config' in method 'getConfirmResponse'.
        Open

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

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

                        $info .= \App\Language::translate('Last Modified By') . ': ' . $row['modify_user'] . '<br>';

        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\Record' in method 'getConfirmResponse'.
        Open

                \App\Record::getLabel($ids);

        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\User' in method 'checkPermission'.
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$confirmUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

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

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

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

                    $row['info'] = \App\Purifier::encodeHtml($info);

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

                    $filter += $query->count('id', \App\Db::getInstance($dbType));

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

            public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query
            {
                $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';
                $columns = [];
                foreach ($request->getArray('columns') as $key => $value) {

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

                echo \App\Json::encode($this->getUnlockResponse($request));

        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 '\vtlib\Functions' in method 'getUnlockResponse'.
        Open

                \vtlib\Functions::getCRMRecordMetadata($ids);

        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\User' in method 'checkPermission'.
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$unlockUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

        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\Record' in method 'getUnlockResponse'.
        Open

                    $row['related'] = \App\Record::getHtmlLink($row['related'], null, \App\Config::main('href_max_length'));

        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\Config' in method 'getConfirmResponse'.
        Open

                    $row['related'] = \App\Record::getHtmlLink($row['related_id'], null, \App\Config::main('href_max_length'));

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

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

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

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

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

                        $info .= \App\Language::translate('Modified Time') . ': ' . $row['modify_date_time'];

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

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

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

                    $all += $queryAll->count('id', \App\Db::getInstance($dbType));

        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\Config' in method 'getUnlockResponse'.
        Open

                    $row['related'] = \App\Record::getHtmlLink($row['related'], null, \App\Config::main('href_max_length'));

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

                        $info .= \App\Language::translate('Modified Time') . ': ' . $row['modify_date_time'];

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

            public function getUnlockQuery(\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\Fields\DateTime' in method 'getUnlockResponse'.
        Open

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

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                    $row['related'] = \App\Record::getHtmlLink($row['related'], null, \App\Config::main('href_max_length'));

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

                \App\Components\InterestsConflict::updateUnlockStatus($request->getInteger('id'), $request->getInteger('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 "related" 10 times.
        Open

                        'related' => $row['related_id'],

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

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

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

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

        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

                \App\Components\InterestsConflict::setCancel($request->getInteger('id'), $request->getInteger('baseRecord'), $request->getByType('comment', 'Text'));

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

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

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

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

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

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

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

                            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');

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

                if (!$request->isEmpty('users') && ($users = $request->getArray('users', '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 "Integer" 4 times.
        Open

                if (!$request->isEmpty('users') && ($users = $request->getArray('users', '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 "modify_user_id" 4 times.
        Open

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

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

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

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

                        'related' => $row['related_id'],

        Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

        On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

        Noncompliant Code Example

        With the default threshold of 3:

        function run() {
          prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
          execute('action1');
          release('action1');
        }
        

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

        To prevent generating some false-positives, literals having less than 5 characters are excluded.

        Call to method updateUnlockStatus from undeclared class \App\Components\InterestsConflict (Did you mean class \App\Controller\Components\Action\InterestsConflict or class \App\Controller\Components\View\InterestsConflict)
        Open

                \App\Components\InterestsConflict::updateUnlockStatus($request->getInteger('id'), $request->getInteger('status'));

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

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

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

                    $filter += $query->count('id', \App\Db::getInstance($dbType));

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

                $query = (new \App\Db\Query())->from($table);

        Call to method setCancel from undeclared class \App\Components\InterestsConflict (Did you mean class \App\Controller\Components\Action\InterestsConflict or class \App\Controller\Components\View\InterestsConflict)
        Open

                \App\Components\InterestsConflict::setCancel($request->getInteger('id'), $request->getInteger('baseRecord'), $request->getByType('comment', 'Text'));

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

                    'iTotalDisplayRecords' => $query->count(),

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

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

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

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

        Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$unlockUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

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

                $query = (new \App\Db\Query())->from('u_#__interests_conflict_unlock');

        Reference to static property unlockUsersAccess from undeclared class \Config\Components\InterestsConflict
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$unlockUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

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

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

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

                    'iTotalRecords' => (new \App\Db\Query())->from('u_#__interests_conflict_unlock')->count(),

        Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$unlockUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

        Reference to static property confirmUsersAccess from undeclared class \Config\Components\InterestsConflict
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$confirmUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

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

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

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

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

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

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

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

                    $queryAll->where([]);

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

                    $all += $queryAll->count('id', \App\Db::getInstance($dbType));

        Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$confirmUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

        Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$confirmUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

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

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

        Remove the code after this "throw".
        Open

                        throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');

        Jump statements (return, break, continue, and goto) and throw expressions move control flow out of the current code block. Typically, any statements in a block that come after a jump or throw are simply wasted keystrokes lying in wait to confuse the unwary.

        Rarely, as illustrated below, code after a jump or throw is reachable. However, such code is difficult to understand, and should be refactored.

        Noncompliant Code Example

        function fun($a) {
          $i = 10;
          return $i + $a;
          $i++;             // this is never executed
        }
        
        function foo($a) {
          if ($a == 5) {
            goto error;
          } else {
            // do the job
          }
          return;
        
          error:
            printf("don't use 5"); // this is reachable but unreadable
        
        }
        

        Compliant Solution

        function fun($a) {
          $i = 10;
          return $i + $a;
        }
        
        function foo($a) {
          if ($a == 5) {
            handleError();
          } else {
            // do the job
          }
          return;
        }
        

        See

        • MISRA C:2004, 14.1 - There shall be no unreachable code
        • MISRA C++:2008, 0-1-1 - A project shall not contain unreachable code
        • MISRA C++:2008, 0-1-9 - There shall be no dead code
        • MISRA C:2012, 2.1 - A project shall not contain unreachable code
        • MISRA C:2012, 2.2 - There shall be no dead code
        • MITRE, CWE-561 - Dead Code
        • CERT, MSC56-J. - Detect and remove superfluous code and values
        • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
        • CERT, MSC07-CPP. - Detect and remove dead code

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

                foreach ($rows as &$row) {
                    $row['related'] = \App\Record::getHtmlLink($row['related'], null, \App\Config::main('href_max_length'));
                    $info = '';
                    if ($row['source_id']) {
                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';
        Severity: Major
        Found in app/Controller/Components/Action/InterestsConflict.php and 1 other location - About 6 hrs to fix
        app/Controller/Components/Action/InterestsConflict.php on lines 233..246

        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 205.

        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

                foreach ($rows as &$row) {
                    $row['related'] = \App\Record::getHtmlLink($row['related_id'], null, \App\Config::main('href_max_length'));
                    $info = '';
                    if ($row['source_id']) {
                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';
        Severity: Major
        Found in app/Controller/Components/Action/InterestsConflict.php and 1 other location - About 6 hrs to fix
        app/Controller/Components/Action/InterestsConflict.php on lines 137..150

        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 205.

        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

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

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$unlockUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

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

            public function checkPermission(\App\Request $request)

        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

             */

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

             *

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

                $ids = array_merge(array_column($rows, 'related'), array_column($rows, 'source_id'));

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

                    if ($row['modify_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

                    'iTotalRecords' => (new \App\Db\Query())->from('u_#__interests_conflict_unlock')->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

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

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

             * Get confirmations data.

        Line exceeds 120 characters; contains 122 characters
        Open

                \App\Components\InterestsConflict::updateUnlockStatus($request->getInteger('id'), $request->getInteger('status'));

        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

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

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

                \vtlib\Functions::getCRMRecordMetadata($ids);

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

                foreach ($rows as &$row) {

        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

            /** {@inheritdoc} */

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

             * Get unlock data.

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

             *

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

             * @return void

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

             * Save confirmations data.

        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

                    if ($row['modify_date_time']) {

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

                    case 'getUnlock':

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

            }

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

             * Get response.

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

                $dataReader = $query->createCommand()->query();

        Line exceeds 120 characters; contains 136 characters
        Open

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

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

                        $info .= \App\Language::translate('Last Modified By') . ': ' . $row['modify_user'] . '<br>';

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

                    }

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

                ];

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

            use \App\Controller\ExposeMethod;

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

             *

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

            {

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

             */

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

                    if ($row['source_id']) {

        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

            /** {@inheritdoc} */

        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 170 characters
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$unlockUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

        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

             * @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

                $columns = [];

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

                    $query->andWhere(['like', 'u_#__crmentity_label.label', "{$related}%", false]);

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

            {

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

                foreach ($rows as &$row) {

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

                    $row['related'] = \App\Record::getHtmlLink($row['related_id'], null, \App\Config::main('href_max_length'));

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

                    if ($row['source_id']) {

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

             * @param string       $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

                $this->exposeMethod('updateUnlockStatus');

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

                switch ($request->getMode()) {

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

                }

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

            {

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

             *

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

            }

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

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

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

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

        Line exceeds 120 characters; contains 177 characters
        Open

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

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

                    $row['info'] = \App\Purifier::encodeHtml($info);

        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' => $row['status'],

        Line exceeds 120 characters; contains 125 characters
        Open

                            'modify_user' => $row['modify_user_id'] ? \App\Fields\Owner::getUserLabel($row['modify_user_id']) : 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

             *

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

                return $query;

        Line exceeds 120 characters; contains 171 characters
        Open

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$confirmUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

        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

                        'modify_date_time' => $row['modify_date_time'] ? \App\Fields\DateTime::formatToDisplay($row['modify_date_time']) : 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

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

        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

             */

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

                }

        Line exceeds 120 characters; contains 128 characters
        Open

                    $query->innerJoin('u_#__crmentity_label', 'u_#__interests_conflict_unlock.related_id = u_#__crmentity_label.crmid');

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

             * @return array

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

                            'user' => \App\Fields\Owner::getUserLabel($row['user_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

            }

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

                    $query->andWhere(['or', ['like', 'related_label', "{$related}%", false], ['like', 'u_#__crmentity_label.label', "{$related}%", false]]);

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

                }

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

                        }

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

                        break;

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

                        break;

        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

             * @return void

        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

             * @return array

        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

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

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

                        $info .= \App\Language::translate('Modified Time') . ': ' . $row['modify_date_time'];

        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

                $rows = [];

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

            public function getConfirmQuery(\App\Request $request, string $type): \App\Db\Query

        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

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

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

                    $info = '';

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

                }

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

                }

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

                }

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

                }

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

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

        Line exceeds 120 characters; contains 177 characters
        Open

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

        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

                }

        Line exceeds 120 characters; contains 148 characters
        Open

                    $query->andWhere(['or', ['like', 'related_label', "{$related}%", false], ['like', 'u_#__crmentity_label.label', "{$related}%", false]]);

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

                $this->exposeMethod('getConfirm');

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

                    case 'getConfirm':

        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

                \App\Components\InterestsConflict::updateUnlockStatus($request->getInteger('id'), $request->getInteger('status'));

        Line exceeds 120 characters; contains 157 characters
        Open

                \App\Components\InterestsConflict::setCancel($request->getInteger('id'), $request->getInteger('baseRecord'), $request->getByType('comment', 'Text'));

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

             *

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

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

        Line exceeds 120 characters; contains 121 characters
        Open

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

        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

            public function getUnlockQuery(\App\Request $request): \App\Db\Query

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

                $query = (new \App\Db\Query())->from('u_#__interests_conflict_unlock');

        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

                \vtlib\Functions::getCRMRecordMetadata($ids);

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

                    $row['info'] = \App\Purifier::encodeHtml($info);

        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

                    $filter += $query->count('id', \App\Db::getInstance($dbType));

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

                    $all += $queryAll->count('id', \App\Db::getInstance($dbType));

        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

                            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');

        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

             * @return void

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

                    default:

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

                        break;

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

                return 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

                echo \App\Json::encode($this->getConfirmResponse($request));

        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

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

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

                \App\Components\InterestsConflict::setCancel($request->getInteger('id'), $request->getInteger('baseRecord'), $request->getByType('comment', 'Text'));

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

                    'iTotalDisplayRecords' => $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

             *

        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->orderBy([$columns[$order['column']] => 'asc' === $order['dir'] ? SORT_ASC : SORT_DESC]);

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

            public function getUnlockResponse(\App\Request $request): array

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

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

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

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

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

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

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

                $queries = [

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

                    $row['related'] = \App\Record::getHtmlLink($row['related'], null, \App\Config::main('href_max_length'));

        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

                    $info = '';

        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 ($row['modify_user']) {

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

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

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

                return [

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

                $ids = array_column($rows, 'related');

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

                    if ($row['modify_date_time']) {

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

            {

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

             * @return \App\Db\Query

        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

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

        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

                    case 'updateConfirmStatus':

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

                        if (!\in_array(\App\User::getCurrentUserId(), \Config\Components\InterestsConflict::$confirmUsersAccess) && !\App\User::getCurrentUserModel()->isAdmin()) {

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

                echo \App\Json::encode($this->getUnlockResponse($request));

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

            }

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

             */

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

            /**

        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

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

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

                        'related' => $row['related_id'],

        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

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

        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

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

        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

             *

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

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

        Line exceeds 120 characters; contains 140 characters
        Open

                            'modify_date_time' => $row['modify_date_time'] ? \App\Fields\DateTime::formatToDisplay($row['modify_date_time']) : 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

                    $queryAll->where([]);

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

            /**

        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

                parent::__construct();

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

                $this->exposeMethod('getUnlock');

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

                $this->exposeMethod('updateConfirmStatus');

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

                    case 'updateUnlockStatus':

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

                            throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');

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

                        throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');

        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

             * Save unlock data.

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

             * @return void

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

                $response = new \Vtiger_Response();

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

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

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

                \App\Record::getLabel($ids);

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

                return [

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

            }

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

            {

        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

                }

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

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

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

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

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

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

        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

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

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

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

        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

                $response->emit();

        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

                return $query;

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

                foreach ($queries as $dbType => $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

                        $info .= \App\Language::translate('Last Modified By') . ': ' . $row['modify_user'] . '<br>';

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

                foreach ($queries as $dbType => $query) {

        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

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

        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('status') && ($status = $request->getArray('status', '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

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

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

            }

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

                $all = $filter = 0;

        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

                if (!$request->isEmpty('users') && ($users = $request->getArray('users', '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

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

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

                    $query->innerJoin('u_#__crmentity_label', 'u_#__interests_conflict_unlock.related_id = u_#__crmentity_label.crmid');

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

                    $dataReader = $query->createCommand(\App\Db::getInstance($dbType))->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

                            'db' => $dbType,

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

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

        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

                    'iTotalRecords' => $all,

        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

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

        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->andWhere(['status' => $status]);

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

             * Get response.

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

                if ($request->getBoolean('showHistory')) {

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

                    $queries['log'] = $this->getConfirmQuery($request, 'b');

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

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

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

                \App\Record::getLabel($ids);

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

                    $queryAll = clone $query;

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

                $query = (new \App\Db\Query())->from($table);

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

                }

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

                    'base' => $this->getConfirmQuery($request, 'u'),

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

                $queries = array_reverse($queries);

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

                }

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

                        $info .= \App\Language::translate('LBL_SOURCE_RECORD') . ': ' . \App\Record::getHtmlLink($row['source_id'], null, \App\Config::main('href_max_length')) . '<br>';

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

                        $info .= \App\Language::translate('Modified Time') . ': ' . $row['modify_date_time'];

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

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

        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

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

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

            public function getConfirmResponse(\App\Request $request): array

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

                }

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

                    'iTotalDisplayRecords' => $filter,

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

                ];

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

                $table = 'u' === $type ? 'u_#__interests_conflict_conf' : 'b_#__interests_conflict_conf';

        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

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

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

                    $query->leftJoin('u_#__crmentity_label', $table . '.related_id = u_#__crmentity_label.crmid');

        There are no issues that match your filters.

        Category
        Status