The class Page has an overall complexity of 54 which is very high. The configured complexity threshold is 50. Open
abstract class Page extends Base
{
/** {@inheritdoc} */
public function preProcess(\App\Request $request, $display = true)
{
- Exclude checks
Method getUserQuickMenuLinks
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getUserQuickMenuLinks(\App\Request $request): array
{
$userModel = \Users_Record_Model::getCurrentUserModel();
$headerLinks[] = [
'linktype' => 'GROUPNAME',
File Page.php
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Abstract page view controller file.
*
* @package Controller
Function getMenuHeaderLinks
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function getMenuHeaderLinks(\App\Request $request): array
{
$userModel = \App\User::getCurrentUserModel();
$headerLinks = $headerLinkInstances = [];
- Read upRead up
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 getFooterScripts
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getFooterScripts(\App\Request $request)
{
$moduleName = $request->getModule();
$jsFileNames = [
'modules.Vtiger.resources.Menu',
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getMenuHeaderLinks
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMenuHeaderLinks(\App\Request $request): array
{
$userModel = \App\User::getCurrentUserModel();
$headerLinks = $headerLinkInstances = [];
Method getFooterScripts
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFooterScripts(\App\Request $request)
{
$moduleName = $request->getModule();
$jsFileNames = [
'modules.Vtiger.resources.Menu',
Method preProcess
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function preProcess(\App\Request $request, $display = true)
{
parent::preProcess($request, false);
$view = $this->getViewer($request);
if (\App\Config::performance('BROWSING_HISTORY_WORKING')) {
Function getUserQuickMenuLinks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getUserQuickMenuLinks(\App\Request $request): array
{
$userModel = \Users_Record_Model::getCurrentUserModel();
$headerLinks[] = [
'linktype' => 'GROUPNAME',
- Read upRead up
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 preProcess
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function preProcess(\App\Request $request, $display = true)
{
parent::preProcess($request, false);
$view = $this->getViewer($request);
if (\App\Config::performance('BROWSING_HISTORY_WORKING')) {
- Read upRead up
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 getFooterScripts() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
public function getFooterScripts(\App\Request $request)
{
$moduleName = $request->getModule();
$jsFileNames = [
'modules.Vtiger.resources.Menu',
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getUserQuickMenuLinks() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
protected function getUserQuickMenuLinks(\App\Request $request): array
{
$userModel = \Users_Record_Model::getCurrentUserModel();
$headerLinks[] = [
'linktype' => 'GROUPNAME',
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getMenuHeaderLinks() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
protected function getMenuHeaderLinks(\App\Request $request): array
{
$userModel = \App\User::getCurrentUserModel();
$headerLinks = $headerLinkInstances = [];
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed. Open
protected function getMenuHeaderLinks(\App\Request $request): array
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed. Open
public function getFooterScripts(\App\Request $request)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
The class Page has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13. Open
abstract class Page extends Base
{
/** {@inheritdoc} */
public function preProcess(\App\Request $request, $display = true)
{
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The method postProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation. Open
public function postProcess(\App\Request $request, $display = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '37', column '70'). Open
$view->assign('SHOW_FOOTER_BAR', $this->showFooter() && 8 !== (new \App\YetiForce\Register())->getStatus());
- Read upRead up
- Exclude checks
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
The method preProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation. Open
public function preProcess(\App\Request $request, $display = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '120', column '27'). Open
$cssScriptModel = new \Vtiger_CssScript_Model();
- Read upRead up
- Exclude checks
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\Config' in method 'preProcess'. Open
if (\App\Config::search('GLOBAL_SEARCH_SELECT_MODULE')) {
- Read upRead up
- Exclude checks
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_Link_Model' in method 'getMenuHeaderLinks'. Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADERLINK']) as $links) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Config' in method 'preProcess'. Open
if (\App\Config::performance('GLOBAL_SEARCH')) {
- Read upRead up
- Exclude checks
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_Link_Model' in method 'getHeaderCss'. Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADERCSS']) as $cssLinks) {
- Read upRead up
- Exclude checks
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 'getFooterScripts'. Open
if (\App\User::getCurrentUserRealId() === \App\User::getCurrentUserId() && \App\Privilege::isPermitted('Chat')) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '30', column '7'). Open
public function preProcess(\App\Request $request, $display = true)
{
parent::preProcess($request, false);
$view = $this->getViewer($request);
if (\App\Config::performance('BROWSING_HISTORY_WORKING')) {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\Vtiger_Link_Model' in method 'getMenuHeaderLinks'. Open
$headerLinkInstances[] = \Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Config' in method 'preProcess'. Open
if (\App\Config::performance('BROWSING_HISTORY_WORKING')) {
- Read upRead up
- Exclude checks
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_Module_Model' in method 'preProcess'. Open
$view->assign('HOME_MODULE_MODEL', \Vtiger_Module_Model::getInstance('Home'));
- Read upRead up
- Exclude checks
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\Privilege' in method 'getFooterScripts'. Open
if (\App\User::getCurrentUserRealId() === \App\User::getCurrentUserId() && \App\Privilege::isPermitted('Chat')) {
- Read upRead up
- Exclude checks
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 'getMenuHeaderLinks'. Open
'linkdata' => ['url' => 'index.php?module=Users&view=MeetingModal&record=' . \App\User::getCurrentUserRealId()],
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Users_Privileges_Model' in method 'preProcess'. Open
$userPrivilegesModel = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
- Read upRead up
- Exclude checks
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 'getMenuHeaderLinks'. Open
if (\App\MeetingService::getInstance()->isActive() && \App\Privilege::isPermitted('Users', 'MeetingUrl', false, \App\User::getCurrentUserRealId())) {
- Read upRead up
- Exclude checks
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\Privilege' in method 'getFooterScripts'. Open
if (\App\Privilege::isPermitted('KnowledgeBase')) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Config' in method 'loadJsConfig'. Open
\App\Config::setJsEnv($key, $value);
- Read upRead up
- Exclude checks
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 'getFooterScripts'. Open
if (\App\User::getCurrentUserRealId() === \App\User::getCurrentUserId() && \App\Privilege::isPermitted('Chat')) {
- Read upRead up
- Exclude checks
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_BrowsingHistory_Helper' in method 'preProcess'. Open
\Vtiger_BrowsingHistory_Helper::saveHistory($view->getTemplateVars('PAGETITLE'));
- Read upRead up
- Exclude checks
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_Link_Model' in method 'getMenuHeaderLinks'. Open
$headerLinkInstance->addChildLink(\Vtiger_Link_Model::getInstanceFromValues($childLink));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Config' in method 'getUserQuickMenuLinks'. Open
if (\App\Config::security('SHOW_MY_PREFERENCES')) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\RecordSearch' in method 'preProcess'. Open
$view->assign('SEARCHABLE_MODULES', \App\RecordSearch::getSearchableModules());
- Read upRead up
- Exclude checks
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_Link_Model' in method 'getFooterScripts'. Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADERSCRIPT']) as $headerScripts) {
- Read upRead up
- Exclude checks
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\Privilege' in method 'getMenuHeaderLinks'. Open
if (\App\MeetingService::getInstance()->isActive() && \App\Privilege::isPermitted('Users', 'MeetingUrl', false, \App\User::getCurrentUserRealId())) {
- Read upRead up
- Exclude checks
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 'preProcess'. Open
if ($activeReminder = \App\Module::isModuleActive('Calendar')) {
- Read upRead up
- Exclude checks
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 'getMenuHeaderLinks'. Open
$userModel = \App\User::getCurrentUserModel();
- Read upRead up
- Exclude checks
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_Link_Model' in method 'getMenuHeaderLinks'. Open
$headerLinkInstance = \Vtiger_Link_Model::getInstanceFromValues($headerLink);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Users_Record_Model' in method 'getUserQuickMenuLinks'. Open
$userModel = \Users_Record_Model::getCurrentUserModel();
- Read upRead up
- Exclude checks
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_Module_Model' in method 'loadJsConfig'. Open
$moduleModel = \Vtiger_Module_Model::getInstance($request->getModule());
- Read upRead up
- Exclude checks
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_BrowsingHistory_Helper' in method 'preProcess'. Open
$view->assign('BROWSING_HISTORY', \Vtiger_BrowsingHistory_Helper::getHistory());
- Read upRead up
- Exclude checks
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\Session' in method 'getFooterScripts'. Open
if (\App\Session::has('authenticated_user_id')) {
- Read upRead up
- Exclude checks
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\Mail' in method 'getFooterScripts'. Open
if (\App\Mail::checkMailClient()) {
- Read upRead up
- Exclude checks
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 getMenuHeaderLinks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$headerLinks[] = [
'linktype' => 'HEADERLINK',
'linklabel' => 'LBL_USER_PANEL',
'linkurl' => 'index.php',
- Read upRead up
- Exclude checks
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 '\Vtiger_Menu_Model' in method 'getMenu'. Open
return \Vtiger_Menu_Model::getAll();
- Read upRead up
- Exclude checks
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 'getUserQuickMenuLinks'. Open
if (\App\Config::security('CHANGE_LOGIN_PASSWORD') && \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Users_Module_Model' in method 'getUserQuickMenuLinks'. Open
if (\Users_Module_Model::getSwitchUsers()) {
- Read upRead up
- Exclude checks
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 'getUserQuickMenuLinks'. Open
if (\App\Config::security('CHANGE_LOGIN_PASSWORD') && \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()) {
- Read upRead up
- Exclude checks
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_Link_Model' in method 'getUserQuickMenuLinks'. Open
$headerLinkInstances[] = \Vtiger_Link_Model::getInstanceFromValues($headerLink);
- Read upRead up
- Exclude checks
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_Link_Model' in method 'getHeaderAdditionalTpl'. Open
$additionalTpl[] = \Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Config' in method 'getUserQuickMenuLinks'. Open
if (\App\Config::security('CHANGE_LOGIN_PASSWORD') && \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()) {
- Read upRead up
- Exclude checks
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_Link_Model' in method 'getHeaderAdditionalTpl'. Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADER_ADDITIONAL_TPL']) as $links) {
- Read upRead up
- Exclude checks
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 'getUserQuickMenuLinks'. Open
&& $userModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Config' in method 'getUserQuickMenuLinks'. Open
&& $userModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')
- Read upRead up
- Exclude checks
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 "linkurl" 6 times. Open
'linkurl' => 'index.php?module=YetiForce&parent=Settings&view=Shop',
- Read upRead up
- Exclude checks
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 "linktype" 12 times. Open
'linktype' => 'HEADERLINK',
- Read upRead up
- Exclude checks
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 "linkclass" 9 times. Open
'linkclass' => 'js-show-modal',
- Read upRead up
- Exclude checks
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 "showModal d-block" 4 times. Open
'linkclass' => 'showModal d-block',
- Read upRead up
- Exclude checks
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 "HEADERLINK" 11 times. Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADERLINK']) as $links) {
- Read upRead up
- Exclude checks
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 "linklabel" 11 times. Open
'linklabel' => 'LBL_VIDEO_CONFERENCE',
- Read upRead up
- Exclude checks
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 "linkdata" 5 times. Open
'linkdata' => ['url' => 'index.php?module=Users&view=MeetingModal&record=' . \App\User::getCurrentUserRealId()],
- Read upRead up
- Exclude checks
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 parameters such as '$request'. Open
protected function getUserQuickMenuLinks(\App\Request $request): array
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid unused parameters such as '$request'. Open
protected function getHeaderAdditionalTpl(\App\Request $request): array
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('MENUS', $this->getMenu());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('SEARCHED_MODULE', $request->getModule());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('BROWSING_HISTORY', \Vtiger_BrowsingHistory_Helper::getHistory());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('SEARCHABLE_MODULES', \App\RecordSearch::getSearchableModules());
- Exclude checks
Return type of getUserQuickMenuLinks()
is undeclared type \App\Controller\View\Vtiger_Link_Model[]
Open
protected function getUserQuickMenuLinks(\App\Request $request): array
- Exclude checks
Class \Vtiger_Link_Model
was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties) Open
foreach ($links as $headerLink) {
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('USER_QUICK_MENU_LINKS', $this->getUserQuickMenuLinks($request));
- Exclude checks
Call to method __construct
from undeclared class \App\YetiForce\Register
Open
$view->assign('SHOW_FOOTER_BAR', $this->showFooter() && 8 !== (new \App\YetiForce\Register())->getStatus());
- Exclude checks
Call to method getCurrentUserRealId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (\App\User::getCurrentUserRealId() === \App\User::getCurrentUserId() && \App\Privilege::isPermitted('Chat')) {
- Exclude checks
Class \Vtiger_Link_Model
was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties) Open
foreach ($headerScripts as $headerScript) {
- Exclude checks
Variable $headerLinks
was undeclared, but array fields are being added to it. Open
$headerLinks[] = [
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (\App\Config::security('CHANGE_LOGIN_PASSWORD') && \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()) {
- Exclude checks
Return type of getHeaderAdditionalTpl()
is undeclared type \App\Controller\View\Vtiger_Link_Model[]
Open
protected function getHeaderAdditionalTpl(\App\Request $request): array
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (\App\User::getCurrentUserRealId() === \App\User::getCurrentUserId() && \App\Privilege::isPermitted('Chat')) {
- Exclude checks
Return type of getMenuHeaderLinks()
is undeclared type \App\Controller\View\Vtiger_Link_Model[]
Open
protected function getMenuHeaderLinks(\App\Request $request): array
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userModel = \App\User::getCurrentUserModel();
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('SHOW_BREAD_CRUMBS', $this->showBreadCrumbLine());
- Exclude checks
Call to method getStatus
from undeclared class \App\YetiForce\Register
Open
$view->assign('SHOW_FOOTER_BAR', $this->showFooter() && 8 !== (new \App\YetiForce\Register())->getStatus());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('ACTIVITY_REMINDER', \Users_Record_Model::getCurrentUserModel()->getCurrentUserActivityReminderInSeconds());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('SHOW_FOOTER', true);
- Exclude checks
Argument 1 (mixed)
is 'Calendar'
but \Users_Privileges_Model::hasModulePermission()
takes int
defined at /code/modules/Users/models/Privileges.php:101
Open
$activeReminder = $userPrivilegesModel->hasModulePermission('Calendar');
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('HEADER_ADDITIONAL_TPL', $this->getHeaderAdditionalTpl($request));
- Exclude checks
Return type of getHeaderCss()
is undeclared type \App\Controller\View\Vtiger_CssScript_Model[]
Open
public function getHeaderCss(\App\Request $request)
- Exclude checks
Call to method getCurrentUserRealId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (\App\MeetingService::getInstance()->isActive() && \App\Privilege::isPermitted('Users', 'MeetingUrl', false, \App\User::getCurrentUserRealId())) {
- Exclude checks
Call to method getCurrentUserRealId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
&& $userModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('MID', $request->getInteger('mid'));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('HOME_MODULE_MODEL', \Vtiger_Module_Model::getInstance('Home'));
- Exclude checks
Return type of getFooterScripts()
is undeclared type \App\Controller\View\Vtiger_JsScript_Model[]
Open
public function getFooterScripts(\App\Request $request)
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('MENU_HEADER_LINKS', $this->getMenuHeaderLinks($request));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('SHOW_FOOTER_BAR', $this->showFooter() && 8 !== (new \App\YetiForce\Register())->getStatus());
- Exclude checks
Class \Vtiger_Link_Model
was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties) Open
foreach ($links as $headerLink) {
- Exclude checks
Call to method getCurrentUserRealId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
'linkdata' => ['url' => 'index.php?module=Users&view=MeetingModal&record=' . \App\User::getCurrentUserRealId()],
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('REMINDER_ACTIVE', $activeReminder);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('BREADCRUMB_TITLE', $this->getBreadcrumbTitle($request));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('QUALIFIED_MODULE', $request->getModule(false));
- Exclude checks
Class \Vtiger_Link_Model
was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties) Open
foreach ($cssLinks as $cssLink) {
- Exclude checks
Call to method getCurrentUserRealId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (\App\Config::security('CHANGE_LOGIN_PASSWORD') && \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()) {
- Exclude checks
Call to undeclared method \Vtiger_Viewer::getTemplateVars
(Did you mean expr->getTemplatePath()) Open
\Vtiger_BrowsingHistory_Helper::saveHistory($view->getTemplateVars('PAGETITLE'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('MID', $request->getInteger('mid'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Config::performance('GLOBAL_SEARCH')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('SHOW_FOOTER', true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('QUALIFIED_MODULE', $request->getModule(false));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('mid')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$view->assign('ACTIVITY_REMINDER', \Users_Record_Model::getCurrentUserModel()->getCurrentUserActivityReminderInSeconds());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($display) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$activeReminder = $userPrivilegesModel->hasModulePermission('Calendar');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('BROWSING_HISTORY', \Vtiger_BrowsingHistory_Helper::getHistory());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Config::search('GLOBAL_SEARCH_SELECT_MODULE')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('SHOW_BREAD_CRUMBS', $this->showBreadCrumbLine());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($display) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::postProcess($request, false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('ACTIVITY_REMINDER', \Users_Record_Model::getCurrentUserModel()->getCurrentUserActivityReminderInSeconds());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('SHOW_FOOTER_BAR', $this->showFooter() && 8 !== (new \App\YetiForce\Register())->getStatus());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames[] = "modules.$moduleName.resources.Edit";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Config::setJsEnv($key, $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the list of Header Links.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => 'index.php',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'fas fa-house-user fa-fw',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames[] = "modules.$moduleName.resources.AdvanceFilter";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cssScriptModel = new \Vtiger_CssScript_Model();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = \Vtiger_Module_Model::getInstance($request->getModule());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the list of User Quick Menu Links.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($activeReminder = \App\Module::isModuleActive('Calendar')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userPrivilegesModel = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('HOME_MODULE_MODEL', \Vtiger_Module_Model::getInstance('Home'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modules.Vtiger.resources.Menu',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('AppComponents' !== $moduleName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_SIGN_OUT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $headerLinkInstances;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Config::performance('BROWSING_HISTORY_WORKING')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\Vtiger_BrowsingHistory_Helper::saveHistory($view->getTemplateVars('PAGETITLE'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('BREADCRUMB_TITLE', $this->getBreadcrumbTitle($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/validator/BaseValidator.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modules.Vtiger.resources.AdvanceSearch',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\MeetingService::getInstance()->isActive() && \App\Privilege::isPermitted('Users', 'MeetingUrl', false, \App\User::getCurrentUserRealId())) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_SYSTEM_SETTINGS',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinkInstances[] = $headerLinkInstance;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\User::getCurrentUserRealId() === \App\User::getCurrentUserId() && \App\Privilege::isPermitted('Chat')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Privilege::isPermitted('KnowledgeBase')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Link_Model[] - List of Vtiger_Link_Model instances
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinkInstances[] = \Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => 'index.php?module=YetiForce&parent=Settings&view=Shop',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'btn-danger d-md-none js-post-action',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->view('PageFooter.tpl');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modules.Vtiger.resources.Edit',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames[] = $headerScript->linkurl;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerCssInstances = parent::getHeaderCss($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($cssLinks as $cssLink) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->preProcessDisplay($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getMenuHeaderLinks(\App\Request $request): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFooterScripts(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_VIDEO_CONFERENCE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/validator/FieldValidator.js',
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
'linkdata' => ['url' => 'index.php?module=Users&view=MeetingModal&record=' . \App\User::getCurrentUserRealId()],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modules.Vtiger.resources.ConditionBuilder',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Session::has('authenticated_user_id')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts($jsFileNames));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function preProcess(\App\Request $request, $display = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('SEARCHED_MODULE', $request->getModule());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames[] = '~layouts/basic/modules/OSSMail/resources/checkmails.js';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$prefix = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$prefix = 'public_html/';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::loadJsConfig($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks = $headerLinkInstances = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('MENUS', $this->getMenu());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('MENU_HEADER_LINKS', $this->getMenuHeaderLinks($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('USER_QUICK_MENU_LINKS', $this->getUserQuickMenuLinks($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'isEntityModule' => $moduleModel->isEntityModule(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function showFooter()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userModel = \App\User::getCurrentUserModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Settings' !== $request->getByType('parent', 2)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'SwitchUsers',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/Field.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
] as $key => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinkInstance->addChildLink(\Vtiger_Link_Model::getInstanceFromValues($childLink));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Config::security('SHOW_MY_PREFERENCES')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
('PLL_PASSWORD_2FA' === $userModel->get('login_method') || 'PLL_LDAP_2FA' === $userModel->get('login_method'))
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
('PLL_PASSWORD_2FA' === $userModel->get('login_method') || 'PLL_LDAP_2FA' === $userModel->get('login_method'))
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'BTN_YOUR_ACCOUNT_ACCESS_HISTORY',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkdata' => ['url' => 'index.php?module=Users&view=LoginHistoryModal&mode=change&record=' . $userModel->get('id')],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => 'index.php?module=Users&parent=Settings&action=Logout',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getMenu()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('HEADER_ADDITIONAL_TPL', $this->getHeaderAdditionalTpl($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('SEARCHABLE_MODULES', \App\RecordSearch::getSearchableModules());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function postProcess(\App\Request $request, $display = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!IS_PUBLIC_DIR) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADERCSS']) as $cssLinks) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $headerCssInstances;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function showBodyHeader()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($links as $headerLink) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'mdi mdi-card-account-phone c-mdi',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => 'index.php?module=Users&parent=Settings&action=Logout',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'showModal d-block',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'showModal d-block',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinkInstances = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \Vtiger_Menu_Model::getAll();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get the list of additional TPL files to show in the header.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$additionalTpl[] = \Vtiger_Link_Model::getInstanceFromLinkObject($headerLink);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::preProcess($request, false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('REMINDER_ACTIVE', $activeReminder);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\App\RequestUtil::getBrowserInfo()->ie) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames[] = '~layouts/resources/views/KnowledgeBase/KnowledgeBase.vue.js';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function loadJsConfig(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'isQuickCreateSupported' => $moduleModel->isQuickCreateSupported(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($headerLinks as $headerLink) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
'linkdata' => ['url' => 'index.php?module=Users&view=LoginHistoryModal&mode=change&record=' . $userModel->get('id')],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($headerLinks as $headerLink) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modules.Vtiger.resources.BasicSearch',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Mail::checkMailClient()) {
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
if (\App\User::getCurrentUserRealId() === \App\User::getCurrentUserId() && \App\Privilege::isPermitted('Chat')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames[] = '~layouts/basic/modules/Chat/Chat.vue.js';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getHeaderCss(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
if (\App\MeetingService::getInstance()->isActive() && \App\Privilege::isPermitted('Users', 'MeetingUrl', false, \App\User::getCurrentUserRealId())) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
'linkdata' => ['url' => 'index.php?module=Users&view=PasswordModal&mode=change&record=' . $userModel->getId()],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
&& $userModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
&& $userModel->getId() === \App\User::getCurrentUserRealId() && 'TOTP_OFF' !== \App\Config::security('USER_AUTHY_MODE')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
if (\App\Config::security('CHANGE_LOGIN_PASSWORD') && \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkdata' => ['url' => 'index.php?module=Users&view=PasswordModal&mode=change&record=' . $userModel->getId()],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modules.Vtiger.resources.Header',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($headerScripts as $headerScript) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Settings' !== $request->getRaw('parent')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADERLINK']) as $links) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'js-show-modal',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_USER_PANEL',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinkInstance = \Vtiger_Link_Model::getInstanceFromValues($headerLink);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_MY_PREFERENCES',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'yfi yfi-change-passowrd',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$additionalTpl = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerCssInstances[] = $cssScriptModel->set('href', $prefix . $cssLink->linkurl);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($userModel->isAdmin() || $userModel->isSuperUser()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'fas fa-cog fa-fw',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'd-block',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_2FA_TOTP_QR_CODE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'yfi yfi-login-history',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'fas fa-power-off fa-fw',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modules.Vtiger.resources.AdvanceFilter',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADERSCRIPT']) as $headerScripts) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkdata' => ['url' => 'index.php?module=Users&view=MeetingModal&record=' . \App\User::getCurrentUserRealId()],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'fas fa-power-off fa-fw',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($headerLink['childlinks'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($headerLink['childlinks'] as $childLink) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_ACCOUNT_SETTINGS',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'fas fa-key',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkdata' => ['url' => $userModel->getSwitchUsersUrl()],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'GROUPNAME',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'showModal d-block',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'HEADERLINK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_SIGN_OUT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Link_Model[] - List of Vtiger_Link_Model instances
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'showModal d-block',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'd-none d-sm-none d-md-block',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getHeaderAdditionalTpl(\App\Request $request): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Config::security('CHANGE_LOGIN_PASSWORD') && \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'fas fa-exchange-alt fa-fw',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Link_Model[] - List of Vtiger_Link_Model instances
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $additionalTpl;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getUserQuickMenuLinks(\App\Request $request): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\Users_Module_Model::getSwitchUsers()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linktype' => 'SEPARATOR',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $headerLinkInstances;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userModel = \Users_Record_Model::getCurrentUserModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => $userModel->getPreferenceDetailViewUrl(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => 'fas fa-user-cog fa-fw',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkurl' => '',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the list of menu.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (\Vtiger_Link_Model::getAllByType(\vtlib\Link::IGNORE_MODULE, ['HEADER_ADDITIONAL_TPL']) as $links) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkclass' => 'd-none d-sm-none d-md-block js-post-action',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$headerLinkInstances[] = \Vtiger_Link_Model::getInstanceFromValues($headerLink);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($links as $headerLink) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linklabel' => 'LBL_CHANGE_PASSWORD',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'linkdata' => ['url' => 'index.php?module=Users&view=TwoFactorAuthenticationModal&record=' . $userModel->getId()],
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
'linkdata' => ['url' => 'index.php?module=Users&view=TwoFactorAuthenticationModal&record=' . $userModel->getId()],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Expected 0 spaces after opening bracket; newline found Open
if (
- Exclude checks