YetiForceCompany/YetiForceCRM

View on GitHub
modules/Users/views/MeetingModal.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Missing class import via use statement (line '25', column '14').
Open

            throw new \App\Exceptions\NoPermittedToRecord('LBL_PERMISSION_DENIED', 406);
Severity: Minor
Found in modules/Users/views/MeetingModal.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class '\App\User' in method 'checkPermission'.
Open

        $userId = \App\User::getCurrentUserRealId();
Severity: Minor
Found in modules/Users/views/MeetingModal.php by phpmd

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\Privilege' in method 'checkPermission'.
Open

        if ($userId !== $request->getInteger('record') || !\App\MeetingService::getInstance()->isActive() || !\App\Privilege::isPermitted($request->getModule(), 'MeetingUrl', false, $userId)) {
Severity: Minor
Found in modules/Users/views/MeetingModal.php by phpmd

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\MeetingService' in method 'initMeetingData'.
Open

        $meeting = \App\MeetingService::getInstance();
Severity: Minor
Found in modules/Users/views/MeetingModal.php by phpmd

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\Language' in method 'getPageTitle'.
Open

        return \App\Language::translate($this->pageTitle, $request->getModule());
Severity: Minor
Found in modules/Users/views/MeetingModal.php by phpmd

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 unused parameters such as '$request'.
Open

    public function initMeetingData(App\Request $request)
Severity: Minor
Found in modules/Users/views/MeetingModal.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

Call to method getCurrentUserRealId from undeclared class \App\User (Did you mean class \Tests\App\User)
Open

        $userId = \App\User::getCurrentUserRealId();
Severity: Critical
Found in modules/Users/views/MeetingModal.php by phan

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

class Users_MeetingModal_View extends Vtiger_MeetingModal_View

The class Users_MeetingModal_View is not named in CamelCase.
Open

class Users_MeetingModal_View extends Vtiger_MeetingModal_View
{
    /** {@inheritdoc} */
    protected $pageTitle = 'LBL_VIDEO_CONFERENCE';

Severity: Minor
Found in modules/Users/views/MeetingModal.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

        $userId = \App\User::getCurrentUserRealId();

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 checkPermission(App\Request $request)

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

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

        $meeting = \App\MeetingService::getInstance();

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

    protected $pageTitle = 'LBL_VIDEO_CONFERENCE';

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

    }

Line exceeds 120 characters; contains 193 characters
Open

        if ($userId !== $request->getInteger('record') || !\App\MeetingService::getInstance()->isActive() || !\App\Privilege::isPermitted($request->getModule(), 'MeetingUrl', false, $userId)) {

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->moderator = true;

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

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

        if ($userId !== $request->getInteger('record') || !\App\MeetingService::getInstance()->isActive() || !\App\Privilege::isPermitted($request->getModule(), 'MeetingUrl', false, $userId)) {

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

        $this->meetingUrl = $meeting->getUrl(['exp' => strtotime('+48 hours')]);

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 \App\Language::translate($this->pageTitle, $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

            throw new \App\Exceptions\NoPermittedToRecord('LBL_PERMISSION_DENIED', 406);

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

class Users_MeetingModal_View extends Vtiger_MeetingModal_View

There are no issues that match your filters.

Category
Status