Avoid using static access to class '\App\Log' in method 'process'. Open
\App\Log::trace('End ' . __METHOD__);
- 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\Log' in method 'process'. Open
\App\Log::trace('Start ' . __METHOD__);
- 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 'Settings_Inventory_Module_Model' in method 'process'. Open
$config = Settings_Inventory_Module_Model::getConfig($view);
- 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 unused parameters such as '$request'. Open
public function getPageLabels(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
$viewer->assign('VIEW', $view);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('End ' . __METHOD__);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('CONFIG', $config);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('PAGE_LABELS', $this->getPageLabels($request));
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Start ' . __METHOD__);
- Exclude checks
Avoid excessively long class names like Settings_Inventory_DiscountConfiguration_View. Keep class name length under 40. Open
class Settings_Inventory_DiscountConfiguration_View extends Settings_Vtiger_Index_View
{
public function getView()
{
return 'DiscountConfiguration';
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_Inventory_DiscountConfiguration_View extends Settings_Vtiger_Index_View
- Exclude checks
The class Settings_Inventory_DiscountConfiguration_View is not named in CamelCase. Open
class Settings_Inventory_DiscountConfiguration_View extends Settings_Vtiger_Index_View
{
public function getView()
{
return 'DiscountConfiguration';
- 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
public function getPageLabels(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view = $this->getView();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('CONFIG', $config);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$translations = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qualifiedModule = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('Config.tpl', $qualifiedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('End ' . __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$view = $this->getView();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$translations['title_single'] = 'LBL_' . strtoupper($view) . '_SINGLE';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('PAGE_LABELS', $this->getPageLabels($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('VIEW', $view);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getView()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('QUALIFIED_MODULE', $qualifiedModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$config = Settings_Inventory_Module_Model::getConfig($view);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$translations['title'] = 'LBL_' . strtoupper($view);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFooterScripts(App\Request $request)
- Exclude checks
Line exceeds 120 characters; contains 165 characters Open
return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts(['modules.Settings.' . $request->getModule() . '.resources.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
\App\Log::trace('Start ' . __METHOD__);
- 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
return $translations;
- 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
public function process(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
$translations['description'] = 'LBL_' . strtoupper($view) . '_DESCRIPTION';
- 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 array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts(['modules.Settings.' . $request->getModule() . '.resources.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
return 'DiscountConfiguration';
- 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
Class name "Settings_Inventory_DiscountConfiguration_View" is not in camel caps format Open
class Settings_Inventory_DiscountConfiguration_View extends Settings_Vtiger_Index_View
- Exclude checks