YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/models/Paging.php

Summary

Maintainability
A
55 mins
Test Coverage
B
86%

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

    public function calculatePageRange($recordCount)
    {
        $rangeInfo = [];
        $pageLimit = $this->getPageLimit();
        $this->set('prevPageExists', true);
Severity: Minor
Found in modules/Vtiger/models/Paging.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 calculatePageRange uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            //Disable previous page only if page is first page and no records exists
            if (1 === $this->getCurrentPage()) {
                $this->set('prevPageExists', false);
            }
Severity: Minor
Found in modules/Vtiger/models/Paging.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\Config' in method 'getPageLimit'.
Open

            $pageLimit = \App\Config::main('list_max_entries_per_page');
Severity: Minor
Found in modules/Vtiger/models/Paging.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 calculatePageRange uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $rangeInfo['end'] = $prevPageLastRecordSequence + $pageLimit;
            }
Severity: Minor
Found in modules/Vtiger/models/Paging.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

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

        } else {
            $pageCount = $this->get('page');
        }
Severity: Minor
Found in modules/Vtiger/models/Paging.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

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

            return $rangeInfo['start'];
Severity: Critical
Found in modules/Vtiger/models/Paging.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 "prevPageExists" 5 times.
Open

        if ($this->has('prevPageExists')) {
Severity: Critical
Found in modules/Vtiger/models/Paging.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 "range" 4 times.
Open

        if ($this->has('range')) {
Severity: Critical
Found in modules/Vtiger/models/Paging.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

        if ($this->has('totalCount')) {
Severity: Critical
Found in modules/Vtiger/models/Paging.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 "noOfEntries" 3 times.
Open

        return $this->getPageLimit() * ((int) $this->getCurrentPage() - 1) + (int) $this->get('noOfEntries');
Severity: Critical
Found in modules/Vtiger/models/Paging.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 "nextPageExists" 4 times.
Open

        if ($this->has('nextPageExists')) {
Severity: Critical
Found in modules/Vtiger/models/Paging.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.

Saw unextractable annotation for comment '* @return <integer>'</integer>
Open

     * @return <Integer>
Severity: Info
Found in modules/Vtiger/models/Paging.php by phan

Saw unextractable annotation for comment '* @return <number>'</number>
Open

     * @return <Number>
Severity: Info
Found in modules/Vtiger/models/Paging.php by phan

Saw unextractable annotation for comment '* @return <integer>'</integer>
Open

     * @return <Integer>
Severity: Info
Found in modules/Vtiger/models/Paging.php by phan

Saw unextractable annotation for comment '* @return <number>'</number>
Open

     * @return <Number>
Severity: Info
Found in modules/Vtiger/models/Paging.php by phan

Saw unextractable annotation for comment '* @return <array> - array of values'</array>
Open

     * @return <array> - array of values
Severity: Info
Found in modules/Vtiger/models/Paging.php by phan

Saw unextractable annotation for comment '* @return <int> - Number of pages'</int>
Open

     * @return <int> - Number of pages
Severity: Info
Found in modules/Vtiger/models/Paging.php by phan

Saw unextractable annotation for comment '* @return <int> - number of page'</int>
Open

     * @return <int> - number of page
Severity: Info
Found in modules/Vtiger/models/Paging.php by phan

Saw unextractable annotation for comment '* @return <number>'</number>
Open

     * @return <Number>
Severity: Info
Found in modules/Vtiger/models/Paging.php by phan

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

            $prevPageLastRecordSequence = (($this->getCurrentPage() - 1) * $pageLimit);
Severity: Minor
Found in modules/Vtiger/models/Paging.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_Paging_Model extends \App\Base

The class Vtiger_Paging_Model is not named in CamelCase.
Open

class Vtiger_Paging_Model extends \App\Base
{
    const DEFAULT_PAGE = 1;
    const PAGE_LIMIT = 20;
    const PAGE_MAX_LIMIT = 9999999;
Severity: Minor
Found in modules/Vtiger/models/Paging.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

     */

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

        $currentPage = $this->get('page');

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

    public function getCurrentPage()

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

        }

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

            return $rangeInfo['start'];

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

     *

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

    const DEFAULT_PAGE = 1;

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

     * Function to get the current page number.

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

     * @return <Number>

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

            if (empty($pageLimit)) {

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

            $rangeInfo = $this->getRecordRange();

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 get the Next page number.

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

        if ($this->has('range')) {

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

     * @return <array> - array of values

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

        return $currentPage;

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

    }

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

        $pageLimit = $this->getPageLimit();

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

        return ($currentPage - 1) * $pageLimit;

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 getRecordStartRange()

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

     * @return <Integer>

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

    public function getRecordEndRange()

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 getRecordRange()

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

    public function getNextPage()

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

     * Function to get the limit on the number of records per 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

            $pageLimit = \App\Config::main('list_max_entries_per_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

        if (empty($pageLimit)) {

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

    {

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

     *

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

     *

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

    /**

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

     * Retrieves start and end sequence number of records in the 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

        if (empty($currentPage)) {

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

            $currentPage = self::DEFAULT_PAGE;

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

        if (empty($currentPage)) {

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

                $pageLimit = self::PAGE_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

        return $this->getPageLimit() * ((int) $this->getCurrentPage() - 1) + (int) $this->get('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

    /**

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

     *

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

     * @return <Number>

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

        $currentPage = $this->get('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

    public function getPageLimit()

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

    {

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

        $pageLimit = $this->get('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

    const PAGE_LIMIT = 20;

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

    const PAGE_MAX_LIMIT = 9999999;

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 getStartIndex()

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

            $rangeInfo = $this->getRecordRange();

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

    {

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

     * @return <Number>

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

        return (int) $pageLimit;

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

        $currentPage = $this->getCurrentPage();

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

     * Retrieves start sequence number of records in the page.

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

        return $this->getPageLimit() * ((int) $this->getCurrentPage() - 1);

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

     * Retrieves end sequence number of records in the 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

    /**

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

     * @return <Integer>

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

    /**

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

            return $rangeInfo['end'];

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

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

            $rangeInfo['start'] = $prevPageLastRecordSequence + 1;

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

     * Function to return the page number where pagination begins.

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

        }

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

            }

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

    }

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

     *

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

     *                 - start key which gives start sequence number

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

        $pageLimit = $this->getPageLimit();

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

        $this->set('prevPageExists', true);

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

                $this->set('prevPageExists', false);

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

                $this->set('prevPageExists', false);

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

     * Function to return info about the number of pages.

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

        $pageLimit = $this->getPageLimit();

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

     * Function to specify if previous page exists.

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

     * @return bool

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 ($this->has('nextPageExists')) {

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

    {

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

                $this->set('nextPageExists', false);

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 getPageCount()

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

        if ($pageNumber == $totalCount && 1 != $pageNumber) {

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

        return $startPaginFrom;

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

            //Have less number of records than the page limit

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

            //Disable previous page only if page is first page and no records exists

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

        $pageNumber = $this->get('page');

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

        $startPaginFrom = $pageNumber - 2;

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

    /**

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

            $currentPage = self::DEFAULT_PAGE;

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

        return $currentPage + 1;

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

        if ($this->has('range')) {

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

    /**

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

     *                 - end key which gives end sequence number

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

     *

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

     * @return bool

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

            $prevPageLastRecordSequence = (($this->getCurrentPage() - 1) * $pageLimit);

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

        return $pageCount;

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

        }

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

            $startPaginFrom = 1;

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

    }

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

        return true;

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

    /**

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

            $this->set('range', $rangeInfo);

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

        if ($this->has('totalCount')) {

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

            $pageCount = $this->get('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

        if ($this->has('prevPageExists')) {

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

    {

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

        return true;

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

     * @param int $recordCount

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

                $rangeInfo['end'] = $prevPageLastRecordSequence + $pageLimit;

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

        }

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

    /**

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

    public function getStartPagingFrom()

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

        return $this->get('range');

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

            $this->set('nextPageExists', false);

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

        return $this;

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

     *

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

    {

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

        } else {

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

            return $this->get('nextPageExists');

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

     * @return Vtiger_Paging_Model

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

    public function isNextPageExists()

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

        if ($this->has('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

            if ($recordCount < $pageLimit) {

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

    /**

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

            $totalCount = $this->get('totalCount');

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

     * calculates page range.

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 calculatePageRange($recordCount)

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

    public function isPrevPageExists()

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

     * Function to specify if next page exists.

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

            return $this->get('noOfEntries') == $this->getPageLimit();

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

        $rangeInfo = [];

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

                $rangeInfo['end'] = $prevPageLastRecordSequence + $recordCount;

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

        if (0 == $pageCount) {

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 === $this->getCurrentPage()) {

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

        }

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

     * @return <int> - Number of pages

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

        $totalCount = $this->get('totalCount');

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

            $startPaginFrom = $pageNumber - 4;

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

        if ($startPaginFrom <= 0 || 1 == $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

     */

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

            if (1 === $rangeInfo['start']) {

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

            $pageCount = 1;

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

            return $this->get('prevPageExists');

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

     */

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

            $pageCount = ceil($totalCount / (int) $pageLimit);

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

            //specifies what sequencce number of last record in prev 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

     *

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

     * @return <int> - number of page

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

class Vtiger_Paging_Model extends \App\Base

There are no issues that match your filters.

Category
Status