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
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
Avoid unused parameters such as '$display'. Open
public function preProcess(App\Request $request, $display = true)
- 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 '$display'. Open
public function postProcess(App\Request $request, $display = true)
- 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 getSize(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 method getHref
from undeclared class \App\Controller\View\Vtiger_CssScript_Model
Open
echo '<link rel="stylesheet" href="' . $style->getHref() . '">';
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('VIEW', $viewName);
- Exclude checks
Call to method getSrc
from undeclared class \App\Controller\View\Vtiger_JsScript_Model
Open
echo '<script type="' . $script->getType() . '" src="' . $script->getSrc() . '"></script>';
- Exclude checks
Call to method getType
from undeclared class \App\Controller\View\Vtiger_JsScript_Model
Open
echo '<script type="' . $script->getType() . '" src="' . $script->getSrc() . '"></script>';
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_Vtiger_BasicModal_View extends Settings_Vtiger_IndexAjax_View
- Exclude checks
The class Settings_Vtiger_BasicModal_View is not named in CamelCase. Open
class Settings_Vtiger_BasicModal_View extends Settings_Vtiger_IndexAjax_View
{
public function preProcess(App\Request $request, $display = true)
{
$moduleName = $request->getModule();
- 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 getModalCss(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
//Content
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<link rel="stylesheet" href="' . $style->getHref() . '">';
- 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
$viewName = $request->getByType('view', 1);
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewName = $request->getByType('view', 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"modules.Settings.{$request->getModule()}.resources.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"modules.Settings.Vtiger.resources.$viewName",
- 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
public function postProcess(App\Request $request, $display = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '</div></div></div>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->preProcess($request);
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"modules.Settings.{$request->getModule()}.$viewName",
- 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->checkAndConvertJsScripts([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 196 characters Open
echo '<div class="modal fade modal' . $moduleName . '' . $viewName . '" id="modal' . $viewName . '"><div class="modal-dialog ' . $this->getSize($request) . '"><div class="modal-content">';
- 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
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewName = $request->getByType('view', 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getModalCss($request) as $style) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->getModalScripts($request) as $script) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->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
return $this->checkAndConvertCssStyles([
- 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 '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<div class="modal fade modal' . $moduleName . '' . $viewName . '" id="modal' . $viewName . '"><div class="modal-dialog ' . $this->getSize($request) . '"><div class="modal-content">';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
echo '<script type="' . $script->getType() . '" src="' . $script->getSrc() . '"></script>';
- 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
"modules.Settings.Vtiger.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('VIEW', $viewName);
- Exclude checks
Class name "Settings_Vtiger_BasicModal_View" is not in camel caps format Open
class Settings_Vtiger_BasicModal_View extends Settings_Vtiger_IndexAjax_View
- Exclude checks