File Base.php
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Abstract base view controller file.
*
* @package Controller
Method getFooterScripts
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFooterScripts(\App\Request $request)
{
$jsFileNames = [
'~libraries/block-ui/jquery.blockUI.js',
'~libraries/select2/dist/js/select2.full.js',
Method loadJsConfig
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadJsConfig(\App\Request $request)
{
$jsEnv = [
'skinPath' => \Vtiger_Theme::getCurrentUserThemePath(),
'siteUrl' => \App\Layout::getPublicUrl('', true),
Method getHeaderCss
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHeaderCss(\App\Request $request)
{
return $this->checkAndConvertCssStyles([
'~layouts/resources/icons/adminIcon.css',
'~layouts/resources/icons/additionalIcons.css',
Function checkAndConvertJsScripts
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function checkAndConvertJsScripts($jsFileNames)
{
$fileExtension = 'js';
$instances = [];
$min = \App\Config::developer('MINIMIZE_JS');
- 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 checkAndConvertCssStyles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function checkAndConvertCssStyles($fileNames, $fileExtension = 'css')
{
$instances = [];
$min = \App\Config::developer('MINIMIZE_CSS');
$layoutPaths = \App\Layout::getLayoutPaths();
- 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
Avoid using undefined variables such as '$dayOfWeekForJS' which will lead to PHP notices. Open
'firstDayOfWeekNo' => \App\Fields\Date::$dayOfWeekForJS[$userModel->getDetail('dayoftheweek')] ?? false,
- Read upRead up
- Exclude checks
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
The class Base has a coupling between objects value of 23. Consider to reduce the number of dependencies under 13. Open
abstract class Base extends \App\Controller\Base
{
/**
* Viewer instance.
*
- 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
Missing class import via use statement (line '392', column '20'). Open
$instance = 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
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 '354', column '20'). Open
$instance = new \Vtiger_JsScript_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
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
Avoid using static access to class '\App\User' in method 'getViewer'. Open
$user = \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 '\App\Config' in method 'loadJsConfig'. Open
'intervalForNotificationNumberCheck' => \App\Config::performance('INTERVAL_FOR_NOTIFICATION_NUMBER_CHECK'),
- 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\Language' in method 'getPageTitle'. Open
$prefix = \App\Language::translate($moduleName, $qualifiedModuleName) . ' ';
- 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_Loader' in method 'checkAndConvertJsScripts'. Open
if ($realPath = \Vtiger_Loader::getRealPathFile($jsFileName, $fileExtension, $layoutPaths)) {
- 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
'globalSearchAutocompleteMinLength' => \App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_MIN_LENGTH'),
- 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
'debug' => (bool) \App\Config::debug('JS_DEBUG'),
- 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\Fields\Date' in method 'loadJsConfig'. Open
'dateFormatJs' => \App\Fields\Date::currentUserJSDateFormat($userModel->getDetail('date_format')),
- 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\Fields\Currency' in method 'loadJsConfig'. Open
}
- 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\Language' in method 'getPageTitle'. Open
$title = \App\Language::translate($this->pageTitle, $qualifiedModuleName);
- 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\Language' in method 'preProcess'. Open
$view->assign('HTMLLANG', \App\Language::getShortLanguageName());
- 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_Theme' in method 'getHeaderCss'. Open
'~' . \Vtiger_Theme::getThemeStyle(),
- 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_Loader' in method 'getFooterScripts'. Open
if (!file_exists(\Vtiger_Loader::resolveNameToPath($fileName, 'js'))) {
- 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\Cache' in method 'checkAndConvertJsScripts'. Open
$instanceData = \App\Cache::get('ConvertJsScripts', $cacheName);
- 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 '403', column '8'). Open
public function checkAndConvertCssStyles($fileNames, $fileExtension = 'css')
{
$instances = [];
$min = \App\Config::developer('MINIMIZE_CSS');
$layoutPaths = \App\Layout::getLayoutPaths();
- 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 '\App\User' in method 'loadJsConfig'. 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_Theme' in method 'getHeaderCss'. Open
'~' . \Vtiger_Theme::getBaseStylePath(),
- 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\Language' in method 'getFooterScripts'. Open
$languageHandlerShortName = \App\Language::getShortLanguageName();
- 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\Cache' in method 'checkAndConvertCssStyles'. Open
\App\Cache::save('ConvertCssStyles', $cacheName, ['href' => $instance->get('href'), 'base' => $instance->get('base')], \App\Cache::LONG);
- 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 'loadJsConfig'. 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 '\Users_Record_Model' in method 'getViewer'. Open
$this->viewer->assign('USER_MODEL', \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 '\App\Config' in method 'loadJsConfig'. Open
'purifierAllowedDomains' => \App\Config::security('purifierAllowedDomains', []),
- 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 getPageTitle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$title = $this->getBreadcrumbTitle($request);
}
- 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 '\App\Language' in method 'getBreadcrumbTitle'. Open
return \App\Language::translate($this->pageTitle, $request->getModule(false));
- 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\Language' in method 'loadJsConfig'. Open
'langPrefix' => \App\Language::getLanguage(),
- 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
'maxUploadLimit' => \App\Config::getMaxUploadSize(),
- 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_Viewer' in method 'getViewer'. Open
$this->viewer = \Vtiger_Viewer::getInstance();
- 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_Theme' in method 'loadJsConfig'. Open
'skinPath' => \Vtiger_Theme::getCurrentUserThemePath(),
- 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\Layout' in method 'loadJsConfig'. Open
'layoutPath' => \App\Layout::getPublicUrl('layouts/' . \App\Layout::getActiveLayout()),
- 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\Language' in method 'loadJsConfig'. Open
'langKey' => \App\Language::getShortLanguageName(),
- 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
'recordPopoverDelay' => \App\Config::performance('RECORD_POPOVER_DELAY'),
- 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\Layout' in method 'loadJsConfig'. Open
'layoutPath' => \App\Layout::getPublicUrl('layouts/' . \App\Layout::getActiveLayout()),
- 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\Layout' in method 'loadJsConfig'. Open
'siteUrl' => \App\Layout::getPublicUrl('', true),
- 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\Layout' in method 'loadJsConfig'. Open
'soundFilesPath' => \App\Layout::getPublicUrl('layouts/resources/sounds/'),
- 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\YetiForce\Shop' in method 'loadJsConfig'. Open
'disableBranding' => \App\YetiForce\Shop::check('YetiForceDisableBranding'),
- 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\Cache' in method 'checkAndConvertCssStyles'. Open
if (\App\Cache::has('ConvertCssStyles', $cacheName)) {
- 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
'sounds' => \App\Config::sounds(),
- 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
'picklistLimit' => \App\Config::performance('picklistLimit'),
- 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 'checkAndConvertCssStyles'. Open
$min = \App\Config::developer('MINIMIZE_CSS');
- 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
'searchShowOwnerOnlyInList' => \App\Config::performance('SEARCH_SHOW_OWNER_ONLY_IN_LIST'),
- 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\Language' in method 'getViewer'. Open
$this->viewer->assign('APPTITLE', \App\Language::translate('APPTITLE'));
- 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\Version' in method 'getViewer'. Open
$this->viewer->assign('YETIFORCE_VERSION', \App\Version::get());
- 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 'getViewer'. Open
$this->viewer->assign('NONCE', \App\Session::get('CSP_TOKEN'));
- 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\Layout' in method 'checkAndConvertJsScripts'. Open
$layoutPaths = \App\Layout::getLayoutPaths();
- 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\Layout' in method 'checkAndConvertCssStyles'. Open
$layoutPaths = \App\Layout::getLayoutPaths();
- 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\Layout' in method 'preProcess'. Open
$view->assign('LAYOUT_PATH', \App\Layout::getPublicUrl('layouts/' . \App\Layout::getActiveLayout()));
- 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 'checkAndConvertJsScripts'. Open
$min = \App\Config::developer('MINIMIZE_JS');
- 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\Cache' in method 'checkAndConvertCssStyles'. Open
$instanceData = \App\Cache::get('ConvertCssStyles', $cacheName);
- 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
'globalSearchAutocompleteAmountResponse' => \App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_LIMIT'),
- 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_Theme' in method 'preProcess'. Open
$view->assign('SKIN_PATH', \Vtiger_Theme::getCurrentUserThemePath());
- 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\Language' in method 'preProcess'. Open
$view->assign('LANGUAGE', \App\Language::getLanguage());
- 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 '365', column '8'). Open
public function checkAndConvertJsScripts($jsFileNames)
{
$fileExtension = 'js';
$instances = [];
$min = \App\Config::developer('MINIMIZE_JS');
- 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 '\App\Config' in method 'loadJsConfig'. Open
'backgroundClosingModal' => \App\Config::main('backgroundClosingModal'),
- 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
'globalSearchAutocompleteActive' => \App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE'),
- 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\Cache' in method 'checkAndConvertJsScripts'. Open
if (\App\Cache::has('ConvertJsScripts', $cacheName)) {
- 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_Loader' in method 'checkAndConvertCssStyles'. Open
if ($realPath = \Vtiger_Loader::getRealPathFile($fileName, $fileExtension, $layoutPaths)) {
- 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\Language' in method 'getJSLanguageStrings'. Open
return \App\Language::getJsStrings($moduleName);
- 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\Layout' in method 'preProcess'. Open
$view->assign('LAYOUT_PATH', \App\Layout::getPublicUrl('layouts/' . \App\Layout::getActiveLayout()));
- 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\Debuger' in method 'getFooterScripts'. Open
if (\App\Debuger::isDebugBar()) {
- 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\Cache' in method 'checkAndConvertJsScripts'. Open
\App\Cache::save('ConvertJsScripts', $cacheName, ['src' => $instance->get('src'), 'base' => $instance->get('base')], \App\Cache::LONG);
- 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
'eventLimit' => \App\Config::module('Calendar', 'EVENT_LIMIT'),
- 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 "rowheight" 3 times. Open
$this->viewer->assign('WIDTHTYPE', $user->getDetail('rowheight'));
- 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 "parent" 4 times. Open
if ($request->isAjax() && !$request->isEmpty('parent', true) && 'Settings' === $request->getByType('parent', 2)) {
- 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 "ConvertJsScripts" 3 times. Open
if (\App\Cache::has('ConvertJsScripts', $cacheName)) {
- 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 "ConvertCssStyles" 3 times. Open
if (\App\Cache::has('ConvertCssStyles', $cacheName)) {
- 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
public function getHeaderCss(\App\Request $request)
- 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 preProcessTplName(\App\Request $request)
- 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
public function getHeaderScripts(\App\Request $request)
- 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
public function getFooterScripts(\App\Request $request)
- 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('LAYOUT_PATH', \App\Layout::getPublicUrl('layouts/' . \App\Layout::getActiveLayout()));
- Exclude checks
Call to method check
from undeclared class \App\YetiForce\Shop
Open
'disableBranding' => \App\YetiForce\Shop::check('YetiForceDisableBranding'),
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('VIEW', $request->getByType('view', 1));
- Exclude checks
Return type of getHeaderCss()
is undeclared type \App\Controller\View\Vtiger_CssScript_Model[]
Open
public function getHeaderCss(\App\Request $request)
- Exclude checks
Return type of checkAndConvertJsScripts()
is undeclared type \App\Controller\View\Vtiger_JsScript_Model[]
Open
public function checkAndConvertJsScripts($jsFileNames)
- 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('PAGETITLE', $title);
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$user = \App\User::getCurrentUserModel();
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('MODULE_NAME', $request->getModule());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('YETIFORCE_VERSION', \App\Version::get());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('QUALIFIED_MODULE', $request->getModule(false));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('LANGUAGE', \App\Language::getLanguage());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('STYLES', $this->getHeaderCss($request));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('SHOW_BODY_HEADER', $this->showBodyHeader());
- Exclude checks
Return type of getHeaderScripts()
is undeclared type \App\Controller\View\Vtiger_JsScript_Model[]
Open
public function getHeaderScripts(\App\Request $request)
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('WIDTHTYPE_GROUP', ['narrow' => 'input-group-sm', 'wide' => 'input-group-lg'][$user->getDetail('rowheight')] ?? '');
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('USER_MODEL', \Users_Record_Model::getCurrentUserModel());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('FOOTER_SCRIPTS', $this->getFooterScripts($request));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('NONCE', \App\Session::get('CSP_TOKEN'));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('HEADER_SCRIPTS', $this->getHeaderScripts($request));
- 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
$this->viewer->assign('APPTITLE', \App\Language::translate('APPTITLE'));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('CURRENT_USER', $user);
- Exclude checks
Returning type string[]
but getJSLanguageStrings()
is declared to return string
Open
return \App\Language::getJsStrings($moduleName);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('SKIN_PATH', \Vtiger_Theme::getCurrentUserThemePath());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('HTMLLANG', \App\Language::getShortLanguageName());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('IS_IE', \App\RequestUtil::getBrowserInfo()->ie);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('MODULE', $moduleName);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('PARENT_MODULE', $request->getByType('parent', 2));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$view->assign('SHOW_FOOTER', false);
- Exclude checks
Return type of checkAndConvertCssStyles()
is undeclared type \App\Controller\View\Vtiger_CssScript_Model[]
Open
public function checkAndConvertCssStyles($fileNames, $fileExtension = 'css')
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$this->viewer->assign('WIDTHTYPE', $user->getDetail('rowheight'));
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
foreach ($jsFileNames as $jsFileName) {
$cacheName = "{$jsFileName} | {$min}";
$instance = new \Vtiger_JsScript_Model();
if (\App\Cache::has('ConvertJsScripts', $cacheName)) {
$instanceData = \App\Cache::get('ConvertJsScripts', $cacheName);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 265.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
foreach ($fileNames as $fileName) {
$cacheName = "{$fileName} | {$min}";
$instance = new \Vtiger_CssScript_Model();
if (\App\Cache::has('ConvertCssStyles', $cacheName)) {
$instanceData = \App\Cache::get('ConvertCssStyles', $cacheName);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 265.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid excessively long variable names like $languageHandlerShortName. Keep variable name length under 20. Open
$languageHandlerShortName = \App\Language::getShortLanguageName();
- Read upRead up
- Exclude checks
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
*/
- 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
protected function showBodyHeader()
- 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
$user = \App\User::getCurrentUserModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->viewer->assign('NONCE', \App\Session::get('CSP_TOKEN'));
- 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
* @var string
- 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
$this->viewer->assign('WIDTHTYPE', $user->getDetail('rowheight'));
- 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
protected $pageTitle;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Viewer instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($this->viewer)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var \Vtiger_Viewer
- 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
* @var string
- 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
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Vtiger_Viewer
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->viewer = \Vtiger_Viewer::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Breadcrumb title.
- 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 getViewer(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->viewer->assign('QUALIFIED_MODULE', $request->getModule(false));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$title = \App\Language::translate($this->pageTitle, $qualifiedModuleName);
- 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('LANGUAGE', \App\Language::getLanguage());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('SHOW_BODY_HEADER', $this->showBodyHeader());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('VIEW', $request->getByType('view', 1));
- 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
'~libraries/@mdi/font/css/materialdesignicons.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/bootstrap-daterangepicker/daterangepicker.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/colors/modules.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Static function to get the Instance of the Vtiger_Viewer.
- 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->viewer->assign('MODULE_NAME', $request->getModule());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->viewer->assign('WIDTHTYPE_GROUP', ['narrow' => 'input-group-sm', 'wide' => 'input-group-lg'][$user->getDetail('rowheight')] ?? '');
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return '';
- 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
$view->assign('PAGETITLE', $title);
- 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
* @return string
- 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
* @param \App\Request $request Request instance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->checkAndConvertCssStyles([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/jQuery-Validation-Engine/css/validationEngine.jquery.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css',
- 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
protected $viewer;
- 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
return false;
- 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->viewer->assign('YETIFORCE_VERSION', \App\Version::get());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->viewer->assign('CURRENT_USER', $user);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$title = $this->getBreadcrumbTitle($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
}
- 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
'~libraries/simplebar/dist/simplebar.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/emoji-mart-vue-fast/css/emoji-mart.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/colors/picklists.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Page title.
- 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->viewer->assign('IS_IE', \App\RequestUtil::getBrowserInfo()->ie);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qualifiedModuleName = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $prefix . $title;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->breadcrumbTitle;
- 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
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function preProcessTplName(\App\Request $request)
- 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
'~layouts/resources/styleTemplate.css',
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function preProcessDisplay(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/icons/adminIcon.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/icons/additionalIcons.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/icons/yfm.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@fortawesome/fontawesome-free/css/all.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/tributejs/dist/tribute.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Show bread crumbs.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->viewer->assign('USER_MODEL', \Users_Record_Model::getCurrentUserModel());
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
if ($request->isAjax() && !$request->isEmpty('parent', true) && 'Settings' === $request->getByType('parent', 2)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getPageTitle(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$prefix = \App\Language::translate($moduleName, $qualifiedModuleName) . ' ';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($this->pageTitle)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Language::translate($this->pageTitle, $request->getModule(false));
- 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
* @param mixed $display
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_CssScript_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@pnotify/desktop/dist/PNotifyDesktop.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $request->getByType('module', 'Alnum');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get breadcrumb title.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getBreadcrumbTitle(\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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/perfect-scrollbar/css/perfect-scrollbar.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~' . \Vtiger_Theme::getBaseStylePath(),
- 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
protected $breadcrumbTitle;
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- 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
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/bootstrap-tabdrop/css/tabdrop.css',
- 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
return $this->viewer;
- 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
* Pre process template name.
- 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
* Post process function.
- 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
'~layouts/resources/icons/yfi.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/select2/dist/css/select2.css',
- 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->viewer->assign('APPTITLE', \App\Language::translate('APPTITLE'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($request->isAjax() && !$request->isEmpty('parent', true) && 'Settings' === $request->getByType('parent', 2)) {
- 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 (isset($this->pageTitle)) {
- 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
'~libraries/overlayscrollbars/css/OverlayScrollbars.css',
- 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
* Get page title.
- 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
$title = $this->getPageTitle($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
* Pre process display function.
- 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('FOOTER_SCRIPTS', $this->getFooterScripts($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get header css files that need to loaded in the page.
- 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
'~libraries/@pnotify/confirm/dist/PNotifyConfirm.css',
- 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 ('Vtiger' !== $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
$this->loadJsConfig($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('LAYOUT_PATH', \App\Layout::getPublicUrl('layouts/' . \App\Layout::getActiveLayout()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getViewer($request)->view($this->preProcessTplName($request), $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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@pnotify/core/dist/PNotify.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@pnotify/bootstrap4/dist/PNotifyBootstrap4.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~src/css/quasar.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~' . \Vtiger_Theme::getThemeStyle(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get header scripts files that need to loaded in the page.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/select2/dist/js/select2.full.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/vue/dist/vue.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/quasar/dist/icon-set/mdi-v3.umd.min.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
continue;
- 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 Vtiger_CssScript_Model[]
- 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
$view->assign('HEADER_SCRIPTS', $this->getHeaderScripts($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('STYLES', $this->getHeaderCss($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('LANGUAGE_STRINGS', $this->getJSLanguageStrings($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('HTMLLANG', \App\Language::getShortLanguageName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('MODULE', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('PARENT_MODULE', $request->getByType('parent', 2));
- 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
'~libraries/jquery-ui-dist/jquery-ui.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request Request instance
- 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
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/jQuery-Validation-Engine/js/jquery.validationEngine.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/mousetrap/mousetrap.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
if (\App\Cache::has('ConvertJsScripts', $cacheName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instances[$jsFileName] = $instance;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$layoutPaths = \App\Layout::getLayoutPaths();
- 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 string
- 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
$view = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('SKIN_PATH', \Vtiger_Theme::getCurrentUserThemePath());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 'PageHeader.tpl';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view->assign('SHOW_FOOTER', false);
- 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
*
- 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
'~libraries/@pnotify/mobile/dist/PNotifyMobile.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/footable/css/footable.core.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/colors/owners.css',
- 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 = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->checkAndConvertJsScripts($jsFileNames);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/microplugin/src/microplugin.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/blueimp-file-upload/js/jquery.fileupload.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/Tools.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instanceData = \App\Cache::get('ConvertJsScripts', $cacheName);
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$instances[$jsFileName] = $instance->set('base', $instanceData['base'])->set('src', $instanceData['src']);
- 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 (isset($this->breadcrumbTitle)) {
- 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
'~libraries/animate.css/animate.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/colors/calendar.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/colors/fields.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getHeaderScripts(\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
'~libraries/jquery-ui-dist/jquery-ui.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/bootstrap/dist/js/bootstrap.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/helper.js',
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$fileFullPrefix = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . (IS_PUBLIC_DIR ? 'public_html' . \DIRECTORY_SEPARATOR : '');
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
$this->viewer->assign('WIDTHTYPE_GROUP', ['narrow' => 'input-group-sm', 'wide' => 'input-group-lg'][$user->getDetail('rowheight')] ?? '');
- 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
/**
- 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
'~libraries/clockpicker/dist/bootstrap4-clockpicker.css',
- 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 getFooterScripts(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@pnotify/bootstrap4/dist/PNotifyBootstrap4.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/ProgressIndicator.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instances = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($jsFileNames as $jsFileName) {
- 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 Vtiger_JsScript_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/url-polyfill/url-polyfill.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/popper.js/dist/umd/popper.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/sifter/sifter.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/moment/min/moment.min.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileName = '~libraries/jQuery-Validation-Engine/js/languages/jquery.validationEngine-en.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
* @param string[] $jsFileNames
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$fileFullPrefix = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . (IS_PUBLIC_DIR ? 'public_html' . \DIRECTORY_SEPARATOR : '');
- 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
* Function returns the Client side language string.
- 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
'searchShowOwnerOnlyInList' => \App\Config::performance('SEARCH_SHOW_OWNER_ONLY_IN_LIST'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$polyfills = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request Request instance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@pnotify/mobile/dist/PNotifyMobile.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@pnotify/confirm/dist/PNotifyConfirm.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/inputmask/dist/jquery.inputmask.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/html2canvas/dist/html2canvas.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/app.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames[] = $fileName;
- 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
$layoutPaths = \App\Layout::getLayoutPaths();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cacheName = "{$jsFileName} | {$min}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fileNames as $fileName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instances[$fileName] = $instance->set('href', $fileName);
- 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
* Function to get the list of Script models to be included.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_JsScript_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/perfect-scrollbar/dist/perfect-scrollbar.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/jquery-slimscroll/jquery.slimscroll.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/quasar/dist/quasar.umd.min.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/store/dist/store.legacy.min.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/Fields.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileFullPrefix = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . (IS_PUBLIC_DIR ? 'public_html' . \DIRECTORY_SEPARATOR : '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strpos($jsFileName, 'http://') || 0 === strpos($jsFileName, 'https://')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($realPath = \Vtiger_Loader::getRealPathFile($jsFileName, $fileExtension, $layoutPaths)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $instances;
- 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
continue;
- 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 getJSLanguageStrings(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Language::getJsStrings($moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currencyCode' => $userModel->getDetail('currency_code'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currencyDecimalSeparator' => $userModel->getDetail('currency_decimal_separator'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($jsEnv as $key => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'libraries.jquery.dist.jquery',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/respond.js/dist/respond.min.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/bootstrap-daterangepicker/daterangepicker.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/footable/dist/footable.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
'skinPath' => \Vtiger_Theme::getCurrentUserThemePath(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'layoutPath' => \App\Layout::getPublicUrl('layouts/' . \App\Layout::getActiveLayout()),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'soundFilesPath' => \App\Layout::getPublicUrl('layouts/resources/sounds/'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'openUrlTarget' => 'base',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'firstDayOfWeekNo' => \App\Fields\Date::$dayOfWeekForJS[$userModel->getDetail('dayoftheweek')] ?? false,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/whatwg-fetch/dist/fetch.umd.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/jquery.class.js/jquery.class.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/floatthead/dist/jquery.floatThead.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/clockpicker/dist/bootstrap4-clockpicker.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/overlayscrollbars/js/jquery.overlayScrollbars.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'libraries.clipboard.dist.clipboard',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileExtension = 'js';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check and convert css files.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fileExtension
- 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
'langPrefix' => \App\Language::getLanguage(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'globalSearchAutocompleteActive' => \App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsEnv += [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'noOfCurrencyDecimals' => (int) $userModel->getDetail('no_of_currency_decimals'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Modifying this file or functions that affect the footer appearance will violate the license terms!!!
- 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
'~libraries/@pnotify/core/dist/PNotify.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/fields/MultiImage.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 checkAndConvertJsScripts($jsFileNames)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance = new \Vtiger_JsScript_Model();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$min = \App\Config::developer('MINIMIZE_CSS');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'intervalForNotificationNumberCheck' => \App\Config::performance('INTERVAL_FOR_NOTIFICATION_NUMBER_CHECK'),
- 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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~vendor/ckeditor/ckeditor/adapters/jquery.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/tributejs/dist/tribute.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
continue;
- 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 string
- 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
'dateFormatJs' => \App\Fields\Date::currentUserJSDateFormat($userModel->getDetail('date_format')),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'timeZone' => $userModel->getDetail('time_zone'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currencyGroupingPattern' => $userModel->getDetail('currency_grouping_pattern'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maxUploadLimit' => \App\Config::getMaxUploadSize(),
- 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 = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/jquery-outside-events/jquery.ba-outside-events.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/Connector.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Debuger::isDebugBar()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->checkAndConvertJsScripts($jsFileNames);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_JsScript_Model[]
- 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
$instances = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cacheName = "{$fileName} | {$min}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance->set('base', $realPath)->set('href', substr($realPath, $rootLength));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Load js config.
- 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
'currencySymbolPlacement' => $userModel->getDetail('currency_symbol_placement'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'userId' => $userModel->getId(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'disableBranding' => \App\YetiForce\Shop::check('YetiForceDisableBranding'),
- 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
'~libraries/html5shiv/html5shiv.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
'~libraries/block-ui/jquery.blockUI.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@pnotify/desktop/dist/PNotifyDesktop.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileName = "~libraries/jQuery-Validation-Engine/js/languages/jquery.validationEngine-$languageHandlerShortName.js";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!file_exists(\Vtiger_Loader::resolveNameToPath($fileName, 'js'))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instances[$jsFileName] = $instance->set('base', $instanceData['base'])->set('src', $instanceData['src']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance->set('base', $realPath)->set('src', substr($realPath, $rootLength));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save('ConvertJsScripts', $cacheName, ['src' => $instance->get('src'), 'base' => $instance->get('base')], \App\Cache::LONG);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rootLength = \strlen($fileFullPrefix);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance = new \Vtiger_CssScript_Model();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($realPath = \Vtiger_Loader::getRealPathFile($fileName, $fileExtension, $layoutPaths)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $instances;
- 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
'siteUrl' => \App\Layout::getPublicUrl('', true),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'backgroundClosingModal' => \App\Config::main('backgroundClosingModal'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'sounds' => \App\Config::sounds(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'hourFormat' => $userModel->getDetail('hour_format'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'eventLimit' => \App\Config::module('Calendar', 'EVENT_LIMIT'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currencySymbol' => $userModel->getDetail('currency_symbol'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'truncateTrailingZeros' => $userModel->getDetail('truncate_trailing_zeros'),
- 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
'~libraries/quasar/dist/quasar.ie.polyfills.umd.min.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsFileNames = array_merge($polyfills, $jsFileNames);
- 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
'~libraries/jquery-hoverintent/jquery.hoverIntent.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~vendor/ckeditor/ckeditor/ckeditor.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/libraries/quasar.config.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$languageHandlerShortName = \App\Language::getShortLanguageName();
- 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
$min = \App\Config::developer('MINIMIZE_JS');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rootLength = \strlen($fileFullPrefix);
- 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 122 characters Open
$instances[$fileName] = $instance->set('base', $instanceData['base'])->set('href', $instanceData['href']);
- 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 ('Settings:Users' === $moduleName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/@pnotify/font-awesome5/dist/PNotifyFontAwesome5.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/bootstrap-tabdrop/js/bootstrap-tabdrop.js',
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$fileName = "~libraries/jQuery-Validation-Engine/js/languages/jquery.validationEngine-$languageHandlerShortName.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
$jsFileNames[] = '~layouts/resources/debugbar/logs.js';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$jsEnv = [
- 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
'globalSearchAutocompleteAmountResponse' => \App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_LIMIT'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'debug' => (bool) \App\Config::debug('JS_DEBUG'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check and convert js scripts.
- 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
// external javascript source file handling
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instances[$jsFileName] = $instance->set('src', $jsFileName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'firstDayOfWeek' => $userModel->getDetail('dayoftheweek'),
- Exclude checks
Line exceeds 120 characters; contains 151 characters Open
\App\Cache::save('ConvertJsScripts', $cacheName, ['src' => $instance->get('src'), 'base' => $instance->get('base')], \App\Cache::LONG);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string[] $fileNames
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currencyGroupingSeparator' => $userModel->getDetail('currency_grouping_separator'),
- 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 checkAndConvertCssStyles($fileNames, $fileExtension = 'css')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileFullPrefix = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . (IS_PUBLIC_DIR ? 'public_html' . \DIRECTORY_SEPARATOR : '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Cache::has('ConvertCssStyles', $cacheName)) {
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
\App\Cache::save('ConvertCssStyles', $cacheName, ['href' => $instance->get('href'), 'base' => $instance->get('base')], \App\Cache::LONG);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'dateFormat' => $userModel->getDetail('date_format'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'startHour' => $userModel->getDetail('start_hour'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'endHour' => $userModel->getDetail('end_hour'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currencyName' => $userModel->getDetail('currency_name'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'globalSearchDefaultOperator' => \App\RecordSearch::OPERATORS[$userModel->getDetail('default_search_operator')],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save('ConvertCssStyles', $cacheName, ['href' => $instance->get('href'), 'base' => $instance->get('base')], \App\Cache::LONG);
- 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
'modalTarget' => 'base',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currencyId' => $userModel->getDetail('currency_id'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'purifierAllowedDomains' => \App\Config::security('purifierAllowedDomains', []),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = 'Users';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'langKey' => \App\Language::getShortLanguageName(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'rowHeight' => $userModel->getDetail('rowheight'),
- 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
$instances[$fileName] = $instance->set('base', $instanceData['base'])->set('href', $instanceData['href']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === strpos($fileName, 'http://') || 0 === strpos($fileName, 'https://')) {
- 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
$instances[$fileName] = $instance;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function loadJsConfig(\App\Request $request)
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
'globalSearchDefaultOperator' => \App\RecordSearch::OPERATORS[$userModel->getDetail('default_search_operator')],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// external javascript source file handling
- 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
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'picklistLimit' => \App\Config::performance('picklistLimit'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'defaultCurrencyId' => \App\Fields\Currency::getDefault()['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
$instanceData = \App\Cache::get('ConvertCssStyles', $cacheName);
- 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
'parentModule' => $request->getByType('parent', 2),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'globalSearchAutocompleteMinLength' => \App\Config::search('GLOBAL_SEARCH_AUTOCOMPLETE_MIN_LENGTH'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'recordPopoverDelay' => \App\Config::performance('RECORD_POPOVER_DELAY'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'fieldsReferencesDependent' => \Config\Security::$fieldsReferencesDependent,
- 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