YetiForceCompany/YetiForceCRM

View on GitHub
modules/SMSNotifier/views/MassSMS.php

Summary

Maintainability
C
7 hrs
Test Coverage
F
0%

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

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);

        $moduleName = $request->getModule();
Severity: Major
Found in modules/SMSNotifier/views/MassSMS.php - About 2 hrs to fix

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

        public function process(App\Request $request)
        {
            $viewer = $this->getViewer($request);
    
            $moduleName = $request->getModule();
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function getRecordsListQueryFromRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getRecordsListQueryFromRequest(App\Request $request): App\QueryGenerator
        {
            $module = $request->getModule();
            $sourceModule = $request->getByType('source_module', 'Alnum');
            $selectedIds = $request->getArray('selected_ids', 'Alnum');
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.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 process() has an NPath complexity of 576. The configured NPath complexity threshold is 200.
    Open

        public function process(App\Request $request)
        {
            $viewer = $this->getViewer($request);
    
            $moduleName = $request->getModule();
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

    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 process() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
    Open

        public function process(App\Request $request)
        {
            $viewer = $this->getViewer($request);
    
            $moduleName = $request->getModule();
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

    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 class SMSNotifier_MassSMS_View has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
    Open

    class SMSNotifier_MassSMS_View extends \App\Controller\Modal
    {
        /** {@inheritdoc} */
        protected $pageTitle = 'LBL_SEND_SMS_TO_SELECTED_NUMBERS';
        /** {@inheritdoc} */
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                $queryGenerator = new \App\QueryGenerator($templateModel->getName());
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                $queryGenerator = new \App\QueryGenerator($sourceModule);
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                    $row['name'] = \App\Record::getLabel($id, true);
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

            if (!$moduleModel->isPermitted('CreateView') || !\in_array($sourceModule, $moduleModel->getFieldByName('related_to')->getReferenceList()) || !$userPrivilegesModel->hasModuleActionPermission($sourceModule, 'MassSendSMS') || !\App\Integrations\SMSProvider::isActiveProvider()) {
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

        public function getRecordsListQueryFromRequest(App\Request $request): App\QueryGenerator
        {
            $module = $request->getModule();
            $sourceModule = $request->getByType('source_module', 'Alnum');
            $selectedIds = $request->getArray('selected_ids', 'Alnum');
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

            $viewer->assign('SEARCH_PARAMS', App\Condition::validSearchParams($sourceModule, $request->getArray('search_params'), false));
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                $customViewModel->set('search_params', App\Condition::validSearchParams($sourceModule, $request->getArray('search_params')));
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

    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_Module_Model' in method 'process'.
    Open

            $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

            $viewer->assign('ALPHABET_VALUE', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

            $moduleModel = Vtiger_Module_Model::getInstance($request->getModule());
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

            $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

    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 'CustomView_Record_Model' in method 'getRecordsListQueryFromRequest'.
    Open

            } elseif ($customViewModel = CustomView_Record_Model::getInstanceById($request->getByType('viewname', 'Alnum'))) {
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                $selectedRecordModel = Vtiger_Record_Model::getInstanceById($recordId, $sourceModule);
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                    $customViewModel->set('advancedConditions', \App\Condition::validAdvancedConditions($advancedConditions));
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

        public function getRecordsListQueryFromRequest(App\Request $request): App\QueryGenerator
        {
            $module = $request->getModule();
            $sourceModule = $request->getByType('source_module', 'Alnum');
            $selectedIds = $request->getArray('selected_ids', 'Alnum');
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                    $customViewModel->set('search_value', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $sourceModule, $searchKey, $operator));
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

            $viewer->assign('SMS_LIMIT', \App\Config::module($moduleName, 'maxMassSentSMS'));
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

    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_Module_Model' in method 'process'.
    Open

            $templateModel = \Vtiger_Module_Model::getInstance('SMSTemplates');
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

        public function process(App\Request $request)
        {
            $viewer = $this->getViewer($request);
    
            $moduleName = $request->getModule();
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

    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 'Vtiger_Module_Model' in method 'process'.
    Open

            $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

                \App\Condition::validAdvancedConditions($advancedConditions);
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

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

            $viewer->assign('ALPHABET_VALUE', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            if ($templateModel->isActive() && $templateModel->getFieldByName('message')->isViewable()) {
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $viewer->assign('SEARCH_PARAMS', App\Condition::validSearchParams($sourceModule, $request->getArray('search_params'), false));
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "Alnum" 7 times.
    Open

            $viewer->assign('ALPHABET_VALUE', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : [];
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $sourceModule = $request->getByType('source_module', \App\Purifier::ALNUM);
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $viewer->assign('ENTITY_STATE', $request->getByType('entityState'));
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $viewer->assign('OPERATOR', $request->getByType('operator'));
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            $viewer->assign('ALPHABET_VALUE', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Return type of getRecordsListQueryFromRequest() is undeclared type \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

        public function getRecordsListQueryFromRequest(App\Request $request): App\QueryGenerator
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phan

    Call to undeclared method \SMSNotifier_MassSMS_View::getViewer
    Open

            $viewer = $this->getViewer($request);
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by phan

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

                $queryGenerator->setFields(['id', 'message'])->addCondition('target', $sourceModule, 'e');
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by phan

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

            $query = $this->getRecordsListQueryFromRequest($request)->clearFields()->setFields(['id'])->createQuery();
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by phan

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

                $dataReader = $queryGenerator->setLimit(100)->createQuery()->createCommand()->query();
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by phan

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

                $queryGenerator = new \App\QueryGenerator($sourceModule);
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by phan

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

                $queryGenerator = new \App\QueryGenerator($templateModel->getName());
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by phan

    Class extends undeclared class \App\Controller\Modal
    Open

    class SMSNotifier_MassSMS_View extends \App\Controller\Modal
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by phan

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

                $queryGenerator->addCondition('id', $selectedIds, 'e');
    Severity: Critical
    Found in modules/SMSNotifier/views/MassSMS.php by phan

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

        public function checkPermission(App\Request $request)
        {
            $sourceModule = $request->getByType('source_module', \App\Purifier::ALNUM);
            $moduleModel = Vtiger_Module_Model::getInstance($request->getModule());
            $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
    Severity: Major
    Found in modules/SMSNotifier/views/MassSMS.php and 1 other location - About 2 hrs to fix
    modules/SMSNotifier/actions/MassSMS.php on lines 19..27

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

    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 3 locations. Consider refactoring.
    Open

                if (!$request->isEmpty('operator')) {
                    $operator = $request->getByType('operator');
                    $searchKey = $request->getByType('search_key', 'Alnum');
                    $customViewModel->set('operator', $operator);
                    $customViewModel->set('search_key', $searchKey);
    Severity: Major
    Found in modules/SMSNotifier/views/MassSMS.php and 2 other locations - About 1 hr to fix
    modules/SMSNotifier/actions/MassSMS.php on lines 90..96
    modules/Vtiger/actions/Mass.php on lines 41..47

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

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

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

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

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

    Refactorings

    Further Reading

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

    class SMSNotifier_MassSMS_View extends \App\Controller\Modal

    The class SMSNotifier_MassSMS_View is not named in CamelCase.
    Open

    class SMSNotifier_MassSMS_View extends \App\Controller\Modal
    {
        /** {@inheritdoc} */
        protected $pageTitle = 'LBL_SEND_SMS_TO_SELECTED_NUMBERS';
        /** {@inheritdoc} */
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

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

                    $id = $row['id'];
    Severity: Minor
    Found in modules/SMSNotifier/views/MassSMS.php by phpmd

    ShortVariable

    Since: 0.2

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

    Example

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

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

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

        /**

    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

         * 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

        /** {@inheritdoc} */

    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

        /** {@inheritdoc} */

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

        public function checkPermission(App\Request $request)

    Line exceeds 120 characters; contains 284 characters
    Open

            if (!$moduleModel->isPermitted('CreateView') || !\in_array($sourceModule, $moduleModel->getFieldByName('related_to')->getReferenceList()) || !$userPrivilegesModel->hasModuleActionPermission($sourceModule, 'MassSendSMS') || !\App\Integrations\SMSProvider::isActiveProvider()) {

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

        public $modalIcon = 'yfm-SMSNotifier';

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

            $moduleModel = Vtiger_Module_Model::getInstance($request->getModule());

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

            }

    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

        /** {@inheritdoc} */

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

        public $successBtn = 'LBL_SEND';

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

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

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

            $sourceModule = $request->getByType('source_module', \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

        protected $pageTitle = 'LBL_SEND_SMS_TO_SELECTED_NUMBERS';

    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 (!$moduleModel->isPermitted('CreateView') || !\in_array($sourceModule, $moduleModel->getFieldByName('related_to')->getReferenceList()) || !$userPrivilegesModel->hasModuleActionPermission($sourceModule, 'MassSendSMS') || !\App\Integrations\SMSProvider::isActiveProvider()) {

    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

        public function process(App\Request $request)

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

            $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

        {

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

            $viewer->assign('TEMPLATES', $templates);

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

            $viewer->assign('FIELD_IMAGE', $moduleModel->getFieldByName('image'));

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

            $viewer->assign('SEARCH_PARAMS', App\Condition::validSearchParams($sourceModule, $request->getArray('search_params'), false));

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

            if (!empty($selectedIds) && !\in_array($selectedIds[0], ['all', '"all"'])) {

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

                    $row['name'] = \App\Record::getLabel($id, 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

            $viewer->assign('FIELD_MESSAGE', $moduleModel->getFieldByName('message'));

    Line exceeds 120 characters; contains 134 characters
    Open

            $viewer->assign('SEARCH_PARAMS', App\Condition::validSearchParams($sourceModule, $request->getArray('search_params'), false));

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

            $viewer->view('MassSMS.tpl', $request->getModule());

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

         * @return \App\QueryGenerator

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

            $module = $request->getModule();

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

            if (1 === $total && $recordId = $query->scalar()) {

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

                }

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

            $viewer->assign('VIEWNAME', 'relation' !== $cvId ? $cvId : '');

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

            $viewer->assign('MODULE', $moduleName);

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

            $viewer->assign('SELECTED_IDS', $selectedIds);

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

            $viewer->assign('OPERATOR', $request->getByType('operator'));

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

                \App\Condition::validAdvancedConditions($advancedConditions);

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

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

    Line exceeds 120 characters; contains 170 characters
    Open

                    $customViewModel->set('search_value', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $sourceModule, $searchKey, $operator));

    Line exceeds 120 characters; contains 137 characters
    Open

                $customViewModel->set('search_params', App\Condition::validSearchParams($sourceModule, $request->getArray('search_params')));

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

            $total = $query->count();

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

                $queryGenerator = new \App\QueryGenerator($templateModel->getName());

    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 ($advancedConditions) {

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

            $viewer->assign('ADVANCED_CONDITIONS', $advancedConditions);

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

            $excludedIds = $request->getArray('excluded_ids', '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

            $templateModel = \Vtiger_Module_Model::getInstance('SMSTemplates');

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

                $queryGenerator->setFields(['id', 'message'])->addCondition('target', $sourceModule, 'e');

    Line exceeds 120 characters; contains 151 characters
    Open

            $cvId = !$request->isEmpty('cvId') ? $request->getByType('cvId', \App\Purifier::ALNUM) : $request->getByType('viewname', \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

                $queryGenerator->addCondition('id', $selectedIds, 'e');

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

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

    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

                    $templates[$id] = $row;

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

            $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);

    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

            return $queryGenerator;

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

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

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

            $viewer->assign('ALPHABET_VALUE', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));

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

            $viewer->assign('SEARCH_KEY', $request->getByType('search_key', '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

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

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

            $sourceModule = $request->getByType('source_module', \App\Purifier::ALNUM);

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

            if ($templateModel->isActive() && $templateModel->getFieldByName('message')->isViewable()) {

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

            $viewer->assign('PHONE_FIELDS', $phoneFields);

    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

                }

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

                $selectedRecordModel = Vtiger_Record_Model::getInstanceById($recordId, $sourceModule);

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

                $dataReader = $queryGenerator->setLimit(100)->createQuery()->createCommand()->query();

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

            $phoneFields = [];

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

            $cvId = !$request->isEmpty('cvId') ? $request->getByType('cvId', \App\Purifier::ALNUM) : $request->getByType('viewname', \App\Purifier::ALNUM);

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

            $advancedConditions = $request->has('advancedConditions') ? $request->getArray('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

                $queryGenerator = new \App\QueryGenerator($sourceModule);

    Line exceeds 120 characters; contains 122 characters
    Open

            } elseif ($customViewModel = CustomView_Record_Model::getInstanceById($request->getByType('viewname', 'Alnum'))) {

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

                    $customViewModel->set('search_value', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $sourceModule, $searchKey, $operator));

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

            $templates = [];

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

                if ($fieldModel->isViewable()) {

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

                    $phoneFields[$fieldName] = $fieldModel;

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

            } elseif ($customViewModel = CustomView_Record_Model::getInstanceById($request->getByType('viewname', 'Alnum'))) {

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

                $customViewModel->set('entityState', $request->getByType('entityState'));

    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

            $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);

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

            $viewer->assign('SMS_LIMIT', \App\Config::module($moduleName, 'maxMassSentSMS'));

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

            $viewer->assign('EXCLUDED_IDS', $request->getArray('excluded_ids', 2));

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

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

    Line exceeds 120 characters; contains 122 characters
    Open

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

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

            }

    Line exceeds 120 characters; contains 210 characters
    Open

            $viewer->assign('ALPHABET_VALUE', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));

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

                $customViewModel->set('search_params', App\Condition::validSearchParams($sourceModule, $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

                $queryGenerator = $customViewModel->getRecordsListQuery($excludedIds, $module);

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

            $query = $this->getRecordsListQueryFromRequest($request)->clearFields()->setFields(['id'])->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

        public function getRecordsListQueryFromRequest(App\Request $request): App\QueryGenerator

    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

            foreach ($sourceModuleModel->getFieldsByType('phone', true) as $fieldName => $fieldModel) {

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

            $viewer->assign('SOURCE_MODULE', $sourceModule);

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

            $viewer->assign('ENTITY_STATE', $request->getByType('entityState'));

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

        /**

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

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

    Line exceeds 120 characters; contains 124 characters
    Open

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

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

                $viewer->assign('SINGLE_RECORD', $selectedRecordModel);

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

         * Get query for records list from request.

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

            $selectedIds = $request->getArray('selected_ids', 'Alnum');

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

                if (!$request->isEmpty('operator')) {

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

    class SMSNotifier_MassSMS_View extends \App\Controller\Modal

    There are no issues that match your filters.

    Category
    Status