modules/Vtiger/views/BasicModal.php
The method preProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation. Open
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
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 '$request'. Open
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
Returning type \App\Controller\View\Vtiger_CssScript_Model[]
but getModalCss()
is declared to return \Vtiger_CssScript_Model[]
Open
Open
return $this->checkAndConvertCssStyles([
- Exclude checks
Returning type \App\Controller\View\Vtiger_JsScript_Model[]
but getModalScripts()
is declared to return \Vtiger_JsScript_Model[]
Open
Open
return $this->checkAndConvertJsScripts([
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Vtiger_BasicModal_View extends Vtiger_IndexAjax_View
- Exclude checks
The class Vtiger_BasicModal_View is not named in CamelCase. Open
Open
class Vtiger_BasicModal_View extends Vtiger_IndexAjax_View
{
/** @var string Additional classes for the modal window. */
protected $modalClass = '';
- 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
Open
public function getSize(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return Vtiger_CssScript_Model[] - List of Vtiger_JsScript_Model instances
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function preProcess(App\Request $request, $display = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getModalCss(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected $modalClass = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach ($this->getModalCss($request) as $style) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Get modal scripts files that need to loaded in the modal.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $this->checkAndConvertJsScripts([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
"modules.$moduleName.resources.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewName = $request->getByType('view', 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
"modules.$moduleName.$viewName",
- Exclude checks
Line exceeds 120 characters; contains 222 characters Open
Open
echo '<div class="modal fade modal' . $moduleName . '' . $viewName . ' ' . $this->modalClass . '" 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
Open
public function process(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return \Vtiger_JsScript_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function postProcess(App\Request $request, $display = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->preProcess($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewName = $request->getByType('view', 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
"modules.Vtiger.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
//Content
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach ($this->getModalScripts($request) as $script) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
"modules.Vtiger.resources.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var string Additional classes for the modal window. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getModalScripts(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function to get the list of Js models to be included.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewName = $request->getByType('view', 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo '<div class="modal fade modal' . $moduleName . '' . $viewName . ' ' . $this->modalClass . '" 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
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $this->checkAndConvertCssStyles([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function get modal size.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo '<link rel="stylesheet" href="' . $style->getHref() . '">';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->postProcess($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo '<script type="' . $script->getType() . '" src="' . $script->getSrc() . '"></script>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
echo '</div></div></div>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
]);
- Exclude checks
Class name "Vtiger_BasicModal_View" is not in camel caps format Open
Open
class Vtiger_BasicModal_View extends Vtiger_IndexAjax_View
- Exclude checks