YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
C
1 day
Test Coverage
F
19%

Function showSearchResults has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    public function showSearchResults(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $advFilterList = $request->getArray('advfilterlist', 'Text');
Severity: Minor
Found in modules/Vtiger/views/BasicAjax.php - About 4 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 showSearchResults has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function showSearchResults(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $advFilterList = $request->getArray('advfilterlist', 'Text');
Severity: Major
Found in modules/Vtiger/views/BasicAjax.php - About 2 hrs to fix

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

        public function showAdvancedSearch(App\Request $request)
        {
            if (!\App\User::getCurrentUserModel()->getRoleInstance()->get('globalsearchadv')) {
                throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
            }
    Severity: Minor
    Found in modules/Vtiger/views/BasicAjax.php - About 1 hr to fix

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

          public function showAdvancedSearch(App\Request $request)
          {
              if (!\App\User::getCurrentUserModel()->getRoleInstance()->get('globalsearchadv')) {
                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
              }
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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

      The method showSearchResults() has an NPath complexity of 1425. The configured NPath complexity threshold is 200.
      Open

          public function showSearchResults(App\Request $request)
          {
              $viewer = $this->getViewer($request);
              $moduleName = $request->getModule();
              $advFilterList = $request->getArray('advfilterlist', 'Text');
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 showAdvancedSearch() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
      Open

          public function showAdvancedSearch(App\Request $request)
          {
              if (!\App\User::getCurrentUserModel()->getRoleInstance()->get('globalsearchadv')) {
                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
              }
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 method showSearchResults() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
      Open

          public function showSearchResults(App\Request $request)
          {
              $viewer = $this->getViewer($request);
              $moduleName = $request->getModule();
              $advFilterList = $request->getArray('advfilterlist', 'Text');
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 38 to the 15 allowed.
      Open

          public function showSearchResults(App\Request $request)
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.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

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

      class Vtiger_BasicAjax_View extends \App\Controller\View\Page
      {
          use \App\Controller\ClearProcess;
          use \App\Controller\ExposeMethod;
      
      
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 '33', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 '94', column '15').
      Open

                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 '173', column '20').
      Open

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

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 '47', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 '156', column '20').
      Open

                  $response = new Vtiger_Response();
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 '97', column '26').
      Open

                  $queryGenerator = new \App\QueryGenerator($moduleName);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 '67', column '14').
      Open

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\Module' in method 'showSearchResults'.
      Open

                      foreach (\App\Module::getAllEntityModuleInfo(true) as $module) {
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\RecordSearch' in method 'showAdvancedSearch'.
      Open

              $viewer->assign('SEARCHABLE_MODULES', \App\RecordSearch::getSearchableModules());
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\Validator' in method 'showSearchResults'.
      Open

                  $limit = ($request->isEmpty('limit', true) || \App\Validator::bool($request->get('limit'))) ? null : $request->getInteger('limit');
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\Pbx' in method 'performPhoneCall'.
      Open

              $pbx = App\Integrations\Pbx::getDefaultInstance();
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 'showSearchResults'.
      Open

              if (App\Config::search('GLOBAL_SEARCH_CURRENT_MODULE_TO_TOP') && isset($matchingRecords[$moduleName])) {
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 'showSearchResults'.
      Open

                  $query = $queryGenerator->createQuery()->limit(App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_LIMIT'));
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 showSearchResults uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $searchKey = \App\RecordSearch::getSearchField()->getUITypeModel()->getDbConditionBuilderValue($request->getByType('value', 'Text'), '');
                  $limit = ($request->isEmpty('limit', true) || \App\Validator::bool($request->get('limit'))) ? null : $request->getInteger('limit');
                  $operator = (!$request->isEmpty('operator')) ? $request->getByType('operator', \App\Purifier::STANDARD) : null;
                  $searchModule = null;
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\RecordSearch' in method 'showSearchResults'.
      Open

                  $matchingRecords = \App\RecordSearch::getSearchResult($searchKey, $searchModule, $limit, $operator);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 showSearchResults uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $recordsList = [];
                  foreach ($matchingRecords as $module => &$modules) {
                      foreach ($modules as $recordID => $recordModel) {
                          $label = $recordModel->getName();
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 'showSearchResults'.
      Open

                  $queryGenerator->setConditions(\App\Condition::getConditionsFromRequest($advFilterList));
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\Fields\Owner' in method 'showSearchResults'.
      Open

                          $label .= ' (' . \App\Fields\Owner::getLabel($recordModel->get('assigned_user_id')) . ')';
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\Language' in method 'performPhoneCall'.
      Open

                  $response->setResult(\App\Language::translate('LBL_PHONE_CALL_SUCCESS'));
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 'showSearchResults'.
      Open

                      $recordModel = Vtiger_Record_Model::getInstanceById($recordId);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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_DashBoard_Model' in method 'getDashBoardPredefinedWidgets'.
      Open

              $dashBoardModel = Vtiger_DashBoard_Model::getInstance($moduleName);
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 'showSearchResults'.
      Open

                  if (1 === App\Config::search('GLOBAL_SEARCH_SORTING_RESULTS')) {
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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

              $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\Language' in method 'showSearchResults'.
      Open

                              'category' => \App\Language::translate($module, $module),
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\Module' in method 'showAdvancedSearch'.
      Open

              } elseif (false === \App\Module::getModuleId($moduleName) || (!$request->isEmpty('parent', true) && 'Settings' === $request->getByType('parent', 2))) {
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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\Log' in method 'performPhoneCall'.
      Open

                  \App\Log::error('Error while telephone connections: ' . $exc->getMessage(), 'PBX');
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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_Record_Model' in method 'showAdvancedSearch'.
      Open

              $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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 "searchModule" 9 times.
      Open

              if (!$request->isEmpty('searchModule') && '-' !== $request->getRaw('searchModule') && !$currentUserPrivilegesModel->hasModulePermission($request->getByType('searchModule', 2))) {
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.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 "LBL_PERMISSION_DENIED" 5 times.
      Open

                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.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 "modulename" 3 times.
      Open

                          if (isset($matchingRecords[$module['modulename']]) && 1 == $module['turn_off']) {
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.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 "parent" 4 times.
      Open

              if (!$currentUserPrivilegesModel->hasModulePermission($request->getModule()) && ($request->isEmpty('parent', true) || 'Settings' !== $request->getByType('parent', 2) || !$currentUserPrivilegesModel->isAdminUser())) {
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.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 "permitted" 4 times.
      Open

                      $recordModel->set('permitted', true);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.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 "limit" 3 times.
      Open

                  $limit = ($request->isEmpty('limit', true) || \App\Validator::bool($request->get('limit'))) ? null : $request->getInteger('limit');
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.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.

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('WIDGETS', $widgets);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

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

                  $queryGenerator = new \App\QueryGenerator($moduleName);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Argument 1 (mixed) is string but \Users_Privileges_Model::hasModulePermission() takes int defined at /code/modules/Users/models/Privileges.php:101
      Open

              if (!$currentUserPrivilegesModel->hasModulePermission($request->getModule()) && ($request->isEmpty('parent', true) || 'Settings' !== $request->getByType('parent', 2) || !$currentUserPrivilegesModel->isAdminUser())) {
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

                  $viewer->assign('MATCHING_RECORDS', $matchingRecords);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('MODULE', $module);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

                  $viewer->assign('SEARCH_MODULE', $searchModule);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

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

              if (!\App\User::getCurrentUserModel()->getRoleInstance()->get('globalsearchadv')) {
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to method error from undeclared class \App\Log
      Open

                  \App\Log::error('Error while telephone connections: ' . $exc->getMessage(), 'PBX');
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('SEARCHABLE_MODULES', \App\RecordSearch::getSearchableModules());
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

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

                  $queryGenerator->setFields(['id']);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

                  $viewer->assign('SEARCH_MODULE', $moduleName);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

                  $viewer->assign('IS_ADVANCE_SEARCH', $isAdvanceSearch);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

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

                          $label .= ' (' . \App\Fields\Owner::getLabel($recordModel->get('assigned_user_id')) . ')';
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

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

                  $query = $queryGenerator->createQuery()->limit(App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_LIMIT'));
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('MODULE_NAME', $moduleName);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('SOURCE_MODULE', $moduleName);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to method bool from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
      Open

                  $limit = ($request->isEmpty('limit', true) || \App\Validator::bool($request->get('limit'))) ? null : $request->getInteger('limit');
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

                  $viewer->assign('MODULE', $moduleName);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('SAVE_FILTER_PERMITTED', $saveFilterPermitted);
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

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

                  if (!\App\User::getCurrentUserModel()->getRoleInstance()->get('globalsearchadv')) {
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

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

                  $queryGenerator->setConditions(\App\Condition::getConditionsFromRequest($advFilterList));
      Severity: Critical
      Found in modules/Vtiger/views/BasicAjax.php by phan

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

              $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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_BasicAjax_View extends \App\Controller\View\Page

      The class Vtiger_BasicAjax_View is not named in CamelCase.
      Open

      class Vtiger_BasicAjax_View extends \App\Controller\View\Page
      {
          use \App\Controller\ClearProcess;
          use \App\Controller\ExposeMethod;
      
      
      Severity: Minor
      Found in modules/Vtiger/views/BasicAjax.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

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

           * @param \App\Request $request

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

                      }

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

          /**

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

                  $response->emit();

      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

              $widgets = $dashBoardModel->getDashboards(0);

      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

          {

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

          public function showAdvancedSearch(App\Request $request)

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

              $saveFilterPermitted = true;

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

                  $isAdvanceSearch = 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

              $dashBoardModel->set('dashboardId', $request->getInteger('dashboardId'));

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

              $this->exposeMethod('showAdvancedSearch');

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

              $this->exposeMethod('showSearchResults');

      Line exceeds 120 characters; contains 186 characters
      Open

              if (!$request->isEmpty('searchModule') && '-' !== $request->getRaw('searchModule') && !$currentUserPrivilegesModel->hasModulePermission($request->getByType('searchModule', 2))) {

      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

              }

      Line exceeds 120 characters; contains 159 characters
      Open

              } elseif (false === \App\Module::getModuleId($moduleName) || (!$request->isEmpty('parent', true) && 'Settings' === $request->getByType('parent', 2))) {

      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

              $matchingRecords = [];

      Line exceeds 120 characters; contains 143 characters
      Open

                  $limit = ($request->isEmpty('limit', true) || \App\Validator::bool($request->get('limit'))) ? null : $request->getInteger('limit');

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

                      foreach (\App\Module::getAllEntityModuleInfo(true) as $module) {

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

                              $matchingRecordsList[$module['modulename']] = $matchingRecords[$module['modulename']];

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

                  unset($matchingRecords[$moduleName]);

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

                  foreach ($matchingRecords as $module => &$modules) {

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

                          $label = $recordModel->getName();

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

                          $label .= ' (' . \App\Fields\Owner::getLabel($recordModel->get('assigned_user_id')) . ')';

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

              if (!$request->isEmpty('searchModule') && '-' !== $request->getRaw('searchModule') && !$currentUserPrivilegesModel->hasModulePermission($request->getByType('searchModule', 2))) {

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

              } elseif (false === \App\Module::getModuleId($moduleName) || (!$request->isEmpty('parent', true) && 'Settings' === $request->getByType('parent', 2))) {

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

              if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModulePermission($moduleName)) {

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

                  $operator = (!$request->isEmpty('operator')) ? $request->getByType('operator', \App\Purifier::STANDARD) : null;

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

                  $searchModule = null;

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

                      foreach ($modules as $recordID => $recordModel) {

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

                          if (!$recordModel->get('permitted')) {

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

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

              $viewer->view('dashboards/DashBoardWidgetsList.tpl', $moduleName);

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

              $this->exposeMethod('performPhoneCall');

      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

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

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

              if ('Vtiger' === $moduleName) {

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

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

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

              echo $viewer->view('AdvanceSearch.tpl', $moduleName, 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

              $moduleName = $request->getModule();

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

              //used to show the save modify filter option

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

                  $queryGenerator->setConditions(\App\Condition::getConditionsFromRequest($advFilterList));

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

                  $limit = ($request->isEmpty('limit', true) || \App\Validator::bool($request->get('limit'))) ? null : $request->getInteger('limit');

      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::search('GLOBAL_SEARCH_CURRENT_MODULE_TO_TOP') && isset($matchingRecords[$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

              $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

      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

          }

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

              $isAdvanceSearch = false;

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

                  $viewer->assign('SEARCH_MODULE', $searchModule);

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

                  $matchingRecords = \App\RecordSearch::getSearchResult($searchKey, $searchModule, $limit, $operator);

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

                          }

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

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

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

                  echo $viewer->view('UnifiedSearchResults.tpl', '', true);

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

                  $recordsList = [];

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

                              'id' => $recordID,

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

                      }

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

              $pbx = App\Integrations\Pbx::getDefaultInstance();

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

              try {

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

                  $pbx->performCall($request->getByType('phoneNumber', 'Phone'));

      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 = 'Home';

      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

                  $queryGenerator = new \App\QueryGenerator($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

                  $searchKey = \App\RecordSearch::getSearchField()->getUITypeModel()->getDbConditionBuilderValue($request->getByType('value', 'Text'), '');

      Line exceeds 120 characters; contains 123 characters
      Open

                  $operator = (!$request->isEmpty('operator')) ? $request->getByType('operator', \App\Purifier::STANDARD) : null;

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

                      $matchingRecords = $matchingRecordsList;

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

                              'module' => $module,

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

                              'permitted' => $recordModel->get('permitted'),

      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

          public function performPhoneCall(App\Request $request)

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

                  \App\Log::error('Error while telephone connections: ' . $exc->getMessage(), 'PBX');

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

              $viewer->assign('WIDGETS', $widgets);

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

          use \App\Controller\ExposeMethod;

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

           *

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

                  $saveFilterPermitted = false;

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

                      $recordModel = Vtiger_Record_Model::getInstanceById($recordId);

      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

                  $pushTop = $matchingRecords[$moduleName];

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

                  $viewer->assign('IS_ADVANCE_SEARCH', $isAdvanceSearch);

      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

                  $response->setResult($recordsList);

      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

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

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

                      $matchingRecordsList = [];

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

              $dashBoardModel = Vtiger_DashBoard_Model::getInstance($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

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

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

                  $moduleName = 'Home';

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

                  $query = $queryGenerator->createQuery()->limit(App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_LIMIT'));

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

                      $matchingRecords[$moduleName][$recordId] = $recordModel;

      Line exceeds 120 characters; contains 149 characters
      Open

                  $searchKey = \App\RecordSearch::getSearchField()->getUITypeModel()->getDbConditionBuilderValue($request->getByType('value', 'Text'), '');

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

                  $matchingRecords = [$moduleName => $pushTop] + $matchingRecords;

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

                          }

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

                          $recordsList[] = [

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

           * Perform phone call.

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

              } catch (Exception $exc) {

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

              if (!$currentUserPrivilegesModel->hasModulePermission($request->getModule()) && ($request->isEmpty('parent', true) || 'Settings' !== $request->getByType('parent', 2) || !$currentUserPrivilegesModel->isAdminUser())) {

      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\User::getCurrentUserModel()->getRoleInstance()->get('globalsearchadv')) {

      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

                  //See if it is an excluded module, If so search in home module

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

              }

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

              //See if it is an excluded module, If so search in home module

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

              $viewer->assign('SEARCHABLE_MODULES', \App\RecordSearch::getSearchableModules());

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

              $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());

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

              if (\is_array($advFilterList) && $advFilterList) {

      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

                  $queryGenerator->setFields(['id']);

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

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

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

                  if (!$request->isEmpty('searchModule', true) && '-' !== $request->getRaw('searchModule')) {

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

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

                  if (1 === App\Config::search('GLOBAL_SEARCH_SORTING_RESULTS')) {

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

              } else {

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

                          ];

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

          }

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

                  $response->setResult(\App\Language::translate('LBL_PHONE_CALL_SUCCESS'));

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

           * Return button of predefined widgets.

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

              $this->exposeMethod('getDashBoardPredefinedWidgets');

      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

                      $recordModel->set('permitted', true);

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

                          if (isset($matchingRecords[$module['modulename']]) && 1 == $module['turn_off']) {

      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

              $pbx->loadUserPhone();

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

              $dashBoardModel->verifyDashboard($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

              if (\in_array($moduleName, ['ModComments', 'RSS', 'Portal', 'Integration', 'DashBoard'])) {

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

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

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

              $viewer->assign('SAVE_FILTER_PERMITTED', $saveFilterPermitted);

      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 (!$currentUserPrivilegesModel->hasModulePermission($request->getModule()) && ($request->isEmpty('parent', true) || 'Settings' !== $request->getByType('parent', 2) || !$currentUserPrivilegesModel->isAdminUser())) {

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

           *

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

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

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

           * @throws \App\Exceptions\NoPermitted

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

          public function showSearchResults(App\Request $request)

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

              $advFilterList = $request->getArray('advfilterlist', 'Text');

      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

                              $label .= ' <span class="fas fa-exclamation-circle" aria-hidden="true"></span>';

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

           */

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

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

      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

          {

      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

              if (!$request->isEmpty('searchModule') && '-' !== $request->getRaw('searchModule')) {

      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

                  while ($recordId = $dataReader->readColumn(0)) {

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

                              'category' => \App\Language::translate($module, $module),

      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\ClearProcess;

      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

           * Function to display the UI for advance search on any of the module.

      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

          }

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

           * Function to display the Search Results.

      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\User::getCurrentUserModel()->getRoleInstance()->get('globalsearchadv')) {

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

                  }

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

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

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

                  }

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

              }

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

                  $viewer->assign('MATCHING_RECORDS', $matchingRecords);

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

                              'label' => $label,

      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

           * @param \App\Request $request

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

      class Vtiger_BasicAjax_View extends \App\Controller\View\Page

      There are no issues that match your filters.

      Category
      Status