YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Widgets/views/Index.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'App\Module' in method 'process'.
Open

        $sourceModuleName = App\Module::getModuleName($source);

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\Json' in method 'process'.
Open

        $viewer->assign('CHECKBOXS', \App\Json::encode($moduleModel->getCheckboxs($relatedModule)));

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\Module' in method 'process'.
Open

            $source = \App\Module::getModuleId('Accounts');

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\Json' in method 'process'.
Open

        $viewer->assign('FILTERS', \App\Json::encode($moduleModel->getFiletrs($relatedModule)));

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\Json' in method 'process'.
Open

        $viewer->assign('SWITCHES_HEADER', \App\Json::encode($moduleModel->getHeaderSwitch($source)));

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\Json' in method 'process'.
Open

        $viewer->assign('CUSTOM_VIEW', \App\Json::encode($moduleModel->getCustomView($relatedModule)));

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\Relation' in method 'process'.
Open

        $relatedModule = \App\Relation::getByModule($sourceModuleName);

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_Widgets_Module_Model' in method 'process'.
Open

        $moduleModel = Settings_Widgets_Module_Model::getInstance($qualifiedModuleName);

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

Return type of getFooterScripts() is undeclared type \App\Controller\View\Vtiger_JsScript_Model[]
Open

    public function getFooterScripts(App\Request $request)

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('CUSTOM_VIEW', \App\Json::encode($moduleModel->getCustomView($relatedModule)));
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('CHECKBOXS', \App\Json::encode($moduleModel->getCheckboxs($relatedModule)));
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('SWITCHES_HEADER', \App\Json::encode($moduleModel->getHeaderSwitch($source)));
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('MODULE', $moduleName);
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('SOURCE', $source);
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('SOURCEMODULE', $sourceModuleName);
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Return type of getHeaderCss() is undeclared type \App\Controller\View\Vtiger_CssScript_Model[]
Open

    public function getHeaderCss(App\Request $request)

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('MODULE_MODEL', $moduleModel);
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('RELATEDMODULES', $relatedModule);
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('FILTERS', \App\Json::encode($moduleModel->getFiletrs($relatedModule)));
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('WIDGETS', $moduleModel->getWidgets($source));
Severity: Critical
Found in modules/Settings/Widgets/views/Index.php by phan

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

class Settings_Widgets_Index_View extends Settings_Vtiger_Index_View

The class Settings_Widgets_Index_View is not named in CamelCase.
Open

class Settings_Widgets_Index_View extends Settings_Vtiger_Index_View
{
    /** {@inheritdoc} */
    public function process(App\Request $request)
    {

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

        $viewer->assign('QUALIFIED_MODULE', $qualifiedModuleName);

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 array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts([

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

        $qualifiedModuleName = $request->getModule(false);

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

        $moduleModel = Settings_Widgets_Module_Model::getInstance($qualifiedModuleName);

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

        $viewer->assign('SOURCEMODULE', $sourceModuleName);

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

        $viewer->assign('CHECKBOXS', \App\Json::encode($moduleModel->getCheckboxs($relatedModule)));

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

        $viewer->assign('CUSTOM_VIEW', \App\Json::encode($moduleModel->getCustomView($relatedModule)));

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

        $viewer->assign('MODULE', $moduleName);

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

            $source = \App\Module::getModuleId('Accounts');

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

    {

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

        $viewer->assign('SOURCE', $source);

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

        $viewer->assign('MODULE_MODEL', $moduleModel);

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

        $relatedModule = \App\Relation::getByModule($sourceModuleName);

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

        $viewer->assign('SWITCHES_HEADER', \App\Json::encode($moduleModel->getHeaderSwitch($source)));

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

            "modules.Settings.$moduleName.resources.$moduleName",

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

        $viewer->assign('WIDGETS', $moduleModel->getWidgets($source));

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

        $viewer->assign('FILTERS', \App\Json::encode($moduleModel->getFiletrs($relatedModule)));

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

        $viewer->assign('RELATEDMODULES', $relatedModule);

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

    public function getHeaderCss(App\Request $request)

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

        return array_merge(parent::getHeaderCss($request), $this->checkAndConvertCssStyles([

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

    public function getFooterScripts(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

        $viewer->view('Index.tpl', $qualifiedModuleName);

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

            "modules.Settings.$moduleName.resources.$moduleName",

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

        $source = $request->getInteger('source');

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

        if (empty($source)) {

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

        $sourceModuleName = App\Module::getModuleName($source);

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

    {

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

class Settings_Widgets_Index_View extends Settings_Vtiger_Index_View

There are no issues that match your filters.

Category
Status