YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/views/SendMailModal.php

Summary

Maintainability
C
7 hrs
Test Coverage
F
0%

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

    public function getQuery(App\Request $request)
    {
        $moduleName = $request->getModule();
        $sourceModule = $request->getByType('sourceModule', 2);
        if ($sourceModule) {
Severity: Major
Found in modules/Vtiger/views/SendMailModal.php - About 2 hrs to fix

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

        public function getQuery(App\Request $request)
        {
            $moduleName = $request->getModule();
            $sourceModule = $request->getByType('sourceModule', 2);
            if ($sourceModule) {
    Severity: Minor
    Found in modules/Vtiger/views/SendMailModal.php - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function getStatistics has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getStatistics(App\Request $request)
        {
            $dataReader = $this->getQuery($request)->createCommand()->query();
            $records = $duplicates = 0;
            $emails = $emailsByField = [];
    Severity: Minor
    Found in modules/Vtiger/views/SendMailModal.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

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

        public function getQuery(App\Request $request)
        {
            $moduleName = $request->getModule();
            $sourceModule = $request->getByType('sourceModule', 2);
            if ($sourceModule) {

    NPathComplexity

    Since: 0.1

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

    Example

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

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

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

        public function getQuery(App\Request $request)
        {
            $moduleName = $request->getModule();
            $sourceModule = $request->getByType('sourceModule', 2);
            if ($sourceModule) {

    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 19 to the 15 allowed.
    Open

        public function getQuery(App\Request $request)

    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

    Avoid using undefined variables such as '$sourceModules' which will lead to PHP notices.
    Open

            if ($sourceModule && isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$sourceModule])) {

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

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

    Avoid using undefined variables such as '$sourceModules' which will lead to PHP notices.
    Open

            if ($sourceModule && isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$sourceModule])) {

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

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

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

    class Vtiger_SendMailModal_View extends Vtiger_BasicModal_View
    {
        public $fields = [];
    
        /**

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

                throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

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

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                        } else {
                            $emails[$row[$fieldName]] = 0;
                        }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_ListView_Model' in method 'getQuery'.
    Open

                $listView = Vtiger_ListView_Model::getInstance($moduleName, $request->getByType('viewname', 2));

    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\Condition' in method 'getQuery'.
    Open

            $searchValue = App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $listView->getQueryGenerator()->getModule(), $searchKey, $operator);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                $templateList = App\Mail::getTemplateList($templateModule);

    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 'Vtiger_RelationListView_Model' in method 'getTemplateList'.
    Open

                $recordListModel = Vtiger_RelationListView_Model::getInstance($parentRecordModel, '', $relations['relation_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\Record' in method 'getTemplateList'.
    Open

                && \App\Record::isExists($request->getInteger('sourceRecord'))

    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\Condition' in method 'getQuery'.
    Open

                $listView->set('advancedConditions', \App\Condition::validAdvancedConditions($advancedConditions));

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $templateList = App\Mail::getTemplateList($templateModule);
            }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Privilege' in method 'checkPermission'.
    Open

            if (!$request->isEmpty('sourceRecord') && !\App\Privilege::isPermitted($request->getByType('sourceModule', 2), 'DetailView', $request->getInteger('sourceRecord'))) {

    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\Relation' in method 'getTemplateList'.
    Open

                && ($relations = \App\Relation::getByModule($request->getByType('sourceModule', \App\Purifier::ALNUM), true, 'EmailTemplates'))

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $listView->loadListViewCondition();
                $queryGenerator = $listView->getQueryGenerator();
            }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_Record_Model' in method 'getQuery'.
    Open

                $parentRecordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('sourceRecord'), $sourceModule);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $listView = Vtiger_ListView_Model::getInstance($moduleName, $request->getByType('viewname', 2));
            }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_RelationListView_Model' in method 'getQuery'.
    Open

                $listView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $moduleName, $request->getInteger('relationId'), $cvId);

    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 '176', column '8').
    Open

        public function getTemplateList(string $templateModule, App\Request $request): array
        {
            $templateList = [];
            if (!$request->isEmpty('sourceRecord', true)
                && \App\Record::isExists($request->getInteger('sourceRecord'))

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

            if (!\App\Config::component('Mail', 'showEmailsInMassMail')) {

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

        public function getQuery(App\Request $request)
        {
            $moduleName = $request->getModule();
            $sourceModule = $request->getByType('sourceModule', 2);
            if ($sourceModule) {

    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\Condition' in method 'getQuery'.
    Open

            $searchParams = App\Condition::validSearchParams($listView->getQueryGenerator()->getModule(), $request->getArray('search_params'));

    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 'Vtiger_Record_Model' in method 'getTemplateList'.
    Open

                $parentRecordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('sourceRecord'), $request->getByType('sourceModule', \App\Purifier::ALNUM));

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

            if ($advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : []) {

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

            if (!$request->isEmpty('sourceRecord') && !\App\Privilege::isPermitted($request->getByType('sourceModule', 2), 'DetailView', $request->getInteger('sourceRecord'))) {

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

            if (!$request->isEmpty('searchResult', true)) {

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "sourceModule" 5 times.
    Open

            if (!$request->isEmpty('sourceRecord') && !\App\Privilege::isPermitted($request->getByType('sourceModule', 2), 'DetailView', $request->getInteger('sourceRecord'))) {

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('TEMPLATE_MODULE', $templateModule);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('DUPLICATES', $duplicates);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

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

            while ($row = $dataReader->read()) {
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method getModuleModel from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $moduleModel = $queryGenerator->getModuleModel();
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Reference to static property sourceModules from undeclared class \App\TextParser
    Open

            if ($sourceModule && isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$sourceModule])) {
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('EMAILS_BY_FIELD', $emailsByField);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('EMAIL_LIST', $emails);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method getModule from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $searchValue = App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $listView->getQueryGenerator()->getModule(), $searchKey, $operator);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('TEMPLATE_LIST', $this->getTemplateList($templateModule, $request));
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->setFields(array_merge(['id'], array_keys($this->fields)));
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('RECORDS_NUMBER', $recordsNumber);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method addNativeCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

                $queryGenerator->addNativeCondition(['not in', "$baseTableName.$baseTableId" => $excluded]);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method all from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

                $templateList = $recordListModel->getRelationQuery()->all();
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method addNativeCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

                $queryGenerator->addNativeCondition(["$baseTableName.$baseTableId" => $selected]);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('FIELDS', $this->fields);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method getModule from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $searchParams = App\Condition::validSearchParams($listView->getQueryGenerator()->getModule(), $request->getArray('search_params'));
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method parseBaseSearchParamsToCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

                $transformedSearchParams = $listView->getQueryGenerator()->parseBaseSearchParamsToCondition($searchParams);
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

    Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            return $queryGenerator->createQuery();
    Severity: Critical
    Found in modules/Vtiger/views/SendMailModal.php by phan

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

            if ($sourceModule) {
                $cvId = $request->isEmpty('cvId', true) ? 0 : $request->getByType('cvId', 'Alnum');
                $parentRecordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('sourceRecord'), $sourceModule);
                $listView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $moduleName, $request->getInteger('relationId'), $cvId);
            } else {
    Severity: Major
    Found in modules/Vtiger/views/SendMailModal.php and 1 other location - About 1 hr to fix
    modules/Vtiger/actions/Mail.php on lines 127..133

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

    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

    Avoid excessively long variable names like $transformedSearchParams. Keep variable name length under 20.
    Open

                $transformedSearchParams = $listView->getQueryGenerator()->parseBaseSearchParamsToCondition($searchParams);

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

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

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

    class Vtiger_SendMailModal_View extends Vtiger_BasicModal_View

    The class Vtiger_SendMailModal_View is not named in CamelCase.
    Open

    class Vtiger_SendMailModal_View extends Vtiger_BasicModal_View
    {
        public $fields = [];
    
        /**

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

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

         *

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

                $templateModule = $sourceModule;

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

            [$recordsNumber, $duplicates, $emailsByField, $emails] = $this->getStatistics($request);

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

            $viewer->assign('TEMPLATE_LIST', $this->getTemplateList($templateModule, $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

            $records = $duplicates = 0;

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

            foreach ($fieldsName as $fieldName) {

    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

            $sourceModule = $request->getByType('sourceModule', 2);

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

                foreach ($fieldsName as $fieldName) {

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

                        ++$emailsByField[$fieldName];

    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('searchResult', true)) {

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

                $listView->set('search_params', $transformedSearchParams);

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

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

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

            } else {

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

                $templateList = App\Mail::getTemplateList($templateModule);

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

        public function getSize(App\Request $request)

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

            $this->preProcess($request);

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

            $viewer->assign('RECORDS_NUMBER', $recordsNumber);

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

                ++$records;

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

                        } else {

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

                            $emails[$row[$fieldName]] = 0;

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

            }

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

                $listView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $moduleName, $request->getInteger('relationId'), $cvId);

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

                $listView = Vtiger_ListView_Model::getInstance($moduleName, $request->getByType('viewname', 2));

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

                $listView->loadListViewCondition();

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

                && \App\Record::isExists($request->getInteger('sourceRecord'))

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

            return $templateList;

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

         * @throws \App\Exceptions\NoPermittedToRecord

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

            $viewer = $this->getViewer($request);

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

            $viewer->assign('EMAILS_BY_FIELD', $emailsByField);

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

            $this->postProcess($request);

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

                        if (isset($emails[$row[$fieldName]])) {

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

                            ++$duplicates;

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

            return [$records, $duplicates, $emailsByField, $emails];

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

            $operator = $request->getByType('operator');

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

            $searchValue = App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $listView->getQueryGenerator()->getModule(), $searchKey, $operator);

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

                if ($fieldModel->isActiveField()) {

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

                $queryGenerator->addNativeCondition(["$baseTableName.$baseTableId" => $selected]);

    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

                $relations = reset($relations);

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

                $parentRecordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('sourceRecord'), $request->getByType('sourceModule', \App\Purifier::ALNUM));

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

            if (!$request->isEmpty('sourceRecord') && !\App\Privilege::isPermitted($request->getByType('sourceModule', 2), 'DetailView', $request->getInteger('sourceRecord'))) {

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

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

            $emails = $emailsByField = [];

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

                $emailsByField[$fieldName] = 0;

    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

                $listView->set('search_key', $searchKey);

    Line exceeds 120 characters; contains 139 characters
    Open

            $searchParams = App\Condition::validSearchParams($listView->getQueryGenerator()->getModule(), $request->getArray('search_params'));

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

            if ($advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : []) {

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

            $baseTableName = $moduleModel->get('basetable');

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

         * Get template list.

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

                $recordListModel = Vtiger_RelationListView_Model::getInstance($parentRecordModel, '', $relations['relation_id']);

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

        }

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

         * @param \App\Request $request

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

         * @throws \App\Exceptions\NoPermitted

    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

            $viewer->assign('TEMPLATE_MODULE', $templateModule);

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

            $viewer->assign('DUPLICATES', $duplicates);

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

            $viewer->assign('EMAIL_LIST', $emails);

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

            $sourceModule = $request->getByType('sourceModule', 2);

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

            if ($sourceModule) {

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

            if (!empty($searchParams) && \is_array($searchParams)) {

    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 ($selected && 'all' !== $selected[0]) {

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

         * Process function.

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

        {

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

            $fieldsName = array_keys($this->fields);

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

                    if (!empty($row[$fieldName])) {

    Line exceeds 120 characters; contains 123 characters
    Open

                $parentRecordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('sourceRecord'), $sourceModule);

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

            } else {

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

            $moduleModel = $queryGenerator->getModuleModel();

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

         * @param string       $templateModule

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

            if (!$request->isEmpty('sourceRecord', true)

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

        public $fields = [];

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

        {

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

                $emails = [];

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

            $searchKey = $request->getByType('search_key', 'Alnum');

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

                $listView->set('operator', $operator);

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

            if ($sourceModule) {

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

                $queryGenerator = $listView->getRelationQuery(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

                    $this->fields[$fieldName] = $fieldModel;

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

            $selected = $request->getArray('selected_ids', 2);

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

            $excluded = $request->getArray('excluded_ids', 2);

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

            if ($excluded) {

    Line exceeds 120 characters; contains 139 characters
    Open

                && ($relations = \App\Relation::getByModule($request->getByType('sourceModule', \App\Purifier::ALNUM), true, 'EmailTemplates'))

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

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

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

            if (!\App\Config::component('Mail', 'showEmailsInMassMail')) {

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

            $moduleName = $request->getModule();

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

                $cvId = $request->isEmpty('cvId', true) ? 0 : $request->getByType('cvId', 'Alnum');

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

                $transformedSearchParams = $listView->getQueryGenerator()->parseBaseSearchParamsToCondition($searchParams);

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

                $queryGenerator->addNativeCondition(['not in', "$baseTableName.$baseTableId" => $excluded]);

    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

            ) {

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

                $templateList = $recordListModel->getRelationQuery()->all();

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

            }

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

            $templateModule = $moduleName = $request->getModule();

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

            $viewer->assign('FIELDS', $this->fields);

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

         * Get query instance.

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

            }

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

            $searchParams = App\Condition::validSearchParams($listView->getQueryGenerator()->getModule(), $request->getArray('search_params'));

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

                $listView->set('advancedConditions', \App\Condition::validAdvancedConditions($advancedConditions));

    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

                throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

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

            return 'modal-lg';

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

         * @return \App\Db\Query

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

                $parentRecordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('sourceRecord'), $sourceModule);

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

            }

    Line exceeds 120 characters; contains 168 characters
    Open

            $searchValue = App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $listView->getQueryGenerator()->getModule(), $searchKey, $operator);

    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

                && ($relations = \App\Relation::getByModule($request->getByType('sourceModule', \App\Purifier::ALNUM), true, 'EmailTemplates'))

    Line exceeds 120 characters; contains 167 characters
    Open

                $parentRecordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('sourceRecord'), $request->getByType('sourceModule', \App\Purifier::ALNUM));

    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

                        ++$emails[$row[$fieldName]];

    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 getTemplateList(string $templateModule, App\Request $request): array

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

            $templateList = [];

    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

        /**

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

         */

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

                $listView->set('search_value', $searchValue);

    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

                $recordListModel->setFields(['id', 'name']);

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

            if ($sourceModule && isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$sourceModule])) {

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

         * Get statistics from request.

    Line exceeds 120 characters; contains 143 characters
    Open

                $listView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $moduleName, $request->getInteger('relationId'), $cvId);

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

            $baseTableId = $moduleModel->get('basetableid');

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

            foreach ($moduleModel->getFieldsByType('email') as $fieldName => $fieldModel) {

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

         *

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

         * Checking permissions.

    Line exceeds 120 characters; contains 173 characters
    Open

            if (!$request->isEmpty('sourceRecord') && !\App\Privilege::isPermitted($request->getByType('sourceModule', 2), 'DetailView', $request->getInteger('sourceRecord'))) {

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

        }

    Line exceeds 120 characters; contains 159 characters
    Open

            if ($sourceModule && isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$sourceModule])) {

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

            $viewer->view('SendMailModal.tpl', $moduleName);

    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

            } else {

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

            }

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

            return $queryGenerator->createQuery();

    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

            }

    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

         */

    Line exceeds 120 characters; contains 125 characters
    Open

                $recordListModel = Vtiger_RelationListView_Model::getInstance($parentRecordModel, '', $relations['relation_id']);

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

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

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

                    }

    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

                $listView->set('searchResult', $request->getArray('searchResult', 'Integer'));

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

            if (!empty($searchKey) && !empty($searchValue)) {

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

                $queryGenerator = $listView->getQueryGenerator();

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

            $queryGenerator->setFields(array_merge(['id'], array_keys($this->fields)));

    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 (!$parentRecordModel->isViewable()) {

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

    class Vtiger_SendMailModal_View extends Vtiger_BasicModal_View

    There are no issues that match your filters.

    Category
    Status