YetiForceCompany/YetiForceCRM

View on GitHub
vtlib/Vtiger/Deprecated.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
53%

Function getPermittedModuleIdList has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

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

    public static function getCurrentUserEntityFieldNameDisplay($module, $fieldsName, $fieldValues)
    {
        if (false === strpos($fieldsName, ',')) {
            return $fieldValues[$fieldsName];
        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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

The method getPermittedModuleIdList() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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

Avoid using undefined variables such as '$formattedNameList' which will lead to PHP notices.
Open

            $formattedNameListString = implode(",'" . $glue . "',", $formattedNameList);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$profileTabsPermission' which will lead to PHP notices.
Open

                if (0 === $seq_value && isset($profileTabsPermission[$tabid]) && 0 === $profileTabsPermission[$tabid]) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$formattedNameList' which will lead to PHP notices.
Open

                $formattedNameList[] = $input[$value];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$is_admin' which will lead to PHP notices.
Open

        if (false === $is_admin && 1 == $profileGlobalPermission[1]
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$profileGlobalPermission' which will lead to PHP notices.
Open

        if (false === $is_admin && 1 == $profileGlobalPermission[1]
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$profileTabsPermission' which will lead to PHP notices.
Open

                if (0 === $seq_value && isset($profileTabsPermission[$tabid]) && 0 === $profileTabsPermission[$tabid]) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$profileGlobalPermission' which will lead to PHP notices.
Open

            && 1 == $profileGlobalPermission[2]) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Missing class import via use statement (line '98', column '14').
Open

            throw new \App\Exceptions\AppException('Sorry! Attempt to access restricted file.');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 '75', column '14').
Open

            throw new \App\Exceptions\AppException('Sorry! Attempt to access restricted file.');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 '147', column '22').
Open

        $dataReader = (new \App\Db\Query())->select(['blockid'])
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 '107', column '14').
Open

            throw new \App\Exceptions\AppException('Sorry! Attempt to access restricted file.');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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\Field' in method 'getCurrentUserEntityFieldNameDisplay'.
Open

            if ('Users' === $module || \App\Field::getColumnPermission($module, $field)) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 'getSqlForNameInDisplayFormat'.
Open

        $entityFieldInfo = \App\Module::getEntityInfo($module);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 'checkFileAccess'.
