YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
B
5 hrs
Test Coverage
F
33%

Function getPagination has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPagination(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $cvId = $request->getByType('viewname', 2);
        $pageNumber = $request->getInteger('page');
Severity: Minor
Found in modules/Vtiger/views/Pagination.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 getPagination has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getPagination(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $cvId = $request->getByType('viewname', 2);
        $pageNumber = $request->getInteger('page');
Severity: Major
Found in modules/Vtiger/views/Pagination.php - About 2 hrs to fix

    Method getRelationPagination has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getRelationPagination(App\Request $request)
        {
            $viewer = $this->getViewer($request);
            $pageNumber = $request->getInteger('page');
            $moduleName = $request->getModule();
    Severity: Minor
    Found in modules/Vtiger/views/Pagination.php - About 1 hr to fix

      The method getPagination() has an NPath complexity of 1168. The configured NPath complexity threshold is 200.
      Open

          public function getPagination(App\Request $request)
          {
              $viewer = $this->getViewer($request);
              $cvId = $request->getByType('viewname', 2);
              $pageNumber = $request->getInteger('page');
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 getPagination() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
      Open

          public function getPagination(App\Request $request)
          {
              $viewer = $this->getViewer($request);
              $cvId = $request->getByType('viewname', 2);
              $pageNumber = $request->getInteger('page');
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 20 to the 15 allowed.
      Open

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

      Missing class import via use statement (line '29', column '22').
      Open

              $pagingModel = new Vtiger_Paging_Model();
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 '69', column '22').
      Open

              $pagingModel = new Vtiger_Paging_Model();
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 '35', column '14').
      Open

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

              if (!$parentId || !\App\Privilege::isPermitted($moduleName, 'DetailView', $parentId)) {
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 getPagination uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $totalCount = false;
              }
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 'getPagination'.
      Open

                      $listViewModel->set('search_value', App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $searchKey, $operator));
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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_RelationListView_Model' in method 'getRelationPagination'.
      Open

              $relationListView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $relatedModuleName);
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 'getPagination'.
      Open

              if (App\Config::performance('LISTVIEW_COMPUTE_PAGE_COUNT') || -1 == $totalCount) {
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 '94', column '8').
      Open

          public function getPagination(App\Request $request)
          {
              $viewer = $this->getViewer($request);
              $cvId = $request->getByType('viewname', 2);
              $pageNumber = $request->getInteger('page');
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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_Record_Model' in method 'getRelationPagination'.
      Open

              $parentRecordModel = Vtiger_Record_Model::getInstanceById($parentId, $moduleName);
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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\CustomView' in method 'getPagination'.
      Open

                  $pageNumber = App\CustomView::getCurrentPage($moduleName, $cvId);
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 'getPagination'.
      Open

                      $listViewModel->set('advancedConditions', \App\Condition::validAdvancedConditions($advancedConditions));
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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_ListView_Model' in method 'getPagination'.
      Open

                  $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $cvId);
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 'getPagination'.
      Open

                  $searchParams = App\Condition::validSearchParams($moduleName, $request->getArray('search_params'));
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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 "noOfEntries" 4 times.
      Open

              $pagingModel->set('noOfEntries', $request->getInteger('noOfEntries'));
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                  if (!$request->isEmpty('search_key', true) && !$request->isEmpty('search_value', true)) {
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

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

                  $pagingModel->set('totalCount', (int) $totalCount);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                  if ($advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : []) {
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

              if ($request->has('entityState')) {
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

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

                  if (!$request->isEmpty('search_key', true) && !$request->isEmpty('search_value', true)) {
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.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('PAGING_MODEL', $pagingModel);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

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

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

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('PAGE_NUMBER', $pageNumber);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('LISTVIEW_COUNT', $totalCount);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('START_PAGIN_FROM', $pagingModel->getStartPagingFrom());
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('START_PAGIN_FROM', $startPaginFrom);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('TOTAL_ENTRIES', $totalCount);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('PAGE_NUMBER', $pageNumber);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('PAGE_COUNT', $pagingModel->getPageCount());
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('LISTVIEW_COUNT', (int) $totalCount);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('PAGE_COUNT', $pageCount);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

      Call to undeclared method \Vtiger_Viewer::assign
      Open

              $viewer->assign('PAGING_MODEL', $pagingModel);
      Severity: Critical
      Found in modules/Vtiger/views/Pagination.php by phan

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

                      $transformedSearchParams = $listViewModel->getQueryGenerator()->parseBaseSearchParamsToCondition($searchParams);
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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_Pagination_View extends Vtiger_IndexAjax_View

      The class Vtiger_Pagination_View is not named in CamelCase.
      Open

      class Vtiger_Pagination_View extends Vtiger_IndexAjax_View
      {
          public function __construct()
          {
              parent::__construct();
      Severity: Minor
      Found in modules/Vtiger/views/Pagination.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

                  $pageNumber = 1;

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

              $relationListView = Vtiger_RelationListView_Model::getInstance($parentRecordModel, $relatedModuleName);

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

              $this->exposeMethod('getPagination');

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

              $pagingModel = new Vtiger_Paging_Model();

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

              $parentId = $request->getInteger('record');

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

              $this->exposeMethod('getRelationPagination');

      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

          {

      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

              $parentRecordModel = Vtiger_Record_Model::getInstanceById($parentId, $moduleName);

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

              $viewer->assign('START_PAGIN_FROM', $startPaginFrom);

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

                  $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $cvId);

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

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

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

              if (empty($pageNumber)) {

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

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

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

              if (!$parentId || !\App\Privilege::isPermitted($moduleName, 'DetailView', $parentId)) {

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

              $pagingModel->set('viewid', $cvId);

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

                  if (!$request->isEmpty('search_key', true) && !$request->isEmpty('search_value', 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

                  $pagingModel->set('totalCount', $totalCount);

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

              $viewer->assign('TOTAL_ENTRIES', $totalCount);

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

              $viewer->assign('PAGE_COUNT', $pagingModel->getPageCount());

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

              $viewer->assign('PAGING_MODEL', $pagingModel);

      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('PAGING_MODEL', $pagingModel);

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

                  }

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

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

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

              }

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

                  $pagingModel->set('nextPageExists', ($totalCount > $pageNumber * $pagingModel->getPageLimit()));

      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

              if ($request->has('entityState')) {

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

              $viewer->assign('LISTVIEW_COUNT', (int) $totalCount);

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

              $startPaginFrom = $pagingModel->getStartPagingFrom();

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

              $viewer->assign('PAGE_NUMBER', $pageNumber);

      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

              $pagingModel = new Vtiger_Paging_Model();

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

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

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

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

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

              $totalCount = (int) $relationListView->getRelatedEntriesCount();

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

              if (!empty($totalCount)) {

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

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

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

              $pagingModel->set('noOfEntries', $request->getInteger('noOfEntries'));

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

                  $pagingModel->set('totalCount', (int) $totalCount);

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

                  $pageNumber = App\CustomView::getCurrentPage($moduleName, $cvId);

      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::performance('LISTVIEW_COMPUTE_PAGE_COUNT') || -1 == $totalCount) {

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

              if (!empty($totalCount)) {

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

                  $totalCount = false;

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

              }

      Line exceeds 120 characters; contains 124 characters
      Open

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

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

                  $totalCount = $listViewModel->getListViewCount();

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

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

      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

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

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

              $viewer->assign('PAGE_NUMBER', $pageNumber);

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

          public function getRelationPagination(App\Request $request)

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

              $pageNumber = $request->getInteger('page');

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

              }

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

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

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

                  $cvId = App\CustomView::getInstance($moduleName)->getViewId();

      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('LISTVIEW_COUNT', $totalCount);

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

              $pageCount = $pagingModel->getPageCount();

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

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

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

              if (empty($cvId)) {

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

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

      Line exceeds 120 characters; contains 128 characters
      Open

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

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

                  $pagingModel->calculatePageRange($totalCount);

      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

          }

      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

              $pagingModel->set('page', $pageNumber);

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

          }

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

              $pagingModel->set('page', $pageNumber);

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

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

      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

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

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

                  if ($request->has('entityState')) {

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

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

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

                  }

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

              } else {

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

              $viewer->assign('PAGE_COUNT', $pageCount);

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

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

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

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

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

                  $operator = 's';

      Line exceeds 120 characters; contains 166 characters
      Open

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

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

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

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

              }

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

              $pageNumber = $request->getInteger('page');

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

              if (empty($pageNumber)) {

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

              $pagingModel->set('noOfEntries', $request->getInteger('noOfEntries'));

      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('START_PAGIN_FROM', $pagingModel->getStartPagingFrom());

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

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

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

      class Vtiger_Pagination_View extends Vtiger_IndexAjax_View

      There are no issues that match your filters.

      Category
      Status