YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/views/BasicModal.php

Summary

Maintainability
A
0 mins
Test Coverage
B
81%

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)
Severity: Minor
Found in modules/Vtiger/views/BasicModal.php by phpmd

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)
Severity: Minor
Found in modules/Vtiger/views/BasicModal.php by phpmd

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

    public function getSize(App\Request $request)
Severity: Minor
Found in modules/Vtiger/views/BasicModal.php by phpmd

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

        return $this->checkAndConvertCssStyles([
Severity: Minor
Found in modules/Vtiger/views/BasicModal.php by phan

Returning type \App\Controller\View\Vtiger_JsScript_Model[] but getModalScripts() is declared to return \Vtiger_JsScript_Model[]
Open

        return $this->checkAndConvertJsScripts([
Severity: Minor
Found in modules/Vtiger/views/BasicModal.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Vtiger_BasicModal_View extends Vtiger_IndexAjax_View

The class Vtiger_BasicModal_View is not named in CamelCase.
Open

class Vtiger_BasicModal_View extends Vtiger_IndexAjax_View
{
    /** @var string Additional classes for the modal window. */
    protected $modalClass = '';

Severity: Minor
Found in modules/Vtiger/views/BasicModal.php by phpmd

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

    public function getSize(App\Request $request)

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return Vtiger_CssScript_Model[] - List of Vtiger_JsScript_Model instances

Spaces must be used to indent lines; tabs are not allowed
Open

    public function preProcess(App\Request $request, $display = true)

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getModalCss(App\Request $request)

Spaces must be used to indent lines; tabs are not allowed
Open

        $moduleName = $request->getModule();

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $modalClass = '';

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($this->getModalCss($request) as $style) {

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get modal scripts files that need to loaded in the modal.

Spaces must be used to indent lines; tabs are not allowed
Open

        $moduleName = $request->getModule();

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->checkAndConvertJsScripts([

Spaces must be used to indent lines; tabs are not allowed
Open

            "modules.$moduleName.resources.$viewName",

Spaces must be used to indent lines; tabs are not allowed
Open

        ]);

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewName = $request->getByType('view', 1);

Spaces must be used to indent lines; tabs are not allowed
Open

            "modules.$moduleName.$viewName",

Line exceeds 120 characters; contains 222 characters
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">';

Spaces must be used to indent lines; tabs are not allowed
Open

    public function process(App\Request $request)

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return \Vtiger_JsScript_Model[]

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string

Spaces must be used to indent lines; tabs are not allowed
Open

    public function postProcess(App\Request $request, $display = true)

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->preProcess($request);

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewName = $request->getByType('view', 1);

Spaces must be used to indent lines; tabs are not allowed
Open

        return '';

Spaces must be used to indent lines; tabs are not allowed
Open

            "modules.Vtiger.$viewName",

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

        //Content

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($this->getModalScripts($request) as $script) {

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

            "modules.Vtiger.resources.$viewName",

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string Additional classes for the modal window. */

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getModalScripts(App\Request $request)

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get the list of Js models to be included.

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewName = $request->getByType('view', 1);

Spaces must be used to indent lines; tabs are not allowed
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">';

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this->checkAndConvertCssStyles([

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function get modal size.

Spaces must be used to indent lines; tabs are not allowed
Open

        $moduleName = $request->getModule();

Spaces must be used to indent lines; tabs are not allowed
Open

            echo '<link rel="stylesheet" href="' . $style->getHref() . '">';

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->postProcess($request);

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

            echo '<script type="' . $script->getType() . '" src="' . $script->getSrc() . '"></script>';

Spaces must be used to indent lines; tabs are not allowed
Open

        echo '</div></div></div>';

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        ]);

Class name "Vtiger_BasicModal_View" is not in camel caps format
Open

class Vtiger_BasicModal_View extends Vtiger_IndexAjax_View

There are no issues that match your filters.

Category
Status