Open

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($filepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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\Field' in method 'getColumnFields'.
Open

        foreach (\App\Field::getModuleFieldInfosByPresence($module) as $fieldInfo) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 'checkFileAccessForDeletion'.
Open

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 'checkFileAccessForInclusion'.
Open

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 getSqlForNameInDisplayFormat uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $formattedNameListString = $input[$fieldsName];
        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 getPermittedModuleIdList uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            foreach ($tab_seq_array as $tabid => $seq_value) {
                if (0 === $seq_value) {
                    $permittedModules[] = ($tabid);
                }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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\Log' in method 'getColumnFields'.
Open

        \App\Log::trace('Entering getColumnFields(' . $module . ') method ...');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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\User' in method 'getPermittedModuleIdList'.
Open

        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 'getFullNameFromArray'.
Open

        $entityInfo = \App\Module::getEntityInfo($module);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 'getColumnFields'.
Open

        \App\Log::trace('Exiting getColumnFields method ...');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 'getPermittedModuleIdList'.
Open

        $homeTabid = \App\Module::getModuleId('Home');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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 ") - Sorry! Attempt to access restricted file. realfilepath: " 3 times.
Open

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Critical
Found in vtlib/Vtiger/Deprecated.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 "Sorry! Attempt to access restricted file." 3 times.
Open

            throw new \App\Exceptions\AppException('Sorry! Attempt to access restricted file.');
Severity: Critical
Found in vtlib/Vtiger/Deprecated.php by sonar-php

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

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

Noncompliant Code Example

With the default threshold of 3:

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

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

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

Avoid unused local variables such as '$is_admin'.
Open

        if (false === $is_admin && 1 == $profileGlobalPermission[1]
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

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

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

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($filepath, true));
Severity: Critical
Found in vtlib/Vtiger/Deprecated.php by phan

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

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Critical
Found in vtlib/Vtiger/Deprecated.php by phan

Variable $formattedNameList was undeclared, but array fields are being added to it.
Open

                $formattedNameList[] = $input[$value];
Severity: Info
Found in vtlib/Vtiger/Deprecated.php by phan

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

        \App\Log::trace('Entering getColumnFields(' . $module . ') method ...');
Severity: Critical
Found in vtlib/Vtiger/Deprecated.php by phan

Variable $tab_seq_array is undeclared
Open

            foreach ($tab_seq_array as $tabid => $seq_value) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phan

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

        \App\Log::trace('Exiting getColumnFields method ...');
Severity: Critical
Found in vtlib/Vtiger/Deprecated.php by phan

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

        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
Severity: Critical
Found in vtlib/Vtiger/Deprecated.php by phan

Variable $profileGlobalPermission is undeclared
Open

        if (false === $is_admin && 1 == $profileGlobalPermission[1]
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phan

Variable $tab_seq_array is undeclared
Open

            foreach ($tab_seq_array as $tabid => $seq_value) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phan

Variable $profileGlobalPermission is undeclared
Open

            && 1 == $profileGlobalPermission[2]) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phan

Variable $is_admin is undeclared
Open

        if (false === $is_admin && 1 == $profileGlobalPermission[1]
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phan

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

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Critical
Found in vtlib/Vtiger/Deprecated.php by phan

Call to undeclared method \App\Db\Query::select
Open

        $dataReader = (new \App\Db\Query())->select(['blockid'])
Severity: Critical
Found in vtlib/Vtiger/Deprecated.php by phan

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

                if (0 === $seq_value && isset($profileTabsPermission[$tabid]) && 0 === $profileTabsPermission[$tabid]) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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

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

            $formattedNameListString = implode(",'" . $glue . "',", $formattedNameList);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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

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

        if (false === $is_admin && 1 == $profileGlobalPermission[1]
Severity: Minor
Found in vtlib/Vtiger/Deprecated.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

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

    public static function getFullNameFromArray($module, $fieldValues)
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param3 $fieldValues - array of fieldname and its value
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $entityInfo = \App\Module::getEntityInfo($module);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * this function returns the entity field name for a given module; for e.g. for Contacts module it return concat(lastname, ' ', firstname).
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @return string $fieldConcatName - the entity field name for the module
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (false === strpos($fieldsName, ',')) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function getCurrentUserEntityFieldNameDisplay($module, $fieldsName, $fieldValues)
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $fieldsName = $entityInfo['fieldname'];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param mixed $fieldsName
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            return $fieldValues[$fieldsName];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * and it exists.
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            ->where(['label' => $label])
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

                $accessibleFieldNames[] = $fieldValues[$field];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function checkFileAccessForDeletion($filepath)
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            throw new \App\Exceptions\AppException('Sorry! Attempt to access restricted file.');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * This function is used to get the blockid of the settings block for a given label.
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function getSettingsBlockId($label)
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            $formattedNameListString = implode(",'" . $glue . "',", $formattedNameList);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param string $module
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function getPermittedModuleIdList()
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

                    $permittedModules[] = ($tabid);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param1 $module - name of the module
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param mixed $fieldValues
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = str_replace('\\\\', '\\', $realfilepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    /** Function to check the file access is made within web root directory. */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @return bool true if file is a valid file within vtiger root directory, false otherwise
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (1 === $dataReader->count()) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

                if (0 === $seq_value && isset($profileTabsPermission[$tabid]) && 0 === $profileTabsPermission[$tabid]) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        return self::getCurrentUserEntityFieldNameDisplay($module, $fieldsName, $fieldValues);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    /** Function to check the file deletion within the deletable (safe) directories */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        /** Replace all \\ with \ first */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (!self::isFileAccessible($filepath)) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

Line exceeds 120 characters; contains 150 characters
Open

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($filepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        /** Replace all \\ with \ first */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $blockId = 0;
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    /**
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param2 $fieldsName - fieldname with respect to module (ex : 'Accounts' - 'accountname', 'Contacts' - 'lastname','firstname')
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param mixed $module
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = realpath($filepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

Line exceeds 120 characters; contains 154 characters
Open

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $safeDirectories = ['storage', 'cache', 'test'];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $rootdirpath = str_replace('\\\\', '\\', ROOT_DIRECTORY . \DIRECTORY_SEPARATOR);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @return int
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @return array
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $accessibleFieldNames = [];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function checkFileAccess($filepath)
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($filepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            foreach ($fieldsName as &$value) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        return 'CONCAT(' . $formattedNameListString . ')';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function getColumnFields($module)
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        return $columnFields;
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * Function to get the permitted module id Array with presence as 0.
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @return array Array of accessible tabids
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

Line exceeds 120 characters; contains 143 characters
Open

     * this function returns the entity field name for a given module; for e.g. for Contacts module it return concat(lastname, ' ', firstname).
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

Line exceeds 120 characters; contains 132 characters
Open

     * @param2 $fieldsName - fieldname with respect to module (ex : 'Accounts' - 'accountname', 'Contacts' - 'lastname','firstname')
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $rootdirpath = str_replace('\\\\', '\\', ROOT_DIRECTORY . \DIRECTORY_SEPARATOR);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $rootdirpath = str_replace('\\\\', '\\', ROOT_DIRECTORY . \DIRECTORY_SEPARATOR);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        /** Replace all \ with / now */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $fieldsName = $entityFieldInfo['fieldnameArr'];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        foreach (explode(',', $fieldsName) as $field) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        /** Replace all \ with / now */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $relativeFilePath = str_replace($rootdirpath, '', $realfilepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = realpath($filepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

Line exceeds 120 characters; contains 154 characters
Open

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = realpath($filepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        return true;
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        } else {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            $formattedNameListString = $input[$fieldsName];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

Line exceeds 120 characters; contains 124 characters
Open

    /** Function to check the file access is made within web root directory and whether it is not from unsafe directories */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $filePathParts = explode('/', $relativeFilePath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            throw new \App\Exceptions\AppException('Sorry! Attempt to access restricted file.');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * function to return whether the file access is made within vtiger root directory
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $columnFields = [];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        } else {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function checkFileAccessForInclusion($filepath)
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = str_replace('\\\\', '\\', $realfilepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $rootdirpath = str_replace('\\', '/', $rootdirpath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        \App\Log::trace('Entering getColumnFields(' . $module . ') method ...');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

                }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            if ('Users' === $module || \App\Field::getColumnPermission($module, $field)) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    /** Function to check the file access is made within web root directory and whether it is not from unsafe directories */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        /** Replace all \\ with \ first */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (0 !== stripos($realfilepath, $rootdirpath) || \in_array($filePathParts[0], $unsafeDirectories)) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            throw new \App\Exceptions\AppException('Sorry! Attempt to access restricted file.');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = str_replace('\\', '/', $realfilepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function isFileAccessible($filepath)
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param string $label
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $dataReader = (new \App\Db\Query())->select(['blockid'])
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $dataReader->close();
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        return $blockId;
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    public static function getSqlForNameInDisplayFormat($input, $module, $glue = ' ')
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        \App\Log::trace('Exiting getColumnFields method ...');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            foreach ($tab_seq_array as $tabid => $seq_value) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $unsafeDirectories = ['storage', 'cache', 'test'];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (0 !== stripos($realfilepath, $rootdirpath)) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    /**
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            ->from('vtiger_settings_blocks')
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            $blockId = $dataReader->readColumn(0);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (\is_array($fieldsName)) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

                $formattedNameList[] = $input[$value];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    /**
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $rootdirpath = str_replace('\\', '/', $rootdirpath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = str_replace('\\', '/', $realfilepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * Gets fields for module.
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     *
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (\count($accessibleFieldNames) > 0) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        return '';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $rootdirpath = str_replace('\\', '/', $rootdirpath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (0 !== stripos($realfilepath, $rootdirpath) || !\in_array($filePathParts[0], $safeDirectories)) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @param string $filepath relative path to the file which need to be verified
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            ->createCommand()->query();
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $entityFieldInfo = \App\Module::getEntityInfo($module);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    /**
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $permittedModules = [];
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (false === $is_admin && 1 == $profileGlobalPermission[1]
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            return implode(' ', $accessibleFieldNames);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = str_replace('\\', '/', $realfilepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

    /**
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

     * @global Users $current_user
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            && 1 == $profileGlobalPermission[2]) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

                    $permittedModules[] = ($tabid);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

                }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $homeTabid = \App\Module::getModuleId('Home');
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $filePathParts = explode('/', $relativeFilePath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            \App\Log::error(__METHOD__ . '(' . $filepath . ') - Sorry! Attempt to access restricted file. realfilepath: ' . print_r($realfilepath, true));
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        /** Replace all \ with / now */
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $relativeFilePath = str_replace($rootdirpath, '', $realfilepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        $realfilepath = str_replace('\\\\', '\\', $realfilepath);
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            return false;
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        foreach (\App\Field::getModuleFieldInfosByPresence($module) as $fieldInfo) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            $columnFields[$fieldInfo['fieldname']] = '';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            $permittedModules[] = $homeTabid;
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        if (!\in_array($homeTabid, $permittedModules)) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

                if (0 === $seq_value) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            }
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

            foreach ($tab_seq_array as $tabid => $seq_value) {
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

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

        return $permittedModules;
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpcodesniffer

The variable $seq_value is not named in camelCase.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $is_admin is not named in camelCase.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $seq_value is not named in camelCase.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $seq_value is not named in camelCase.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $tab_seq_array is not named in camelCase.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $tab_seq_array is not named in camelCase.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $seq_value is not named in camelCase.
Open

    public static function getPermittedModuleIdList()
    {
        $permittedModules = [];
        require 'user_privileges/user_privileges_' . \App\User::getCurrentUserId() . '.php';
        include 'user_privileges/tabdata.php';
Severity: Minor
Found in vtlib/Vtiger/Deprecated.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status