YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Notifications/views/Members.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'Vtiger_Watchdog_Model' in method 'addWatchingMembers'.
Open

        $watchdogModel = Vtiger_Watchdog_Model::getInstance($srcModule);

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 'Vtiger_Watchdog_Model' in method 'exceptions'.
Open

        $watchdogModel = Vtiger_Watchdog_Model::getInstance($srcModule);

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

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('IS_TO_ADD', true);

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('MEMBER', $member);

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('SRC_MODULE', $srcModule);

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('MEMBERS', $watchdogModel->getWatchingExceptions($member));

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('SRC_MODULE', $srcModule);

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('RESTRICT_MEMBERS', $watchdogModel->getWatchingMembers());

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

class Settings_Notifications_Members_View extends Settings_Vtiger_BasicModal_View

The class Settings_Notifications_Members_View is not named in CamelCase.
Open

class Settings_Notifications_Members_View extends Settings_Vtiger_BasicModal_View
{
    use \App\Controller\ExposeMethod;

    /**

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

    use \App\Controller\ExposeMethod;

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

    public function addWatchingMembers(App\Request $request)

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

     * Function downloads settings for exceptions.

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

        $this->exposeMethod('addWatchingMembers');

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

    public function exceptions(App\Request $request)

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

        $viewer->assign('SRC_MODULE', $srcModule);

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

     * Constructor.

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

        $mode = $request->getMode();

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

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

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

     * Function gets settings.

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

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

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

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

    /**

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

        if (!empty($mode)) {

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

        $watchdogModel = Vtiger_Watchdog_Model::getInstance($srcModule);

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

        $viewer->assign('RESTRICT_MEMBERS', $watchdogModel->getWatchingMembers());

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

        parent::__construct();

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

        $this->exposeMethod('exceptions');

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

        $viewer->view('Members.tpl', $moduleName);

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

        $viewer->assign('MEMBER', $member);

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

        $this->addWatchingMembers($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

        $this->postProcess($request);

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

    public function __construct()

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

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

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 downloads settings for watched members.

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

        $viewer->assign('IS_TO_ADD', true);

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

        $viewer->assign('SRC_MODULE', $srcModule);

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

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

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

        $member = $request->getByType('member', 'Text');

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

            $this->invokeExposedMethod($mode, $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

        $watchdogModel = Vtiger_Watchdog_Model::getInstance($srcModule);

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

        $viewer->view('MembersExceptions.tpl', $moduleName);

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

     *

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

        $viewer->assign('MEMBERS', $watchdogModel->getWatchingExceptions($member));

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

class Settings_Notifications_Members_View extends Settings_Vtiger_BasicModal_View

There are no issues that match your filters.

Category
Status