Avoid using static access to class 'Settings_Workflows_Module_Model' in method 'process'. Open
$viewer->assign('FIELD_EXPRESSIONS', Settings_Workflows_Module_Model::getExpressions());
- 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 '31', column '8'). Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$qualifiedModuleName = $request->getModule(false);
$workflowModel = Settings_Workflows_Record_Model::getInstance($request->getInteger('for_workflow'));
- 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 'Settings_Workflows_Record_Model' in method 'process'. Open
$workflowModel = Settings_Workflows_Record_Model::getInstance($request->getInteger('for_workflow'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'Vtiger_Module_Model' in method 'process'. Open
$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);
- 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('WORKFLOW_MODEL', $workflowModel);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('FIELD_EXPRESSIONS', Settings_Workflows_Module_Model::getExpressions());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('RELATED_MODULE_MODEL_NAME', '');
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('RELATED_MODULE_MODEL', $relatedModuleModel);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE_MODEL', $workflowModuleModel);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('REFERENCE_FIELD_NAME', $referenceFieldName);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MAPPING_PANEL', $request->get('mappingPanel'));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SOURCE_MODULE', $workflowModuleModel->getName());
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_Workflows_CreateEntity_View extends Settings_Vtiger_Index_View
- Exclude checks
The class Settings_Workflows_CreateEntity_View is not named in CamelCase. Open
class Settings_Workflows_CreateEntity_View extends Settings_Vtiger_Index_View
{
/**
* Main process.
*
- 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
$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('CreateEntity.tpl', $qualifiedModuleName);
- 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
$viewer->assign('SOURCE_MODULE', $workflowModuleModel->getName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedModule = $request->getByType('relatedModule', 2);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fieldModel = current($relatedModuleModel->getReferenceFieldsForModule($workflowModel->getModule()->getName()))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$referenceFieldName = $fieldModel->getName();
- 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('QUALIFIED_MODULE', $qualifiedModuleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$workflowModuleModel = $workflowModel->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('REFERENCE_FIELD_NAME', $referenceFieldName);
- 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
$viewer->assign('MODULE_MODEL', $workflowModuleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($request->has('relatedModule')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('RELATED_MODULE_MODEL', $relatedModuleModel);
- 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('MAPPING_PANEL', $request->get('mappingPanel'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('FIELD_EXPRESSIONS', Settings_Workflows_Module_Model::getExpressions());
- 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
$viewer->assign('WORKFLOW_MODEL', $workflowModel);
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
if ($fieldModel = current($relatedModuleModel->getReferenceFieldsForModule($workflowModel->getModule()->getName()))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('RELATED_MODULE_MODEL_NAME', '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$referenceFieldName = '';
- 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
* Main process.
- 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
$workflowModel = Settings_Workflows_Record_Model::getInstance($request->getInteger('for_workflow'));
- Exclude checks
Class name "Settings_Workflows_CreateEntity_View" is not in camel caps format Open
class Settings_Workflows_CreateEntity_View extends Settings_Vtiger_Index_View
- Exclude checks