YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/actions/Mail.php

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Function sendMails has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function sendMails(App\Request $request): void
    {
        $moduleName = $request->getModule();
        $field = $request->getByType('field', 'Alnum');
        $sourceModule = $request->getByType('sourceModule', 'Alnum');
Severity: Minor
Found in modules/Vtiger/actions/Mail.php - About 2 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

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

    Method sendMails has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function sendMails(App\Request $request): void
        {
            $moduleName = $request->getModule();
            $field = $request->getByType('field', 'Alnum');
            $sourceModule = $request->getByType('sourceModule', 'Alnum');
    Severity: Minor
    Found in modules/Vtiger/actions/Mail.php - About 1 hr to fix

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

          public function getQuery(App\Request $request): App\Db\Query
          {
              $moduleName = $request->getModule();
              $sourceModule = $request->getByType('sourceModule', 2);
              if ($sourceModule) {
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 2592. The configured NPath complexity threshold is 200.
      Open

          public function getQuery(App\Request $request): App\Db\Query
          {
              $moduleName = $request->getModule();
              $sourceModule = $request->getByType('sourceModule', 2);
              if ($sourceModule) {
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 getQuery() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
      Open

          public function getQuery(App\Request $request): App\Db\Query
          {
              $moduleName = $request->getModule();
              $sourceModule = $request->getByType('sourceModule', 2);
              if ($sourceModule) {
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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

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

          public function getQuery(App\Request $request): App\Db\Query
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.php by sonar-php

      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

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

          public function sendMails(App\Request $request): void
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.php by sonar-php

      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 (isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$sourceModule])) {
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.php by phpmd

      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 (isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$sourceModule])) {
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.php by phpmd

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

      class Vtiger_Mail_Action extends \App\Controller\Action
      {
          use \App\Controller\ExposeMethod;
      
          /**
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 '111', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 '54', column '19').
      Open

              $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 '27', column '14').
      Open

                  throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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\Mailer' in method 'sendMails'.
      Open

                      $result = \App\Mailer::sendFromTemplate(array_merge($params, $extraParams));
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 'checkSmtp'.
      Open

              if (App\Config::main('isActiveSendingMails')) {
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 'getQuery'.
      Open

                  $listView->set('advancedConditions', \App\Condition::validAdvancedConditions($advancedConditions));
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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\Mail' in method 'checkSmtp'.
      Open

                  $result = !empty(App\Mail::getAll());
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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

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

                      } else {
                          $emails[$row[$field]] = [$row['id']];
                      }
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.php by phpmd

      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);
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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

      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();
              }
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.php by phpmd

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

              $searchParams = App\Condition::validSearchParams($listView->getQueryGenerator()->getModule(), $request->getArray('search_params'));
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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

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

                      } else {
                          $extraParams = [
                              'moduleName' => $moduleName,
                              'recordId' => $id,
                              'sourceModule' => $sourceModule,
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.php by phpmd

      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));
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 '150', column '7').
      Open

          public function getQuery(App\Request $request): App\Db\Query
          {
              $moduleName = $request->getModule();
              $sourceModule = $request->getByType('sourceModule', 2);
              if ($sourceModule) {
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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_RelationListView_Model' in method 'getQuery'.
      Open

                  $listView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $moduleName, $request->getInteger('relationId'), $cvId);
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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

      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));
              }
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.php by phpmd

      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'))) {
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 'getQuery'.
      Open

                  $listView->set('search_value', App\Condition::validSearchValue($searchValue, $listView->getQueryGenerator()->getModule(), $searchKey, $operator));
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 "advancedConditions" 3 times.
      Open

              if ($advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : []) {
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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 "searchResult" 3 times.
      Open

              if (!$request->isEmpty('searchResult', true)) {
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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 "template" 3 times.
      Open

              if (!$request->isEmpty('template') && !empty($field)) {
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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" 5 times.
      Open

              $field = $request->getByType('field', 'Alnum');
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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 "field" 3 times.
      Open

              $field = $request->getByType('field', 'Alnum');
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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 "sourceModule" 5 times.
      Open

              if (!$request->isEmpty('sourceRecord') && !\App\Privilege::isPermitted($request->getByType('sourceModule', 2), 'DetailView', $request->getInteger('sourceRecord'))) {
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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 "sourceRecord" 6 times.
      Open

              if (!$request->isEmpty('sourceRecord') && !\App\Privilege::isPermitted($request->getByType('sourceModule', 2), 'DetailView', $request->getInteger('sourceRecord'))) {
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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.

      Avoid unused parameters such as '$request'.
      Open

          public function checkSmtp(App\Request $request): void
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.php by phpmd

      UnusedFormalParameter

      Since: 0.2

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

      Example

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

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

      Call to 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/actions/Mail.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/actions/Mail.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/actions/Mail.php by phan

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

                      if (isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$sourceModule])) {
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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/actions/Mail.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/actions/Mail.php by phan

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

              $queryGenerator->setFields(['id', $request->getByType('field', 'Alnum')]);
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.php by phan

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

              $queryGenerator->addCondition($request->getByType('field', 'Alnum'), '', 'ny');
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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/actions/Mail.php by phan

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

                  $listView->set('search_value', App\Condition::validSearchValue($searchValue, $listView->getQueryGenerator()->getModule(), $searchKey, $operator));
      Severity: Critical
      Found in modules/Vtiger/actions/Mail.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/actions/Mail.php and 1 other location - About 1 hr to fix
      modules/Vtiger/views/SendMailModal.php on lines 111..117

      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);
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.php by phpmd

      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_Mail_Action extends \App\Controller\Action

      The class Vtiger_Mail_Action is not named in CamelCase.
      Open

      class Vtiger_Mail_Action extends \App\Controller\Action
      {
          use \App\Controller\ExposeMethod;
      
          /**
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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 = current($ids);
      Severity: Minor
      Found in modules/Vtiger/actions/Mail.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

           * Function to check permission.

      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

          /**

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

              $response = new Vtiger_Response();

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

           *

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

                          $emails[$row[$field]][] = $row['id'];

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

                              'moduleName' => $sourceModule,

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

              $this->exposeMethod('sendMails');

      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

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

                      if (isset(\App\TextParser::$sourceModules[$sourceModule]) && \in_array($moduleName, \App\TextParser::$sourceModules[$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

          public function checkPermission(App\Request $request)

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

                      'massMailNotes' => $request->getForHtml('mailNotes'),

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

                          $emails[$row[$field]] = [$row['id']];

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

          public function __construct()

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

           * @param \App\Request $request

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

           */

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

           * @param \App\Request $request

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

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

           * Check if smtps are active.

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

           *

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

          {

      Line exceeds 120 characters; contains 150 characters
      Open

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

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

          /**

      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

           */

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

          }

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

                  foreach ($this->getQuery($request)->each() as $row) {

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

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

          use \App\Controller\ExposeMethod;

      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

          /**

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

              if (App\Config::main('isActiveSendingMails')) {

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

                      }

      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

          {

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

           * @return void

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

                  $result = !empty(App\Mail::getAll());

      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

                  $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

                      $id = current($ids);

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

                              'sourceRecord' => $id,

      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

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

      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

              }

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

          {

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

              $response->setResult($result);

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

              $result = false;

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

              if (!$request->isEmpty('template') && !empty($field)) {

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

                          $extraParams = [

      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

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

      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

              if ($excluded) {

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

           * Construct.

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

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

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

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

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

                  foreach ($emails as $email => $ids) {

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

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

                      $params['emailIds'] = $ids;

      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

              }

      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

              $sourceRecord = $request->getInteger('sourceRecord');

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

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

      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 (isset($emails[$row[$field]])) {

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

                          $extraParams = [

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

              $response = new Vtiger_Response();

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

              } else {

      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

          }

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

              parent::__construct();

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

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

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

           */

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

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

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

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

              }

      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($request->getByType('field', 'Alnum'), '', 'ny');

      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

           * Send mails.

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

           *

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

           * @return void

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

          {

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

                  $params = [

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

                      $params['to'] = $email;

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

                  }

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

              $response->setResult($result);

      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

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

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

                      if (!$result) {

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

              }

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

              }

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

           *

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

           */

      Line exceeds 120 characters; contains 143 characters
      Open

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

      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

                  $listView->loadListViewCondition();

      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

              $moduleName = $request->getModule();

      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

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

      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

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

      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

              $moduleModel = $queryGenerator->getModuleModel();

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

              $response->emit();

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

           * @return \App\Db\Query

      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

              }

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

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

      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

              if ($selected && 'all' !== $selected[0]) {

      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

              }

      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

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

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

              $this->exposeMethod('checkSmtp');

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

              $result = false;

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

              $response->emit();

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

          /**

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

                      } else {

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

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

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

      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

              $searchValue = $request->getByType('search_value', 'Text');

      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

              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

                      $result = \App\Mailer::sendFromTemplate(array_merge($params, $extraParams));

      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

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

      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

              }

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

                          break;

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

          {

      Line exceeds 120 characters; contains 158 characters
      Open

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

      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

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

      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

              $queryGenerator->setFields(['id', $request->getByType('field', 'Alnum')]);

      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

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

      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

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

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

      class Vtiger_Mail_Action extends \App\Controller\Action

      There are no issues that match your filters.

      Category
      Status