Avoid using static access to class 'Vtiger_Watchdog_Model' in method 'process'. Open
$watchingModules = Vtiger_Watchdog_Model::getWatchingModules();
- 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_Watchdog_Model' in method 'process'. Open
$moduleList = Vtiger_Watchdog_Model::getSupportedModules();
- 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_Watchdog_Model' in method 'process'. Open
$scheduleData = Vtiger_Watchdog_Model::getWatchingModulesSchedule();
- 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 '\vtlib\Cron' in method 'process'. Open
$viewer->assign('CRON_INFO', \vtlib\Cron::getInstance('LBL_SEND_NOTIFICATIONS'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Privilege' in method 'process'. Open
if (!\App\Privilege::isPermitted($module->getName(), 'WatchingModule')) {
- 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_Watchdog_Model' in method 'process'. Open
$viewer->assign('WATCHING_MODEL', Vtiger_Watchdog_Model::getInstance($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
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('CRON_INFO', \vtlib\Cron::getInstance('LBL_SEND_NOTIFICATIONS'));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('WATCHING_MODEL', Vtiger_Watchdog_Model::getInstance($moduleName));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE_LIST', $moduleList);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SCHEDULE_DATA', $scheduleData ?? null);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('WATCHING_MODULES', $watchingModules);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SELECT_ALL_MODULES', $selectedAllModules);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('FREQUENCY', $scheduleData['frequency'] ?? null);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('IS_ALL_EMAIL_NOTICE', $selectedAllSendNotice);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE', $moduleName);
- Exclude checks
Avoid excessively long variable names like $selectedAllSendNotice. Keep variable name length under 20. Open
$selectedAllSendNotice = \count($moduleList) === \count($scheduleData['modules'] ?? []) ? true : false;
- 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
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Notification_NotificationConfig_View extends Vtiger_BasicModal_View
- Exclude checks
The class Notification_NotificationConfig_View is not named in CamelCase. Open
class Notification_NotificationConfig_View extends Vtiger_BasicModal_View
{
/** {@inheritdoc} */
public function getSize(App\Request $request)
{
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($moduleList as $tabId => &$module) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('CRON_INFO', \vtlib\Cron::getInstance('LBL_SEND_NOTIFICATIONS'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/datatables.net-bs4/js/dataTables.bootstrap4.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MODULE_LIST', $moduleList);
- 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
public function getModalScripts(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSize(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$selectedAllSendNotice = \count($moduleList) === \count($scheduleData['modules'] ?? []) ? true : false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SELECT_ALL_MODULES', $selectedAllModules);
- 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 process(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]), parent::getModalScripts($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$selectedAllModules = \count($moduleList) === \count($watchingModules) ? true : false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('IS_ALL_EMAIL_NOTICE', $selectedAllSendNotice);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SCHEDULE_DATA', $scheduleData ?? null);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('NotificationConfig.tpl', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\App\Privilege::isPermitted($module->getName(), 'WatchingModule')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$watchingModules = Vtiger_Watchdog_Model::getWatchingModules();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('WATCHING_MODULES', $watchingModules);
- 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->assign('MODULE', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::postProcess($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
$viewer->assign('WATCHING_MODEL', Vtiger_Watchdog_Model::getInstance($moduleName));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 'modal-lg';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleList = Vtiger_Watchdog_Model::getSupportedModules();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return array_merge($this->checkAndConvertJsScripts([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::preProcess($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/datatables.net/js/jquery.dataTables.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/datatables.net-responsive/js/dataTables.responsive.js',
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($moduleList[$tabId]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$scheduleData = Vtiger_Watchdog_Model::getWatchingModulesSchedule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('FREQUENCY', $scheduleData['frequency'] ?? null);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/datatables.net-responsive-bs4/js/responsive.bootstrap4.js'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Class name "Notification_NotificationConfig_View" is not in camel caps format Open
class Notification_NotificationConfig_View extends Vtiger_BasicModal_View
- Exclude checks