YetiForceCompany/YetiForceCRM

View on GitHub
app/Labels.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Fields\Owner' in method 'member'.
Open

                $name = \App\Fields\Owner::getUserLabel((int) $id) ?: '';
Severity: Minor
Found in app/Labels.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\Fields\Owner' in method 'member'.
Open

                $name = \App\Fields\Owner::getGroupName((int) $id) ?: '';
Severity: Minor
Found in app/Labels.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\PrivilegeUtil' in method 'role'.
Open

}
Severity: Minor
Found in app/Labels.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 method getGroupName from undeclared class \App\Fields\Owner
Open

                $name = \App\Fields\Owner::getGroupName((int) $id) ?: '';
Severity: Critical
Found in app/Labels.php by phan

Call to method getUserLabel from undeclared class \App\Fields\Owner
Open

                $name = \App\Fields\Owner::getUserLabel((int) $id) ?: '';
Severity: Critical
Found in app/Labels.php by phan

Avoid variables with short names like $id. Configured minimum length is 3.
Open

        [$type, $id] = explode(':', $member);
Severity: Minor
Found in app/Labels.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

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

    /**
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     * @return string
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

        [$type, $id] = explode(':', $member);
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

                break;
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

                break;
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     * @param string $member
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

        $name = '';
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

        return \App\PrivilegeUtil::getRoleDetail($roleId)['rolename'] ?? '';
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

            case \App\PrivilegeUtil::MEMBER_TYPE_USERS:
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

                $name = \App\Fields\Owner::getUserLabel((int) $id) ?: '';
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

            case \App\PrivilegeUtil::MEMBER_TYPE_ROLES:
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

            case \App\PrivilegeUtil::MEMBER_TYPE_ROLE_AND_SUBORDINATES:
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

            case \App\PrivilegeUtil::MEMBER_TYPE_GROUPS:
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

                $name = \App\Fields\Owner::getGroupName((int) $id) ?: '';
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

            default:
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

        }
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

        return $name;
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     * Get role name.
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     * Get member name.
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

    /**
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     * @param string $roleId
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

        switch ($type) {
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     */
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

    public static function member(string $member): string
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

                break;
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

                $name = self::role($id);
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

    }
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     *
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

     * @return string
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

                break;
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

    public static function role(string $roleId): string
Severity: Minor
Found in app/Labels.php by phpcodesniffer

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

    {
Severity: Minor
Found in app/Labels.php by phpcodesniffer

There are no issues that match your filters.

Category
Status