YetiForceCompany/YetiForceCRM

View on GitHub
app/PrivilegeAdvanced.php

Summary

Maintainability
A
1 hr
Test Coverage
F
48%

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

    public static function checkPermissions($record, $moduleName, $userId)
    {
        $privileges = static::get($moduleName);
        if (false === $privileges) {
            return false;
Severity: Minor
Found in app/PrivilegeAdvanced.php - About 35 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function reloadCache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function reloadCache()
    {
        $db = Db::getInstance('admin');
        $query = (new Db\Query())->from('a_#__adv_permission')->where(['status' => 0])->orderBy(['priority' => SORT_DESC]);
        $dataReader = $query->createCommand($db)->query();
Severity: Minor
Found in app/PrivilegeAdvanced.php - About 25 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

Missing class import via use statement (line '90', column '17').
Open

            $test = (new \VTJsonCondition())->evaluate($privilege['conditions'], $recordModel);
Severity: Minor
Found in app/PrivilegeAdvanced.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\PrivilegeUtil' in method 'reloadCache'.
Open

                    $users = array_merge($users, PrivilegeUtil::getUserByMember($member));
Severity: Minor
Found in app/PrivilegeAdvanced.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\Db' in method 'reloadCache'.
Open

        $db = Db::getInstance('admin');
Severity: Minor
Found in app/PrivilegeAdvanced.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 'checkPermissions'.
Open

                Log::trace("Check advanced permissions test OK,action: {$privilege['action']},id: $id");
Severity: Minor
Found in app/PrivilegeAdvanced.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 'checkPermissions'.
Open

            Log::trace("Check advanced permissions test FALSE , id: $id");
Severity: Minor
Found in app/PrivilegeAdvanced.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\Json' in method 'reloadCache'.
Open

            $members = \App\Json::decode($row['members']);
Severity: Minor
Found in app/PrivilegeAdvanced.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\Utils' in method 'reloadCache'.
Open

        $content = '<?php return ' . Utils::varExport($cache) . ';' . PHP_EOL;
Severity: Minor
Found in app/PrivilegeAdvanced.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\Cache' in method 'reloadCache'.
Open

        \App\Cache::resetFileCache(static::$cacheFile);
Severity: Minor
Found in app/PrivilegeAdvanced.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 'checkPermissions'.
Open

            $recordModel = \Vtiger_Record_Model::getInstanceById($record, $moduleName);
Severity: Minor
Found in app/PrivilegeAdvanced.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 'get'.
Open

        $tabid = Module::getModuleId($moduleName);
Severity: Minor
Found in app/PrivilegeAdvanced.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 'checkPermissions'.
Open

        Log::trace("Check advanced permissions: $record,$moduleName,$userId");
Severity: Minor
Found in app/PrivilegeAdvanced.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 "members" 3 times.
Open

            $members = \App\Json::decode($row['members']);
Severity: Critical
Found in app/PrivilegeAdvanced.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 "conditions" 3 times.
Open

                'conditions' => $row['conditions'],
Severity: Critical
Found in app/PrivilegeAdvanced.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 "action" 4 times.
Open

                'action' => $row['action'],
Severity: Critical
Found in app/PrivilegeAdvanced.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 \App\Db\Query::from
Open

        $query = (new Db\Query())->from('a_#__adv_permission')->where(['status' => 0])->orderBy(['priority' => SORT_DESC]);
Severity: Critical
Found in app/PrivilegeAdvanced.php by phan

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

            Log::trace("Check advanced permissions test FALSE , id: $id");
Severity: Critical
Found in app/PrivilegeAdvanced.php by phan

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

                Log::trace("Check advanced permissions test OK,action: {$privilege['action']},id: $id");
Severity: Critical
Found in app/PrivilegeAdvanced.php by phan

false to array comparison
Open

        if (false === $privileges) {
Severity: Info
Found in app/PrivilegeAdvanced.php by phan

Returning type false but get() is declared to return array
Open

        return static::$cache[$tabid] ?? false;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phan

Suspicious array access to false
Open

        return static::$cache[$tabid] ?? false;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phan

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

        Log::trace("Check advanced permissions: $record,$moduleName,$userId");
Severity: Critical
Found in app/PrivilegeAdvanced.php by phan

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 16 and the first side effect is on line 5.
Open

<?php
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        $db = Db::getInstance('admin');
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpmd

ShortVariable

Since: 0.2

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

Example

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

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

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

     * Update advanced permissions cache.
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                $users = array_unique($users);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        while ($row = $dataReader->read()) {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            if (!empty($members)) {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                foreach ($members as &$member) {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     * @param string $moduleName
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            static::$webservice = true;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            return false;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        $dataReader = $query->createCommand($db)->query();
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            ];
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        $content = '<?php return ' . Utils::varExport($cache) . ';' . PHP_EOL;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     * Load advanced permission rules for specific module.
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            $members = \App\Json::decode($row['members']);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     * Check advanced permissions.
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        if (false === static::$cache) {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            static::$cache = require static::$cacheFile;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    protected static $cacheFile = 'user_privileges/advancedPermission.php';
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            if (!isset($privilege['members'][$userId])) {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                return 0 === $privilege['action'] ? 1 : 0;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        return false;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    public static function reloadCache()
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

Line exceeds 120 characters; contains 123 characters
Open

        $query = (new Db\Query())->from('a_#__adv_permission')->where(['status' => 0])->orderBy(['priority' => SORT_DESC]);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     * @return bool|int
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    protected static $cache = false;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            $cache[$row['tabid']][$row['id']] = [
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     * @param int    $record
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    public static $webservice = true;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     * @param mixed  $userId
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     * @return array
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                    $users = array_merge($users, PrivilegeUtil::getUserByMember($member));
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                'action' => $row['action'],
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            $users = [];
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                'conditions' => $row['conditions'],
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        \App\Cache::resetFileCache(static::$cacheFile);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    public static function get($moduleName)
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        if (false === $privileges) {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        foreach ($privileges as $id => &$privilege) {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        $query = (new Db\Query())->from('a_#__adv_permission')->where(['status' => 0])->orderBy(['priority' => SORT_DESC]);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        $tabid = Module::getModuleId($moduleName);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     * @param string $moduleName
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            static::$webservice = false;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                Log::trace("Check advanced permissions test OK,action: {$privilege['action']},id: $id");
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        $cache = [];
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                'members' => array_flip($users),
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        file_put_contents(static::$cacheFile, $content, LOCK_EX);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        Log::trace("Check advanced permissions: $record,$moduleName,$userId");
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            $recordModel = \Vtiger_Record_Model::getInstanceById($record, $moduleName);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            $test = (new \VTJsonCondition())->evaluate($privilege['conditions'], $recordModel);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            Log::trace("Check advanced permissions test FALSE , id: $id");
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        $db = Db::getInstance('admin');
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        return static::$cache[$tabid] ?? false;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    public static function checkPermissions($record, $moduleName, $userId)
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

        $privileges = static::get($moduleName);
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

            if ($test) {
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

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

                continue;
Severity: Minor
Found in app/PrivilegeAdvanced.php by phpcodesniffer

There are no issues that match your filters.

Category
Status