YetiForceCompany/YetiForceCRM

View on GitHub
tests/Base/I_Privilege.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

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

        $ticketId = (new \App\Db\Query())->from('vtiger_troubletickets')->scalar();
Severity: Minor
Found in tests/Base/I_Privilege.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\PrivilegeUtil' in method 'testPrivilegeUtils'.
Open

        $this->assertNotFalse(\App\PrivilegeUtil::testPrivileges($ticketId));
Severity: Minor
Found in tests/Base/I_Privilege.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

Call to undeclared method \Tests\Base\I_Privilege::assertNotFalse
Open

        $this->assertNotFalse(\App\PrivilegeUtil::testPrivileges($ticketId));
Severity: Critical
Found in tests/Base/I_Privilege.php by phan

Call to undeclared method \App\Db\Query::from
Open

        $ticketId = (new \App\Db\Query())->from('vtiger_troubletickets')->scalar();
Severity: Critical
Found in tests/Base/I_Privilege.php by phan

The class I_Privilege is not named in CamelCase.
Open

class I_Privilege extends \Tests\Base
{
    /**
     * Testing Privilege Utils.
     */
Severity: Minor
Found in tests/Base/I_Privilege.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

    {
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

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

    /**
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

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

    }
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

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

     * Testing Privilege Utils.
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

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

    public function testPrivilegeUtils()
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

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

        $this->assertNotFalse(\App\PrivilegeUtil::testPrivileges($ticketId));
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

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

     */
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

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

        $ticketId = (new \App\Db\Query())->from('vtiger_troubletickets')->scalar();
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

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

class I_Privilege extends \Tests\Base
Severity: Minor
Found in tests/Base/I_Privilege.php by phpcodesniffer

There are no issues that match your filters.

Category
Status