YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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)

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)

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)

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)

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)

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() . '">';

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('VIEW', $viewName);

Call to method getSrc from undeclared class \App\Controller\View\Vtiger_JsScript_Model
Open

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

Call to method getType from undeclared class \App\Controller\View\Vtiger_JsScript_Model
Open

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

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

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();

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

    {

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

    public function process(App\Request $request)

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

            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

    {

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

        $viewer = $this->getViewer($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

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

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

            "modules.Settings.{$request->getModule()}.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

            "modules.Settings.Vtiger.resources.$viewName",

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

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

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

        $this->preProcess($request);

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

    {

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

            "modules.Settings.{$request->getModule()}.$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

        return $this->checkAndConvertJsScripts([

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

    {

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">';

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

        $moduleName = $request->getModule();

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

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

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

        $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

        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

    }

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 '';

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">';

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

    public function getSize(App\Request $request)

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

            "modules.Settings.Vtiger.$viewName",

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

        $viewer->assign('VIEW', $viewName);

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

class Settings_Vtiger_BasicModal_View extends Settings_Vtiger_IndexAjax_View

There are no issues that match your filters.

Category
Status